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


Public Member Functions | |
| cCSRMatrix () | |
| Default constructor. | |
| cCSRMatrix (const DataType *A_data_, const LongIndexType *A_indices_, const LongIndexType *A_index_pointer_, const LongIndexType num_rows_, const LongIndexType num_columns_, const FlagType A_is_symmetric) | |
| Constructor. | |
| virtual | ~cCSRMatrix () |
| Destructor. | |
| virtual FlagType | is_identity_matrix () const |
| Checks whether the matrix is identity. | |
| LongIndexType | get_nnz () const |
| Returns the number of non-zero elements of the sparse matrix. | |
| 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_data |
| const LongIndexType * | A_indices |
| const LongIndexType * | A_index_pointer |
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 CSR matrices.
The cCSRMatrix holds a two-dimensional compressed sparse row matrix, and can perofrom matrix-vector product and transposed matrix-vector product.
Definition at line 43 of file c_csr_matrix.h.
| cCSRMatrix< DataType >::cCSRMatrix | ( | ) |
Default constructor.
Definition at line 34 of file c_csr_matrix.cpp.
| cCSRMatrix< DataType >::cCSRMatrix | ( | const DataType * | A_data_, |
| const LongIndexType * | A_indices_, | ||
| const LongIndexType * | A_index_pointer_, | ||
| const LongIndexType | num_rows_, | ||
| const LongIndexType | num_columns_, | ||
| const FlagType | A_is_symmetric_ | ||
| ) |
Constructor.
| [in] | A_data_ | 1D array of the data content of sparse matrix. The size of the array is the nnz of the matrix. |
| [in] | A_indices_ | 1D array indicating the column of each element in A_data_ . The size of this array is the nnz of the matrix. |
| [in] | A_index_pointer_ | 1D array pointing to the start of new rows in A_indices_ . The size of this array is num_rows+1 . The first element of this array is 0 and the last element of this array is the nnz of the matrix. |
| [in] | num_rows_ | Number of rows of A |
| [in] | num_columns_ | Number of columns of A |
| [in] | A_is_symmetric_ | Boolean. If A is symmetric, set this value to 1, otherwise 0. |
Definition at line 68 of file c_csr_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 211 of file c_csr_matrix.cpp.
References cMatrixOperations< DataType >::csr_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 248 of file c_csr_matrix.cpp.
References cMatrixOperations< DataType >::csr_matvec_plus().

| LongIndexType cCSRMatrix< DataType >::get_nnz | ( | ) | const |
Returns the number of non-zero elements of the sparse matrix.
The nnz of a CSR matrix can be obtained from the last element of A_index_pointer. The size of array A_index_pointer is one plus the number of rows of the matrix.
Definition at line 183 of file c_csr_matrix.cpp.
|
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 115 of file c_csr_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 286 of file c_csr_matrix.cpp.
References cMatrixOperations< DataType >::csr_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 326 of file c_csr_matrix.cpp.
References cMatrixOperations< DataType >::csr_transposed_matvec_plus().

|
protected |
Definition at line 85 of file c_csr_matrix.h.
|
protected |
Definition at line 87 of file c_csr_matrix.h.
|
protected |
Definition at line 86 of file c_csr_matrix.h.