SMILE
v2.5
Schwarzschild Modelling Interactive expLoratory Environment
|
interface for matrix storage. More...
#include <common.h>
Public Member Functions | |
virtual bool | isDense () const |
whether the matrix is dense or sparse (may be used to optimize calculations) | |
virtual size_t | size1 () const =0 |
return size for first index | |
virtual size_t | size2 () const =0 |
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 =0 |
return value at indices i1,i2. Note: there is no abstract function to set a value. | |
virtual NumT | getElem (size_t index, size_t *i1, size_t *i2) const |
get an element from the matrix, 0<=index<numElems() More... | |
interface for matrix storage.
used to pass around large quantities of data without making temporary copies of arrays; derived classes may provide virtual method which returns matrix elements, or simply keep the matrix "as is" in std::vector<std::vector<NumT> >
NumT | is a numerical type (double or float) |
|
inlinevirtual |
get an element from the matrix, 0<=index<numElems()
by default get an element from the dense matrix representation
Reimplemented in smile::CMatrixDiagonal< NumT >.
|
inlinevirtual |
number of possibly nonzero elements in sparse matrix
by default all size1*size2 elements count, even if some of them are zero
Reimplemented in smile::CMatrixDiagonal< NumT >.