![]() |
MoCSI API Reference
|
Concrete implemenatation of a matrix class representing a dense matrix. Offers basic access and element wise arithmetic functionality and mathematical matrix product. More...
#include <DenseMatrix.h>


Public Member Functions | |
| DenseMatrix () | |
| Constructor used for buildAtRuntime. | |
| DenseMatrix (int rows, int cols) | |
| Constructor for an empty DenseMatrix object whose value array holds rows*cols values. | |
| DenseMatrix (int rows, int cols, const std::valarray< T > &values) | |
| Constructor for a DenseMatrix class 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. | |
| T & | operator() (int rows, int cols) override |
| Parentheses operator to allow access to the matrix values as Matrix(row,column). | |
| T | operator() (int rows, int cols) const override |
| Parentheses operator to allow access to the matrix values as Matrix(row,column) in a constant context. | |
| DenseMatrix (const DenseMatrix &)=default | |
| DenseMatrix & | operator= (const DenseMatrix &)=default |
| DenseMatrix (DenseMatrix &&)=default | |
| DenseMatrix & | operator= (DenseMatrix &&)=default |
| std::valarray< T > | scalarAdd (T value) const override |
| Addition of a scalar to the matrix values element-wise. | |
| std::valarray< T > | matrixAddElementWise (const DenseMatrix &dense_matrix) const |
| Addition of two DenseMatrix objects element-wise. | |
| std::valarray< T > | scalarSubtract (T value) const override |
| Subtraction of a scalar from the matrix values element-wise. | |
| std::valarray< T > | matrixSubtractElementWise (const DenseMatrix &dense_matrix) const |
| Subtraction of two DenseMatrix objects element-wise. | |
| std::valarray< T > | scalarMultiply (T value) const override |
| Multiplication of a scalar to the matrix values element-wise. | |
| std::valarray< T > | matrixMultiplyElementWise (const DenseMatrix &dense_matrix) const |
| Multiplication of two DenseMatrix objects element-wise. | |
| DenseMatrix< T > | matrixMultiply (const DenseMatrix &dense_matrix) const |
| Mathematical matrix multiplication of two DenseMatrix objects. | |
| std::valarray< T > | scalarDivide (T value) const override |
| Division of a scalar from the matrix values element-wise. | |
| std::valarray< T > | matrixDivideElementWise (const DenseMatrix &dense_matrix) const |
| Division of two DenseMatrix objects element-wise. | |
| std::valarray< T > | vectorElemAdd (const std::valarray< T > &value) const override |
| Addition of a vector to the matrix values element-wise. | |
| std::valarray< T > | vectorElemSubtract (const std::valarray< T > &value) const override |
| Subtraction of a vector from the matrix values element-wise. | |
| std::valarray< T > | vectorElemMultiply (const std::valarray< T > &value) const override |
| Multiplication of a vector to the matrix values element-wise. | |
| std::valarray< T > | vectorElemDivide (const std::valarray< T > &value) const override |
| Division of a vector from the matrix values element-wise. | |
| std::valarray< T > | matrixVectorMultiplication (const std::valarray< T > &value) const override |
| Matrix-vector-multiplication for dense matrices. | |
| void | buildAtRuntime (int rows, int cols) override |
| Updates row, col values and array size if creation was deferred at invocation of constructor. | |
| void | updateNonZeroElements () override |
| Updates the vector containing the non-zero element row-col pairs. Used for optimization. | |
| const std::vector< std::pair< int, int > > & | getNonZeroElements () override |
| const MatrixType | getMatrixType () override |
| ~DenseMatrix () override=default | |
Public Member Functions inherited from GenericMatrix< T > | |
| 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 void | registerElement (T value, int rows, int cols) |
| 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 |
Additional Inherited Members | |
Protected Attributes inherited from GenericMatrix< T > | |
| int | m_rows {0} |
| int | m_cols {0} |
| std::valarray< T > | m_matrix {} |
| std::vector< std::pair< int, int > > | m_non_zero_elements |
Concrete implemenatation of a matrix class representing a dense matrix. Offers basic access and element wise arithmetic functionality and mathematical matrix product.
| DenseMatrix< T >::DenseMatrix | ( | ) |
Constructor used for buildAtRuntime.
| DenseMatrix< T >::DenseMatrix | ( | int | rows, |
| int | cols | ||
| ) |
Constructor for an empty DenseMatrix object whose value array holds rows*cols values.
| rows | The number of rows. |
| cols | The number of columns. |
| DenseMatrix< T >::DenseMatrix | ( | int | rows, |
| int | cols, | ||
| const std::valarray< T > & | values | ||
| ) |
Constructor for a DenseMatrix class 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 |
|
overridedefault |
Updates row, col values and array size if creation was deferred at invocation of constructor.
| T | Numeric type used in the simulation (e.g., float, double). |
| rows | The number of rows of the matrix. |
| cols | The number of columns of the matrix. |
Implements GenericMatrix< T >.
|
inlineoverridevirtual |
Implements GenericMatrix< T >.
|
inlineoverridevirtual |
Implements GenericMatrix< T >.
| std::valarray< T > DenseMatrix< T >::matrixAddElementWise | ( | const DenseMatrix< T > & | dense_matrix | ) | const |
Addition of two DenseMatrix objects element-wise.
| dense_matrix | The DenseMatrix object to be added to the calling object. |
| std::valarray< T > DenseMatrix< T >::matrixDivideElementWise | ( | const DenseMatrix< T > & | dense_matrix | ) | const |
Division of two DenseMatrix objects element-wise.
| dense_matrix | The DenseMatrix object to divide the calling object by. |
| DenseMatrix< T > DenseMatrix< T >::matrixMultiply | ( | const DenseMatrix< T > & | dense_matrix | ) | const |
Mathematical matrix multiplication of two DenseMatrix objects.
| dense_matrix | The DenseMatrix object to be multiplied from the right to the calling object. |
| std::valarray< T > DenseMatrix< T >::matrixMultiplyElementWise | ( | const DenseMatrix< T > & | dense_matrix | ) | const |
Multiplication of two DenseMatrix objects element-wise.
| dense_matrix | The DenseMatrix object to be multiplied to the calling object. |
| std::valarray< T > DenseMatrix< T >::matrixSubtractElementWise | ( | const DenseMatrix< T > & | dense_matrix | ) | const |
Subtraction of two DenseMatrix objects element-wise.
| dense_matrix | The DenseMatrix object to be subtracted from the calling object. |
|
overridevirtual |
Matrix-vector-multiplication for dense matrices.
| T | Numeric type used in the simulation (e.g., float, double) |
| value | The vector with the values to multiply to the matrix from the right. |
Implements GenericMatrix< T >.
|
overridevirtual |
Parentheses operator to allow access to the matrix values as Matrix(row,column) in a constant context.
| rows | the row to access. |
| column | the column to access. |
Implements GenericMatrix< T >.
|
overridevirtual |
Parentheses operator to allow access to the matrix values as Matrix(row,column).
| rows | the row to access. |
| column | the column to access. |
Implements GenericMatrix< T >.
|
default |
|
default |
|
overridevirtual |
Addition of a scalar to the matrix values element-wise.
| value | The scalar value to be added to the calling object. |
Implements GenericMatrix< T >.
|
overridevirtual |
Division of a scalar from the matrix values element-wise.
| value | The scalar value to divide to the calling object by. |
Implements GenericMatrix< T >.
|
overridevirtual |
Multiplication of a scalar to the matrix values element-wise.
| value | The scalar value to be multiplied to the calling object. |
Implements GenericMatrix< T >.
|
overridevirtual |
Subtraction of a scalar from the matrix values element-wise.
| value | The scalar value to be subtracted from the calling object. |
Implements GenericMatrix< T >.
|
overridevirtual |
Updates the vector containing the non-zero element row-col pairs. Used for optimization.
| T | Numeric type used in the simulation (e.g., float, double) |
Implements GenericMatrix< T >.
|
overridevirtual |
Addition of a vector to the matrix values element-wise.
| value | The vector values to be added to the calling object. |
Implements GenericMatrix< T >.
|
overridevirtual |
Division of a vector from the matrix values element-wise.
| value | The vector value to divide to the calling object by. |
Implements GenericMatrix< T >.
|
overridevirtual |
Multiplication of a vector to the matrix values element-wise.
| value | The vector value to be multiplied to the calling object. |
Implements GenericMatrix< T >.
|
overridevirtual |
Subtraction of a vector from the matrix values element-wise.
| value | The vector value to be subtracted from the calling object. |
Implements GenericMatrix< T >.