Thea
Public Types | Public Member Functions | List of all members
IRowOrColumnMajorMatrix< T > Class Template Referenceabstract

Interface for a matrix that has either a row-major or a column-major layout. More...

#include <IRowOrColumnMajorMatrix.hpp>

Inheritance diagram for IRowOrColumnMajorMatrix< T >:
IMatrix< T > ICompressedSparseMatrix< Sparse::value_type > ICompressedSparseMatrix< T > IDenseMatrix< T > SparseMatrixWrapper< Sparse > VariantMatrix< T, DenseMatrixT, SparseMatrixT > VariantMatrix< T, DenseMatrixT, SparseMatrixT >

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 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 isColumnMajor () const =0
 Is the matrix stored in column-major format? More...
 
virtual int8 isResizable () const =0
 Check if the matrix can be freely resized. More...
 
virtual int8 isRowMajor () const =0
 Is the matrix stored in row-major format? 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...
 

Detailed Description

template<typename T>
class Thea::IRowOrColumnMajorMatrix< T >

Interface for a matrix that has either a row-major or a column-major layout.

Definition at line 24 of file IRowOrColumnMajorMatrix.hpp.

Member Typedef Documentation

typedef T Value
inherited

Type of values stored in the matrix.

Definition at line 33 of file IMatrix.hpp.

typedef T value_type
inherited

Type of values stored in the matrix (STL convention).

Definition at line 34 of file IMatrix.hpp.

Member Function Documentation

virtual IAddressableMatrix<T> const* asAddressable ( ) const
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.

Note
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 >.

virtual IAddressableMatrix<T>* asAddressable ( )
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.

Note
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 >.

virtual ISparseMatrix<T> const* asSparse ( ) const
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.

Note
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 >.

virtual ISparseMatrix<T>* asSparse ( )
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.

Note
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 >.

virtual int64 cols ( ) const
pure virtualinherited
virtual int8 isColumnMajor ( ) const
pure virtual
virtual int8 isResizable ( ) const
pure virtualinherited
virtual int8 isRowMajor ( ) const
pure virtual
virtual int8 resize ( int64  nrows,
int64  ncols 
)
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.

Returns
True if the final dimensions of the matrix are identical to the desired dimensions, else false.

Implemented in VariantMatrix< T, DenseMatrixT, SparseMatrixT >, MappedMatrix< T, IndexT >, MatrixWrapper< MatrixT >, MatrixWrapper< VertexMatrix >, MatrixWrapper< Dense >, MatrixWrapper< TriangleMatrix >, SparseMatrixWrapper< MatrixT >, SparseMatrixWrapper< Sparse >, and ImageMatrix< T >.

virtual int64 rows ( ) const
pure virtualinherited
virtual void setZero ( )
pure virtualinherited

The documentation for this class was generated from the following file: