1 #ifndef SPARSEMATRIX_CRS_H
2 #define SPARSEMATRIX_CRS_H
10 namespace helpers {
class SparseMatrix_CRS; };
42 double operator()(
unsigned int i,
unsigned int j)
const;
44 unsigned int gn()
const;
52 void PushToRow(
unsigned int j,
double value);
58 void mvprod(
const double *,
double *)
const;
60 void mvprod(
const double *,
double *,
double)
const;
64 int WriteToFile(
const char*,
const char*,
bool=
false)
const;
70 double GetElementInRow(
unsigned int row_index,
unsigned int element_index)
const;
74 void AddList(std::vector< std::unique_ptr<SparseMatrix_CRS> > &);
79 std::vector<double> data;
81 std::vector<unsigned int> col;
83 std::vector<unsigned int> row;
virtual ~SparseMatrix_CRS()=default
void ConvertFromMatrix(const helpers::matrix &dense)
SparseMatrix_CRS(unsigned int n)
double operator()(unsigned int i, unsigned int j) const
unsigned int NumOfElInRow(unsigned int idx) const
void SetGuess(unsigned int)
std::ostream & operator<<(std::ostream &output, helpers::SparseMatrix_CRS &matrix_p)
void ConvertToMatrix(helpers::matrix &dense) const
unsigned int GetElementColIndexInRow(unsigned int row_index, unsigned int element_index) const
double GetElementInRow(unsigned int row_index, unsigned int element_index) const
void PushToRow(unsigned int j, double value)
void PushToRowNext(unsigned int j, double value)
void AddList(std::vector< std::unique_ptr< SparseMatrix_CRS > > &)
int ReadFromFile(const char *, const char *)
int WriteToFile(const char *, const char *, bool=false) const
void mvprod(const double *, double *) const