11 #ifndef __CRMATRIXMPI_H
12 #define __CRMATRIXMPI_H
51 const int *_rowptr,
const int *_colidx,
52 int proc_nrows,
const int *proc_rows);
68 const int *_rowptr,
const int *_colidx,
92 void Initialise (
const int *_rowptr,
const int *_colidx,
103 { *_r0 =
r0; *_r1 =
r1; }
120 MT
Get (
int r,
int c)
const;
162 virtual void Unlink ();
166 bool Exists (
int r,
int c)
const;
168 MT &operator() (
int r,
int c);
170 int Get_index (
int r,
int c)
const;
172 MT GetNext (
int &r,
int &c)
const;
185 { xERROR(
"Not implemented"); }
199 void Add_proc (
int r,
int c, MT val);
254 #ifndef MATHLIB_IMPLEMENTATION
260 #endif // MATHLIB_IMPLEMENTATION
262 #endif // !__CRMATRIXMPI_H
void Initialise(const int *_rowptr, const int *_colidx, const MT *_data=0)
Re-allocate fill structure and assign values.
TVector< MT > Row(int r) const
Returns a vector containing a copy of row `r'.
Virtual base class for sparse matrix types.
Definition: gsmatrix.h:47
TVector< MT > Col(int c) const
Returns a vector containing a copy of column 'c'.
MPI_Datatype mpitp
MPI data type corresponding to template type.
Definition: crmatrix_mpi.h:238
int my_nr
Number of rows managed by this process.
Definition: crmatrix_mpi.h:232
~TCompRowMatrixMPI()
Matrix destructor.
MatrixStorage StorageType() const
Storage class identifier.
Definition: crmatrix_mpi.h:79
compressed row storage (sparse)
Definition: matrix.h:25
int r0
Low row index for this process - OBSOLETE.
Definition: crmatrix_mpi.h:230
void Zero()
Zero all elements, but keep fill structure.
int sze
Number of MPI processes (>= 1)
Definition: crmatrix_mpi.h:210
int * mpi_r0
array of row offsets for all processes
Definition: crmatrix_mpi.h:235
void Ax(const TVector< MT > &x, TVector< MT > &b) const
Matrix-vector product.
MatrixStorage
Definition: matrix.h:20
bool Exists(int r, int c) const
Checks allocation of a matrix element.
MT Get(int r, int c) const
Retrieve a matrix element.
Distributed compressed-row sparse matrix class.
Definition: crmatrix_mpi.h:33
int r1
High row index + 1 for this process - OBSOLETE.
Definition: crmatrix_mpi.h:231
int * mpi_nr
array of row numbers for all processes
Definition: crmatrix_mpi.h:236
void MPIRange(int *_r0, int *_r1) const
Returns the row range of the current process.
Definition: crmatrix_mpi.h:102
int * colidx
Array of column indices.
Definition: crmatrix_mpi.h:228
int * my_r
List of rows owned by this process.
Definition: crmatrix_mpi.h:233
int SparseRow(int r, int *colidx, MT *val) const
Returns a row of the matrix in sparse format.
int rnk
MPI process id (0 <= rnk < sze)
Definition: crmatrix_mpi.h:209
void Add_proc(int r, int c, MT val)
Add a value to a matrix element (process-specific)
void MPIinit()
MPI data initialisation.
TCompRowMatrixMPI()
Creates a matrix of dimension 0 x 0.
int * rowptr
Array of row pointers.
Definition: crmatrix_mpi.h:220