Abstract base class for compressed sparse matrix storage. More...
#include <CompressedSparseMatrix.hpp>
Public Member Functions | |
virtual | ~CompressedSparseMatrix () |
integer_t | size () const |
integer_t | nnz () const |
const integer_t * | ptr () const |
const integer_t * | ind () const |
const scalar_t * | val () const |
integer_t * | ptr () |
integer_t * | ind () |
scalar_t * | val () |
const integer_t & | ptr (integer_t i) const |
const integer_t & | ind (integer_t i) const |
const scalar_t & | val (integer_t i) const |
integer_t & | ptr (integer_t i) |
integer_t & | ind (integer_t i) |
scalar_t & | val (integer_t i) |
virtual real_t | norm1 () const =0 |
bool | symm_sparse () const |
void | set_symm_sparse (bool symm_sparse=true) |
virtual void | spmv (const DenseM_t &x, DenseM_t &y) const =0 |
virtual void | spmv (const scalar_t *x, scalar_t *y) const =0 |
virtual void | permute (const integer_t *iorder, const integer_t *order) |
virtual void | permute (const std::vector< integer_t > &iorder, const std::vector< integer_t > &order) |
virtual void | permute_columns (const std::vector< integer_t > &perm)=0 |
virtual Equil_t | equilibration () const |
virtual void | equilibrate (const Equil_t &) |
virtual Match_t | matching (MatchingJob, bool apply=true) |
virtual void | apply_matching (const Match_t &) |
virtual void | symmetrize_sparsity () |
virtual void | print () const |
virtual void | print_dense (const std::string &name) const |
virtual void | print_matrix_market (const std::string &filename) const |
virtual int | read_matrix_market (const std::string &filename)=0 |
virtual real_t | max_scaled_residual (const scalar_t *x, const scalar_t *b) const =0 |
virtual real_t | max_scaled_residual (const DenseM_t &x, const DenseM_t &b) const =0 |
Abstract base class for compressed sparse matrix storage.
This is an abstract (pure virtual) base class for compressed sparse matrices.
This is only for square matrices!
The rows and the columns should always be sorted!
TODO make the public interface non-virtual
scalar_t | type used to store matrix values |
integer_t | type used for indices in the row/column pointer arrays and the column/row indices |
|
inlinevirtual |
Virtual destructor.
|
inline |
Return a pointer to the (row/column) indices. For compressed sparse row, this will return a pointer to an array of column indices, 1 for each nonzero.
|
inline |
Return a (const) pointer to the (row/column) indices. For compressed sparse row, this will return a pointer to an array of column indices, 1 for each nonzero.
|
inline |
Access ind[i], ie, the row/column index of the i-th nonzero. This will assert that i >= 0 and i < nnz(). These assertions are removed when compiling in Release mode (adding -DNDEBUG).
|
inline |
Access ind[i], ie, the row/column index of the i-th nonzero. This will assert that i >= 0 and i < nnz(). These assertions are removed when compiling in Release mode (adding -DNDEBUG).
|
virtual |
Reimplemented in strumpack::CSRMatrixMPI< scalar_t, integer_t >.
|
inline |
Return the number of nonzeros in this matrix. For distributed memory matrices, this refer to the global number of nonzeros, not the local number of nonzeros.
|
virtual |
TODO Obtain reordering Anew = A(iorder,iorder). In addition, entries of IND, VAL are sorted in increasing order
Reimplemented in strumpack::CSRMatrixMPI< scalar_t, integer_t >.
|
inline |
Return a pointer to the (row/column) pointer. For a compressed sparse row format, this will be a pointer to an array of dimension size()+1, where element ptr[i] denotes the start (in ind() or val()) of row i, and ptr[i+1] is the end of row i.
|
inline |
Return a (const) pointer to the (row/column) pointer. For a compressed sparse row format, this will be a pointer to an array of dimension size()+1, where element ptr[i] denotes the start (in ind() or val()) of row i, and ptr[i+1] is the end of row i.
|
inline |
Access ptr[i], ie, the start of row i (in ind, or in val). This will assert that i >= 0 and i <= size(). These assertions are removed when compiling in Release mode (adding -DNDEBUG).
|
inline |
Access ptr[i], ie, the start of row i (in ind, or in val). This will assert that i >= 0 and i <= size(). These assertions are removed when compiling in Release mode (adding -DNDEBUG).
|
inline |
Specify that the sparsity pattern of this matrix is symmetric, or not.
symm_sparse | bool, set this to true (default if not provided) to specify that the sparsity pattern is symmetric |
|
inline |
Return the size of this square matrix, ie, the number of rows and columns. For distributed memory matrices, this refer to the global size, not the local size.
|
pure virtual |
Sparse matrix times dense vector/matrix product y = this * x x and y can have multiple columns. y should be pre-allocated!
TODO make the public interface non-virtual
x | input right hand-side vector/matrix, should satisfy x.size() == this->size() |
y | output, result of y = this * x, should satisfy y.size() == this->size() |
Implemented in strumpack::CSRMatrix< scalar_t, integer_t >, strumpack::CSRMatrix< refine_t, integer_t >, and strumpack::CSRMatrixMPI< scalar_t, integer_t >.
|
pure virtual |
Sparse matrix times dense vector product y = this * x x and y can have multiple columns. y should be pre-allocated.
TODO make the public interface non-virtual
x | input right hand-side vector/matrix, should be a pointer to an array of size size() |
y | output, result of y = this * x, should be a pointer to an array of size size(), already allocated |
Implemented in strumpack::CSRMatrix< refine_t, integer_t >, strumpack::CSRMatrix< scalar_t, integer_t >, and strumpack::CSRMatrixMPI< scalar_t, integer_t >.
|
inline |
Check whether the matrix has a symmetric sparsity pattern (as specified in the constructor, will not actually check).
|
inline |
|
inline |
|
inline |
Access ind[i], ie, the value of the i-th nonzero. This will assert that i >= 0 and i < nnz(). These assertions are removed when compiling in Release mode (adding -DNDEBUG).
|
inline |
Access ind[i], ie, the value of the i-th nonzero. This will assert that i >= 0 and i < nnz(). These assertions are removed when compiling in Release mode (adding -DNDEBUG).