![]() |
MoCSI API Reference
|
Template generalized Matrix object that should be the base for all further implementations of a matrix class. Only provides the most basic functionality and contains mainly pure virtual functions. More...
#include <GenericMatrix.h>


Public Member Functions | |
| GenericMatrix () | |
| Constructor for an empty GenericMatrix object. This should only be used for dynamically created matrices. | |
| GenericMatrix (int rows, int cols) | |
| Constructor for an empty GenericMatrix object whose value array holds rows*cols values. | |
| GenericMatrix (int rows, int cols, const std::valarray< T > &values, bool allow_mismatched_size) | |
| Constructor for a GenericMatrix object whose value array holds rows*cols values given by the user. Can throw an std::ivalid_argument if provided with a value array of different size than rows*cols. | |
| GenericMatrix (const GenericMatrix &)=default | |
| GenericMatrix & | operator= (const GenericMatrix &)=default |
| GenericMatrix (GenericMatrix &&)=default | |
| GenericMatrix & | operator= (GenericMatrix &&)=default |
| std::pair< int, int > | size () const |
| Function that returns the size of the matrix as a pair in (rows, columns) format. | |
| virtual T & | operator() (int rows, int cols)=0 |
| virtual T | operator() (int rows, int cols) const =0 |
| virtual std::valarray< T > | scalarAdd (T value) const =0 |
| virtual std::valarray< T > | scalarSubtract (T value) const =0 |
| virtual std::valarray< T > | scalarMultiply (T value) const =0 |
| virtual std::valarray< T > | scalarDivide (T value) const =0 |
| virtual std::valarray< T > | vectorElemAdd (const std::valarray< T > &value) const =0 |
| virtual std::valarray< T > | vectorElemSubtract (const std::valarray< T > &value) const =0 |
| virtual std::valarray< T > | vectorElemMultiply (const std::valarray< T > &value) const =0 |
| virtual std::valarray< T > | vectorElemDivide (const std::valarray< T > &value) const =0 |
| virtual std::valarray< T > | matrixVectorMultiplication (const std::valarray< T > &value) const =0 |
| virtual void | buildAtRuntime (int rows, int cols)=0 |
| virtual void | registerElement (T value, int rows, int cols) |
| virtual void | updateNonZeroElements ()=0 |
| virtual const std::vector< std::pair< int, int > > & | getNonZeroElements ()=0 |
| virtual const MatrixType | getMatrixType ()=0 |
| void | zeroMatrix () |
| Function that zeros out the matrix. | |
| void | overwriteMatrixValues (const std::valarray< T > &value) |
| Overwrites the matrix values with a new valarray. This is used for optimized overwrite when arithmetic operations on multiple matrices are used. | |
| virtual | ~GenericMatrix ()=default |
Protected Attributes | |
| int | m_rows {0} |
| int | m_cols {0} |
| std::valarray< T > | m_matrix {} |
| std::vector< std::pair< int, int > > | m_non_zero_elements |
Template generalized Matrix object that should be the base for all further implementations of a matrix class. Only provides the most basic functionality and contains mainly pure virtual functions.
| GenericMatrix< T >::GenericMatrix | ( | ) |
Constructor for an empty GenericMatrix object. This should only be used for dynamically created matrices.
| GenericMatrix< T >::GenericMatrix | ( | int | rows, |
| int | cols | ||
| ) |
Constructor for an empty GenericMatrix object whose value array holds rows*cols values.
| rows | The number of rows. |
| cols | The number of columns. |
| GenericMatrix< T >::GenericMatrix | ( | int | rows, |
| int | cols, | ||
| const std::valarray< T > & | values, | ||
| bool | allow_mismatched_size | ||
| ) |
Constructor for a GenericMatrix object whose value array holds rows*cols values given by the user. Can throw an std::ivalid_argument if provided with a value array of different size than rows*cols.
| rows | The number of rows. |
| cols | The number of columns. |
| values | The values to be stored in the m_matrix valarray. |
|
default |
|
default |
|
virtualdefault |
Implemented in CsrSparseMatrix< T >, and DenseMatrix< T >.
|
pure virtual |
Implemented in CsrSparseMatrix< T >, and DenseMatrix< T >.
|
pure virtual |
Implemented in CsrSparseMatrix< T >, and DenseMatrix< T >.
|
pure virtual |
Implemented in CsrSparseMatrix< T >, and DenseMatrix< T >.
|
pure virtual |
Implemented in CsrSparseMatrix< T >, and DenseMatrix< T >.
|
pure virtual |
Implemented in CsrSparseMatrix< T >, and DenseMatrix< T >.
|
default |
|
default |
| void GenericMatrix< T >::overwriteMatrixValues | ( | const std::valarray< T > & | value | ) |
Overwrites the matrix values with a new valarray. This is used for optimized overwrite when arithmetic operations on multiple matrices are used.
| T | Numeric type used in the simulation (e.g., float, double). |
| value | The new matrix values which will overwrite the previous ones. |
Reimplemented in CsrSparseMatrix< T >.
|
pure virtual |
Implemented in CsrSparseMatrix< T >, and DenseMatrix< T >.
|
pure virtual |
Implemented in CsrSparseMatrix< T >, and DenseMatrix< T >.
|
pure virtual |
Implemented in CsrSparseMatrix< T >, and DenseMatrix< T >.
|
pure virtual |
Implemented in CsrSparseMatrix< T >, and DenseMatrix< T >.
Function that returns the size of the matrix as a pair in (rows, columns) format.
Implemented in CsrSparseMatrix< T >, and DenseMatrix< T >.
|
pure virtual |
Implemented in CsrSparseMatrix< T >, and DenseMatrix< T >.
|
pure virtual |
Implemented in CsrSparseMatrix< T >, and DenseMatrix< T >.
|
pure virtual |
Implemented in CsrSparseMatrix< T >, and DenseMatrix< T >.
|
pure virtual |
Implemented in CsrSparseMatrix< T >, and DenseMatrix< T >.
| void GenericMatrix< T >::zeroMatrix | ( | ) |
Function that zeros out the matrix.
|
protected |
|
protected |
|
protected |
|
protected |