Square sparse matrix.
More...
#include <sparseMat.h>
|
| | SparseMatrix (const MatrixShape &shape) |
| |
| void | clear () |
| |
| void | set (const int i, const int j, const double val) |
| |
| void | add (const int i, const int j, const double val) |
| |
| void | print (std::ostream &flux=std::cout) const |
| |
| double | operator() (const int i, const int j) const |
| |
| template<typename T > |
| void | mult (const std::vector< T > &X, std::vector< T > &Y) |
| |
| template<typename T > |
| void | build_diag_precond (std::vector< T > &D) const |
| |
Square sparse matrix.
This is the sparse matrix class, meant for efficiently computing matrix-vector products.
◆ SparseMatrix()
| algebra::SparseMatrix::SparseMatrix |
( |
const MatrixShape & |
shape | ) |
|
|
inline |
Construct from a matrix shape. Initialize all stored values to zero.
◆ add()
| void algebra::SparseMatrix::add |
( |
const int |
i, |
|
|
const int |
j, |
|
|
const double |
val |
|
) |
| |
|
inline |
Add the provided value at position (i, j), which must belong to the shape. This method is thread-safe.
◆ build_diag_precond()
template<typename T >
| void algebra::SparseMatrix::build_diag_precond |
( |
std::vector< T > & |
D | ) |
const |
|
inline |
Build a diagonal preconditioner D from this matrix.
◆ clear()
| void algebra::SparseMatrix::clear |
( |
| ) |
|
|
inline |
Zero-out all elements, while preserving the shape.
◆ mult()
template<typename T >
| void algebra::SparseMatrix::mult |
( |
const std::vector< T > & |
X, |
|
|
std::vector< T > & |
Y |
|
) |
| |
|
inline |
◆ operator()()
| double algebra::SparseMatrix::operator() |
( |
const int |
i, |
|
|
const int |
j |
|
) |
| const |
|
inline |
Return the value at position (i, j).
◆ print()
| void algebra::SparseMatrix::print |
( |
std::ostream & |
flux = std::cout | ) |
const |
|
inline |
Print to the provided stream.
◆ set()
| void algebra::SparseMatrix::set |
( |
const int |
i, |
|
|
const int |
j, |
|
|
const double |
val |
|
) |
| |
|
inline |
Set the value at position (i, j), which must belong to the shape.
◆ rows
Container for the matrix rows. Since SparseVector is not movable, this container cannot be resized.
The documentation for this class was generated from the following file: