41 void BlockExpand (
int *rowptr,
int *colidx,
int n,
42 int *&browptr,
int *&bcolidx,
int &bn,
43 int blockn,
int blockm);
102 double tol = 1e-10,
double droptol = 1e-3,
int maxit = 500);
107 double tol = 1e-10,
double droptol = 1e-3,
int maxit = 500);
110 #ifdef USE_CUDA_FLOAT
118 TVector<MT> *x,
int nrhs,
double tol,
int maxit = 0,
128 TVector<MT> *x,
int nrhs,
double tol,
int maxit = 0,
130 #endif // USE_CUDA_FLOAT
136 int ML_matvec (ML_Operator *Amat,
int in_length,
double p[],
137 int out_length,
double ap[]);
140 int ML_getrow (ML_Operator *Amat,
int N_requested_rows,
141 int requested_rows[],
int allocated_space,
int columns[],
142 double values[],
int row_lenghts[]);
144 #endif // ML_INTERFACE
150 std::ostream &operator<< (std::ostream &os,
173 friend class CForwardSolver;
174 friend class CForwardSolverPP;
207 const idxtype *_rowptr,
const idxtype *_colidx,
211 idxtype *_rowptr, idxtype *_colidx,
212 MT *data, CopyMode cmode);
233 {
return Submatrix (r1, r2, 0, this->cols); }
238 {
return Submatrix (0, this->rows, c1, c2); }
249 void New (
int nrows,
int ncols);
254 void Identity (
int n);
262 void Initialise (
const idxtype *_rowptr,
const idxtype *_colidx,
267 int GetSparseStructure (
const idxtype **_rowptr,
const idxtype **_colidx)
const
268 { *_rowptr = rowptr, *_colidx = colidx;
299 {
return operator+(-m); }
305 {
return operator+=(-m); }
336 MT &operator() (
int r,
int c);
337 MT
Get (
int r,
int c)
const;
341 bool Exists (
int r,
int c)
const;
350 int SparseRow (
int r, idxtype *ci, MT *rv)
const;
359 void RemoveRow(
int c);
368 MT GetNext (
int &r,
int &c)
const;
374 void Ax_cplx (
const TVector<std::complex<double> > &x,
375 TVector<std::complex<double> > &b)
380 void ATx_cplx (
const TVector<std::complex<double> > &x,
381 TVector<std::complex<double> > &b)
const;
402 MT RowMult (
int r, MT *x)
const;
413 void SetColAccess (
bool yes =
true)
const;
416 void SetDiagAccess (
bool yes =
true)
const;
419 double LargestInRow (
int r,
int i = 0)
const;
423 double LargestInCol (
int c,
int i = 0)
const;
445 void SymbolicCholeskyFactorize (idxtype *&frowptr, idxtype *&fcolidx)
451 void CalculateIncompleteCholeskyFillin (idxtype *&frowptr,
452 idxtype *&fcolidx)
const;
497 TVector<MT> &x,
double tol,
double droptol,
int maxit);
501 TVector<MT> &x,
double tol,
double droptol,
int maxit);
504 #ifdef USE_CUDA_FLOAT
524 void ExportHB (std::ostream &os);
544 void SplitExport (
const char *rootname);
547 friend std::istream &operator>> <> (std::istream &is,
549 friend std::ostream &operator<< <> (std::ostream &os,
554 void ReplaceRow (
int row,
int nz,
int *rcolidx, MT *rval = 0);
564 MT row_mult (
int r1,
int r2,
int from,
int to)
const;
568 MT sparsevec_mult (
int *idx1, MT *val1,
int n1,
569 int *idx2, MT *val2,
int n2)
const;
579 int Get_index (
int r,
int c)
const;
583 MT Get_sorted (
int r,
int c)
const;
584 void Put_sorted (
int r,
int c, MT v);
585 int Get_index_sorted (
int r,
int c)
const;
588 void CholeskySubst (
const TVector<MT> &d,
const MT *b, MT *x)
const;
591 mutable int iterator_pos;
595 mutable bool diag_access;
597 mutable int *diagptr;
601 mutable bool col_access;
603 mutable idxtype *colptr;
605 mutable idxtype *rowidx;
607 mutable idxtype *vofs;
612 friend int ML_matvec<> (ML_Operator *Amat,
int in_length,
double p[],
613 int out_length,
double ap[]);
614 friend int ML_getrow<> (ML_Operator *Amat,
int N_requested_rows,
615 int requested_rows[],
int allocated_space,
int columns[],
616 double values[],
int row_lenghts[]);
617 #endif // ML_INTERFACE
640 #endif // !__CRMATRIX_CC
642 #endif // !__CRMATRIX_H
Virtual base class for sparse matrix types.
Definition: gsmatrix.h:47
void New(int nrows, int ncols)
Reset the matrix dimensions.
Definition: crmatrix_cm.h:37
TCompRowMatrix()
Creates a compressed-row matrix of dimension 0 x 0.
compressed row storage (sparse)
Definition: matrix.h:25
Coordinate-storage sparse matrix class.
Definition: cdmatrix.h:26
Definition: gsmatrix.h:48
MatrixStorage
Definition: matrix.h:20
int SparseRow(int r, idxtype *ci, MT *rv) const
Returns a row of the matrix in sparse format.
Diagonal matrix class.
Definition: crmatrix.h:39
MatrixStorage StorageType() const
Matrix storage class.
Definition: crmatrix.h:226
Compressed-row sparse matrix class.
Definition: cdmatrix.h:27
TVector< MT > Row(int r) const
Returns a vector containing a copy of row `r'.
MT Get(int r, int c) const
Retrieve a matrix element.
Virtual base class for all matrix types (dense and sparse)
Definition: matrix.h:43
void ExportRCV(std::ostream &os)
Write sparse matrix to ASCII output stream.
Dense matrix class.
Definition: crmatrix.h:38
Definition: crmatrix.h:37
bool Exists(int r, int c) const
Checks allocation of a matrix element.
void SetRow(int r, const TVector< MT > &row)
Substitute a row of the matrix.
TVector< MT > Col(int c) const
Returns a vector containing a copy of column 'c'.