|
NeoN
A framework for CFD software
|
Sparse matrix class with compact storage by row (CSR) format. More...
#include <matrix.hpp>
Public Types | |
| using | MatrixValueType = ValueType |
| using | MatrixSparsityType = SparsityType |
Public Member Functions | |
| Matrix (const Vector< ValueType > &values, std::shared_ptr< const SparsityType > sp) | |
| Constructor for Matrix. | |
| Matrix (const Vector< ValueType > &values, const Vector< typename SparsityType::SparsityIndexType > &colIdxs, const Vector< typename SparsityType::SparsityIndexType > &rowOffs, Dimensions dimensions) | |
| Constructor for Matrix. | |
| Matrix (const Vector< ValueType > &values, std::shared_ptr< const SparsityType > sparsity, std::shared_ptr< const FaceToMatrixAddress > faceToMatrixAddress) | |
| Constructor for Matrix with a FaceToMatrixAddress. | |
| ~Matrix ()=default | |
| Default destructor. | |
| const Executor & | exec () const |
| Get the executor associated with this matrix. | |
| localIdx | nRows () const |
| Get the number of rows in the matrix. | |
| localIdx | nNonZeros () const |
| Get the number of non-zero values in the matrix. | |
| void | reset () |
| Vector< ValueType > & | values () |
| Get a reference to values vector. | |
| const Vector< typename SparsityType::SparsityIndexType > & | colIdxs () const |
| Get a reference to column indices vector. | |
| const Vector< typename SparsityType::SparsityIndexType > & | rowOffs () const |
| Get a reference to row offset vector. | |
| const Vector< ValueType > & | values () const |
| Get a const reference to values vector. | |
| Matrix< ValueType, SparsityType > | copyToExecutor (Executor dstExec) const override |
| Copy the matrix to another executor. | |
| std::shared_ptr< const SparsityType > | sparsity () const |
| Get a reference to column indices vector. | |
| std::shared_ptr< const FaceToMatrixAddress > | faceToMatrixAddress () const |
| Get the FaceToMatrixAddress associated with this matrix (may be null). | |
| MatrixView< ValueType, SparsityView< typename SparsityType::SparsityIndexType > > | view () |
| Get a view representation of the matrix's data. | |
| MatrixView< const ValueType, SparsityView< typename SparsityType::SparsityIndexType > > | view () const |
| Get a const view representation of the matrix's data. | |
| Vector< ValueType > | diag () const |
| extract the diagonal of the matrix | |
Public Member Functions inherited from NeoN::SupportsCopyTo< Matrix< ValueType, SparsityType > > | |
| virtual | ~SupportsCopyTo ()=default |
| Matrix< ValueType, SparsityType > | copyToHost () const |
Sparse matrix class with compact storage by row (CSR) format.
| ValueType | The value type of the non-zero entries. |
| IndexType | The index type of the rows and columns. |
Definition at line 70 of file matrix.hpp.
| using NeoN::la::Matrix< ValueType, SparsityType >::MatrixSparsityType = SparsityType |
Definition at line 83 of file matrix.hpp.
| using NeoN::la::Matrix< ValueType, SparsityType >::MatrixValueType = ValueType |
Definition at line 82 of file matrix.hpp.
|
inline |
Constructor for Matrix.
| values | The non-zero values of the matrix. |
| sp | The sparsity pattern of the matrix |
Definition at line 90 of file matrix.hpp.
|
inline |
Constructor for Matrix.
| values | The non-zero values of the matrix. |
| colIdxs | The column indices for each non-zero value. |
| rowOffs | The starting index in values/colIdxs for each row. |
Definition at line 102 of file matrix.hpp.
|
inline |
Constructor for Matrix with a FaceToMatrixAddress.
The sparsity pattern and the face-to-matrix address are passed as independent objects. Only available for matrices whose index type is localIdx.
| values | The non-zero values of the matrix. |
| sparsity | The sparsity pattern of the matrix. |
| faceToMatrixAddress | The face-to-matrix address mapping. |
Definition at line 126 of file matrix.hpp.
|
default |
Default destructor.
|
inline |
Get a reference to column indices vector.
Definition at line 173 of file matrix.hpp.
|
overridevirtual |
Copy the matrix to another executor.
| dstExec | The destination executor. |
Implements NeoN::SupportsCopyTo< Matrix< ValueType, SparsityType > >.
| Vector< ValueType > NeoN::la::Matrix< ValueType, SparsityType >::diag | ( | ) | const |
extract the diagonal of the matrix
|
inline |
Get the executor associated with this matrix.
Definition at line 146 of file matrix.hpp.
|
inline |
Get the FaceToMatrixAddress associated with this matrix (may be null).
Definition at line 209 of file matrix.hpp.
|
inline |
Get the number of non-zero values in the matrix.
Definition at line 158 of file matrix.hpp.
|
inline |
Get the number of rows in the matrix.
Definition at line 152 of file matrix.hpp.
|
inline |
Definition at line 160 of file matrix.hpp.
|
inline |
Get a reference to row offset vector.
Definition at line 182 of file matrix.hpp.
|
inline |
Get a reference to column indices vector.
Definition at line 204 of file matrix.hpp.
|
inline |
Get a reference to values vector.
Definition at line 167 of file matrix.hpp.
|
inline |
Get a const reference to values vector.
Definition at line 191 of file matrix.hpp.
|
inline |
Get a view representation of the matrix's data.
Definition at line 219 of file matrix.hpp.
|
inline |
Get a const view representation of the matrix's data.
Definition at line 233 of file matrix.hpp.