|
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 71 of file matrix.hpp.
| using NeoN::la::Matrix< ValueType, SparsityType >::MatrixSparsityType = SparsityType |
Definition at line 87 of file matrix.hpp.
| using NeoN::la::Matrix< ValueType, SparsityType >::MatrixValueType = ValueType |
Definition at line 86 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 94 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 106 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 130 of file matrix.hpp.
|
default |
Default destructor.
|
inlinenodiscard |
Get a reference to column indices vector.
Definition at line 177 of file matrix.hpp.
|
nodiscardoverridevirtual |
Copy the matrix to another executor.
| dstExec | The destination executor. |
Implements NeoN::SupportsCopyTo< Matrix< ValueType, SparsityType > >.
|
nodiscard |
extract the diagonal of the matrix
|
inlinenodiscard |
Get the executor associated with this matrix.
Definition at line 150 of file matrix.hpp.
|
inlinenodiscard |
Get the FaceToMatrixAddress associated with this matrix (may be null).
Definition at line 213 of file matrix.hpp.
|
inlinenodiscard |
Get the number of non-zero values in the matrix.
Definition at line 162 of file matrix.hpp.
|
inlinenodiscard |
Get the number of rows in the matrix.
Definition at line 156 of file matrix.hpp.
|
inline |
Definition at line 164 of file matrix.hpp.
|
inlinenodiscard |
Get a reference to row offset vector.
Definition at line 186 of file matrix.hpp.
|
inlinenodiscard |
Get a reference to column indices vector.
Definition at line 208 of file matrix.hpp.
|
inlinenodiscard |
Get a reference to values vector.
Definition at line 171 of file matrix.hpp.
|
inlinenodiscard |
Get a const reference to values vector.
Definition at line 195 of file matrix.hpp.
|
inlinenodiscard |
Get a view representation of the matrix's data.
Definition at line 223 of file matrix.hpp.
|
inlinenodiscard |
Get a const view representation of the matrix's data.
Definition at line 237 of file matrix.hpp.