SPH
|
Sparse representation of matrix of arbitrary dimension. More...
#include <SparseMatrix.h>
Public Types | |
enum class | Solver { LU , CG , LSCG , BICGSTAB } |
Solvers of sparse systems. More... | |
Public Member Functions | |
SparseMatrix () | |
SparseMatrix (const Size rows, const Size cols) | |
Constructs square n x m empty matrix. More... | |
~SparseMatrix () | |
void | resize (const Size rows, const Size cols) |
Changes the size of the matrix, removing all previous entries. More... | |
void | insert (const Size i, const Size j, const Float value) |
Adds a values to given element of the matrix. More... | |
Expected< Array< Float > > | solve (const Array< Float > &values, const Solver solver, const Float tolerance=0.) |
Sparse representation of matrix of arbitrary dimension.
Definition at line 16 of file SparseMatrix.h.
|
strong |
Solvers of sparse systems.
Definition at line 38 of file SparseMatrix.h.
SparseMatrix::SparseMatrix | ( | ) |
Constructs square n x m empty matrix.
SparseMatrix::~SparseMatrix | ( | ) |
Adds a values to given element of the matrix.
If there is already a nonzero element, both values are summed up.
Changes the size of the matrix, removing all previous entries.
Expected<Array<Float> > SparseMatrix::solve | ( | const Array< Float > & | values, |
const Solver | solver, | ||
const Float | tolerance = 0. |
||
) |
Solvers an equation Ax = b, where A is the sparse matrix and b is given array of values.
values | Array of values b. The size of the array must be the same as the size of the matrix. |
solver | Solver used to solve the system of equations |
tolerance | Threshold used by the stopping criterion, only used by iterative solvers. |