![]() |
imate
C++/CUDA Reference
|
Container for dense matrices. More...
#include <c_dense_matrix.h>


Public Member Functions | |
| cDenseMatrix () | |
| Default constructor. | |
| cDenseMatrix (const DataType *A_, const LongIndexType num_rows_, const LongIndexType num_columns_, const FlagType A_is_row_major_, const FlagType A_is_symmetric_) | |
| Constructor. | |
| virtual | ~cDenseMatrix () |
| Destructor. | |
| virtual FlagType | is_identity_matrix () const |
| Checks whether the matrix is identity. | |
| virtual void | dot (const DataType *vector, DataType *product) |
| Matrix vector product. | |
| virtual void | dot_plus (const DataType *vector, const DataType alpha, DataType *product) |
| Matrix vector product written in place. | |
| virtual void | transpose_dot (const DataType *vector, DataType *product) |
| Transposed-matrix vector product. | |
| virtual void | transpose_dot_plus (const DataType *vector, const DataType alpha, DataType *product) |
| Transposed-matrix vector product written in place. | |
Public Member Functions inherited from cMatrix< DataType > | |
| cMatrix () | |
| Default constructor. | |
| cMatrix (const FlagType A_is_symmetric_) | |
| Constructor. | |
| virtual | ~cMatrix () |
| Destructor. | |
| DataType | get_eigenvalue (const DataType *known_parameters, const DataType known_eigenvalue, const DataType *inquiry_parameters) const |
| This virtual function is implemented from its pure virtual function of the base class. In this class, this functio has no use and was only implemented so that this class be able to be instantiated (due to the pure virtual function). | |
| virtual void | set_symmetry (const FlagType symmetric) |
| Specify whether the matrix is symmetic or non-symmetric. | |
Public Member Functions inherited from cLinearOperator< DataType > | |
| cLinearOperator () | |
| Default constructor. | |
| virtual | ~cLinearOperator () |
| Destructor. | |
| void | set_parameters (DataType *parameters_) |
Sets the scalar parameter this->parameters. Parameter is initialized to NULL. However, before calling dot or transpose_dot functions, the parameters must be set. | |
Public Member Functions inherited from cLinearOperatorBase | |
| cLinearOperatorBase () | |
| Default constructor. | |
| cLinearOperatorBase (const LongIndexType num_rows_, const LongIndexType num_columns_) | |
Constructor with setting num_rows and num_columns. | |
| virtual | ~cLinearOperatorBase () |
| Destructor. | |
| LongIndexType | get_num_rows () const |
| Returns the number of rows of the matrix. | |
| LongIndexType | get_num_columns () const |
| Returns the number of columns of the matrix. | |
| IndexType | get_num_parameters () const |
| Returns the number of parameters of the linear operator. | |
| FlagType | is_eigenvalue_relation_known () const |
| Returns a flag that determines whether a relation between the parameters of the operator and its eigenvalue(s) is known. | |
Protected Attributes | |
| const DataType * | A |
| const FlagType | A_is_row_major |
Protected Attributes inherited from cMatrix< DataType > | |
| FlagType | A_is_symmetric |
Protected Attributes inherited from cLinearOperator< DataType > | |
| DataType * | parameters |
Protected Attributes inherited from cLinearOperatorBase | |
| const LongIndexType | num_rows |
| const LongIndexType | num_columns |
| FlagType | eigenvalue_relation_known |
| IndexType | num_parameters |
Container for dense matrices.
The cDenseMatrix holds a two-dimensional dense matrix, and can perofrom matrix-vector product and transposed matrix-vector product.
Definition at line 43 of file c_dense_matrix.h.
| cDenseMatrix< DataType >::cDenseMatrix | ( | ) |
Default constructor.
Definition at line 34 of file c_dense_matrix.cpp.
| cDenseMatrix< DataType >::cDenseMatrix | ( | const DataType * | A_, |
| const LongIndexType | num_rows_, | ||
| const LongIndexType | num_columns_, | ||
| const FlagType | A_is_row_major_, | ||
| const FlagType | A_is_symmetric_ | ||
| ) |
Constructor.
| [in] | A_ | 1D array that represents a 2D dense array with either C (row) major ordering or Fortran (column) major ordering. The major ordering should de defined by A_is_row_major flag. |
| [in] | num_rows_ | Number of rows of A |
| [in] | num_columns_ | Number of columns of A |
| [in] | A_is_row_major_ | Boolean, can be 0 or 1 as follows:
|
| [in] | A_is_symmetric_ | Boolean. If A is symmetric, set this value to 1, otherwise 0. |
Definition at line 68 of file c_dense_matrix.cpp.
|
virtual |
|
virtual |
Matrix vector product.
Performs the matrix vector product \( \boldsymbol{y} = \mathbf{A} \boldsymbol{x} \).
| [in] | vector | A one-dimensional input vector \( \boldsymbol{x} \) with size the of the number of columns of the matrix \( \mathbf{A} \). |
| [out] | product | A one-dimensional output vector \( \boldsymbol{y} \) with the size of the number of rows of \( \mathbf{A} \). This vector will be overwritten. |
Implements cLinearOperator< DataType >.
Definition at line 252 of file c_dense_matrix.cpp.
References cMatrixOperations< DataType >::dense_matvec().

