Thea
|
Interface for a 2D sparse matrix. More...
#include <ISparseMatrix.hpp>
Public Types | |
typedef T | Value |
Type of values stored in the matrix. More... | |
typedef T | value_type |
Type of values stored in the matrix (STL convention). More... | |
Public Member Functions | |
virtual IAddressableMatrix< T > const * | asAddressable () const =0 |
If the matrix elements are addressable by (row, col) pairs, get a pointer to a derived interface supporting such access. More... | |
virtual IAddressableMatrix< T > * | asAddressable ()=0 |
If the matrix elements are addressable by (row, col) pairs, get a pointer to a derived interface supporting such access. More... | |
virtual ICompressedSparseMatrix< T > const * | asCompressed () const =0 |
If the matrix is stored in compressed column or row format, get a pointer to a derived interface supporting access specific to that format. More... | |
virtual ICompressedSparseMatrix< T > * | asCompressed ()=0 |
If the matrix is stored in compressed column or row format, get a pointer to a derived interface supporting access specific to that format. More... | |
virtual ISparseMatrix< T > const * | asSparse () const =0 |
If the matrix elements are addressable by (row, col) pairs, get a pointer to a derived interface supporting such access. More... | |
virtual ISparseMatrix< T > * | asSparse ()=0 |
If the matrix is sparse, get a pointer to a derived interface giving sparse-specific access. More... | |
virtual int64 | cols () const =0 |
Get the number of columns. More... | |
virtual int8 | isResizable () const =0 |
Check if the matrix can be freely resized. More... | |
virtual int64 | numStoredElements () const =0 |
Get the number of entries actually stored in the matrix. More... | |
virtual int8 | resize (int64 nrows, int64 ncols)=0 |
Resize the matrix to new dimensions, if isResizable() returns true. More... | |
virtual int64 | rows () const =0 |
Get the number of rows. More... | |
virtual void | setZero ()=0 |
Set all elements to zero. More... | |
Interface for a 2D sparse matrix.
Useful for passing matrices across shared library boundaries.
Definition at line 24 of file IMatrix.hpp.
|
inherited |
Type of values stored in the matrix.
Definition at line 33 of file IMatrix.hpp.
|
inherited |
Type of values stored in the matrix (STL convention).
Definition at line 34 of file IMatrix.hpp.
|
pure virtualinherited |
If the matrix elements are addressable by (row, col) pairs, get a pointer to a derived interface supporting such access.
Else, return null.
dynamic_cast
does not work reliably across shared library boundaries, and relying on users to avoid it and only use static_cast
is dangerous. Implemented in MappedMatrix< T, IndexT >, VariantMatrix< T, DenseMatrixT, SparseMatrixT >, MatrixWrapper< MatrixT >, MatrixWrapper< VertexMatrix >, MatrixWrapper< Dense >, MatrixWrapper< TriangleMatrix >, SparseMatrixWrapper< MatrixT >, SparseMatrixWrapper< Sparse >, and ImageMatrix< T >.
|
pure virtualinherited |
If the matrix elements are addressable by (row, col) pairs, get a pointer to a derived interface supporting such access.
Else, return null.
dynamic_cast
does not work reliably across shared library boundaries, and relying on users to avoid it and only use static_cast
is dangerous. Implemented in MappedMatrix< T, IndexT >, VariantMatrix< T, DenseMatrixT, SparseMatrixT >, MatrixWrapper< MatrixT >, MatrixWrapper< VertexMatrix >, MatrixWrapper< Dense >, MatrixWrapper< TriangleMatrix >, SparseMatrixWrapper< MatrixT >, SparseMatrixWrapper< Sparse >, and ImageMatrix< T >.
|
pure virtual |
If the matrix is stored in compressed column or row format, get a pointer to a derived interface supporting access specific to that format.
Else, return null.
dynamic_cast
does not work reliably across shared library boundaries, and relying on users to avoid it and only use static_cast
is dangerous. Implemented in MappedMatrix< T, IndexT >, VariantMatrix< T, DenseMatrixT, SparseMatrixT >, SparseMatrixWrapper< MatrixT >, and SparseMatrixWrapper< Sparse >.
|
pure virtual |
If the matrix is stored in compressed column or row format, get a pointer to a derived interface supporting access specific to that format.
Else, return null.
dynamic_cast
does not work reliably across shared library boundaries, and relying on users to avoid it and only use static_cast
is dangerous. Implemented in MappedMatrix< T, IndexT >, VariantMatrix< T, DenseMatrixT, SparseMatrixT >, SparseMatrixWrapper< MatrixT >, and SparseMatrixWrapper< Sparse >.
|
pure virtualinherited |
If the matrix elements are addressable by (row, col) pairs, get a pointer to a derived interface supporting such access.
Else, return null.
dynamic_cast
does not work reliably across shared library boundaries, and relying on users to avoid it and only use static_cast
is dangerous. Implemented in MappedMatrix< T, IndexT >, VariantMatrix< T, DenseMatrixT, SparseMatrixT >, MatrixWrapper< MatrixT >, MatrixWrapper< VertexMatrix >, MatrixWrapper< Dense >, MatrixWrapper< TriangleMatrix >, SparseMatrixWrapper< MatrixT >, SparseMatrixWrapper< Sparse >, and ImageMatrix< T >.
|
pure virtualinherited |
If the matrix is sparse, get a pointer to a derived interface giving sparse-specific access.
Else, return null. Note that a sparse matrix can still be addressable, e.g. if it is stored as a map of (row, col) –> value
pairs.
dynamic_cast
does not work reliably across shared library boundaries, and relying on users to avoid it and only use static_cast
is dangerous. Implemented in MappedMatrix< T, IndexT >, VariantMatrix< T, DenseMatrixT, SparseMatrixT >, MatrixWrapper< MatrixT >, MatrixWrapper< VertexMatrix >, MatrixWrapper< Dense >, MatrixWrapper< TriangleMatrix >, SparseMatrixWrapper< MatrixT >, SparseMatrixWrapper< Sparse >, and ImageMatrix< T >.
|
pure virtualinherited |
Get the number of columns.
Implemented in VariantMatrix< T, DenseMatrixT, SparseMatrixT >, MappedMatrix< T, IndexT >, MatrixWrapper< MatrixT >, SparseMatrixWrapper< MatrixT >, MatrixWrapper< VertexMatrix >, MatrixWrapper< Dense >, MatrixWrapper< TriangleMatrix >, SparseMatrixWrapper< Sparse >, and ImageMatrix< T >.
|
pure virtualinherited |
Check if the matrix can be freely resized.
Implemented in VariantMatrix< T, DenseMatrixT, SparseMatrixT >, MappedMatrix< T, IndexT >, MatrixWrapper< MatrixT >, MatrixWrapper< VertexMatrix >, MatrixWrapper< Dense >, MatrixWrapper< TriangleMatrix >, SparseMatrixWrapper< MatrixT >, SparseMatrixWrapper< Sparse >, and ImageMatrix< T >.
|
pure virtual |
Get the number of entries actually stored in the matrix.
These are often called "non-zeros", though they may actually have the numeric value 0.
Implemented in VariantMatrix< T, DenseMatrixT, SparseMatrixT >, MappedMatrix< T, IndexT >, SparseMatrixWrapper< MatrixT >, and SparseMatrixWrapper< Sparse >.
|
pure virtualinherited |
Resize the matrix to new dimensions, if isResizable() returns true.
Else, if the new dimensions are identical to the old dimensions, do nothing and return true, else return false. If the dimensions are changed, existing entries will in general not be preserved in the resized matrix.
Implemented in VariantMatrix< T, DenseMatrixT, SparseMatrixT >, MappedMatrix< T, IndexT >, MatrixWrapper< MatrixT >, MatrixWrapper< VertexMatrix >, MatrixWrapper< Dense >, MatrixWrapper< TriangleMatrix >, SparseMatrixWrapper< MatrixT >, SparseMatrixWrapper< Sparse >, and ImageMatrix< T >.
|
pure virtualinherited |
Get the number of rows.
Implemented in VariantMatrix< T, DenseMatrixT, SparseMatrixT >, MappedMatrix< T, IndexT >, MatrixWrapper< MatrixT >, SparseMatrixWrapper< MatrixT >, MatrixWrapper< VertexMatrix >, MatrixWrapper< Dense >, MatrixWrapper< TriangleMatrix >, SparseMatrixWrapper< Sparse >, and ImageMatrix< T >.
|
pure virtualinherited |
Set all elements to zero.
Implemented in VariantMatrix< T, DenseMatrixT, SparseMatrixT >, MappedMatrix< T, IndexT >, MatrixWrapper< MatrixT >, SparseMatrixWrapper< MatrixT >, MatrixWrapper< VertexMatrix >, MatrixWrapper< Dense >, MatrixWrapper< TriangleMatrix >, SparseMatrixWrapper< Sparse >, and ImageMatrix< T >.