SMILE
v2.5
Schwarzschild Modelling Interactive expLoratory Environment
|
matrix interface class that provides a diagonal matrix More...
#include <common.h>
Public Member Functions | |
CMatrixDiagonal (size_t s1) | |
virtual bool | isDense () const |
whether the matrix is dense or sparse (may be used to optimize calculations) | |
virtual size_t | size1 () const |
return size for first index | |
virtual size_t | size2 () const |
same for second | |
virtual size_t | numElems () const |
number of possibly nonzero elements in sparse matrix More... | |
virtual NumT | at (size_t i1, size_t i2) const |
return a value from the diagonal or zero if not on the diagonal | |
virtual NumT | getElem (size_t index, size_t *i1, size_t *i2) const |
retrieves all values in the matrix (these are only the diagonal ones) | |
void | set (size_t i1, NumT value) |
Private Attributes | |
std::vector< NumT > | diagonal |
diagonal matrix elements | |
matrix interface class that provides a diagonal matrix
|
inlinevirtual |
number of possibly nonzero elements in sparse matrix
by default all size1*size2 elements count, even if some of them are zero
Reimplemented from smile::CMatrix< NumT >.