|
virtual |
Matrix vector product written in place.
Performs the matrix vector product \( \boldsymbol{y} = \boldsymbol{y} + \alpha \mathbf{A} \boldsymbol{x} \).
| [in] | vector | A one-dimensional input vector \( \boldsymbol{x} \) with size the of the number of columns of the matrix \( \mathbf{A} \). |
| [in] | alpha | A scalar. |
| [out] | product | A one-dimensional output vector \( \boldsymbol{y} \) with the size of the number of rows of \( \mathbf{A} \). |
Implements cMatrix< DataType >.
Definition at line 290 of file c_dense_matrix.cpp.
References cMatrixOperations< DataType >::dense_matvec_plus().

|
virtual |
Checks whether the matrix is identity.
The identity check is primarily performed in the cAffineMatrixFunction class.
1 if the input matrix is identity, and 0 otherwise.Implements cMatrix< DataType >.
Definition at line 113 of file c_dense_matrix.cpp.
References c_arithmetics::is_equal().

|
virtual |
Transposed-matrix vector product.
Performs the matrix vector product: \( \boldsymbol{y} = \mathbf{A}^{\intercal} \boldsymbol{x} \).
| [in] | vector | A one-dimensional input vector \( \boldsymbol{x} \) with size the of the number of columns of the matrix \( \mathbf{A} \). |
| [out] | product | A one-dimensional output vector \( \boldsymbol{y} \) with the size of the number of rows of \( \mathbf{A} \). This vector will be overwritten. |
Implements cLinearOperator< DataType >.
Definition at line 329 of file c_dense_matrix.cpp.
References cMatrixOperations< DataType >::dense_transposed_matvec().

|
virtual |
Transposed-matrix vector product written in place.
Performs the matrix vector product \( \boldsymbol{y} = \boldsymbol{y} + \alpha \mathbf{A}^{\intercal} \boldsymbol{x} \).
| [in] | vector | A one-dimensional input vector \( \boldsymbol{x} \) with size the of the number of columns of the matrix \( \mathbf{A} \). |
| [in] | alpha | A scalar. |
| [out] | product | A one-dimensional output vector \( \boldsymbol{y} \) with the size of the number of rows of \( \mathbf{A} \). |
Implements cMatrix< DataType >.
Definition at line 368 of file c_dense_matrix.cpp.
References cMatrixOperations< DataType >::dense_transposed_matvec_plus().

|
protected |
Definition at line 82 of file c_dense_matrix.h.
|
protected |
Definition at line 83 of file c_dense_matrix.h.