36 void insert(
int row,
int col,
T value);
39 void printToCSR(std::ostream& ofs,
int precision = 8);
42 void readCSR(
const std::vector<T>& values,
const std::vector<int>& col_ind,
const std::vector<int>& row_ptr);
int _cols
Definition sparse_matrix.h:97
const std::map< std::pair< int, int >, T > & getElements() const
Definition sparse_matrix.h:90
T operator()(int row, int col) const
Definition sparse_matrix.cpp:126
std::map< std::pair< int, int >, T > elements
Definition sparse_matrix.h:98
SparseMatrix(int rows, int cols)
Definition sparse_matrix.h:31
SparseMatrix()
Definition sparse_matrix.h:27
void setRows(int rows)
Definition sparse_matrix.h:45
int _rows
Definition sparse_matrix.h:96
int getRows() const
Definition sparse_matrix.h:57
void setSparseThreshold(double sparse_threshold)
Definition sparse_matrix.h:72
void readCSR(const std::vector< T > &values, const std::vector< int > &col_ind, const std::vector< int > &row_ptr)
Read CSR data from arrays.
Definition sparse_matrix.cpp:101
void setCols(int cols)
Definition sparse_matrix.h:51
int getCols() const
Definition sparse_matrix.h:63
double _sparse_threshold
Definition sparse_matrix.h:99
int getNNZ() const
Definition sparse_matrix.h:84
double getSparseThreshold() const
Definition sparse_matrix.h:78
void insert(int row, int col, T value)
Add value to the matrix with row and column indices.
Definition sparse_matrix.cpp:15
void printToCSR(std::ostream &ofs, int precision=8)
Print to CSR format.
Definition sparse_matrix.cpp:31
#define T
Definition exp.cpp:237
Internal helpers shared by the R-space sparse text writers. Declared here (instead of duplicated in e...
Definition csr_reader.cpp:8
void write_csr_banner(std::ostream &ofs)
Write the CSR-format description banner used by every text CSR output (H(R)/S(R), DM(R),...
Definition sparse_matrix.cpp:84