38 std::ostream &operator<< (std::ostream &os, const TSymCompRowMatrix<MT> &m);
48 void New (
int nrows,
int ncols);
54 const int *rptr,
const int *cidx,
const MT *data=0);
63 void Initialise (
const int *_rowptr,
const int *_colidx,
68 void AllowColIndexing (
bool yes);
71 void SetColAccess (
bool yes)
const;
74 MT &operator() (
int r,
int c);
75 MT
Get (
int r,
int c)
const;
77 void Add (
int r,
int c,
const MT &val)
78 {
if (r >= c) (*this)(r,c) += val; }
87 int SparseRow (
int r, idxtype *ci, MT *rv)
const;
97 MT GetNext (
int &r,
int &c)
const;
109 void SymbolicCholeskyFactorize (idxtype *&frowptr, idxtype *&fcolidx)
const;
124 mutable idxtype *colptr, *rowidx, *vofs;
125 mutable bool col_access;
128 friend std::istream &operator>> <> (std::istream &is,
130 friend std::ostream &operator<< <> (std::ostream &os,
135 int Get_index (
int r,
int c)
const;
140 mutable int iterator_pos;
142 bool allow_col_indexing;
148 #ifdef NEED_FRIEND_PT
154 #endif // NEED_FRIEND_PT
165 #endif // !__SCRMATRIX_H
Virtual base class for sparse matrix types.
Definition: gsmatrix.h:47
symmetric compressed row storage (sparse)
Definition: matrix.h:27
int SparseRow(int r, idxtype *ci, MT *rv) const
Returns a row of the matrix in sparse format.
MatrixStorage
Definition: matrix.h:20
TVector< MT > Col(int c) const
Returns a vector containing a copy of column 'c'.
Definition: scrmatrix.h:83
MT Get(int r, int c) const
Retrieve a matrix element.
Definition: scrmatrix.h:28
Compressed-row sparse matrix class.
Definition: cdmatrix.h:27
MatrixStorage StorageType() const
Matrix storage class.
Definition: scrmatrix.h:61
TVector< MT > Row(int r) const
Returns a vector containing a copy of row `r'.
void New(int nrows, int ncols)
Reset the matrix dimensions.