NeoN
WIP Prototype of a modern OpenFOAM core
|
Sparse matrix class with compact storage by row (CSR) format. More...
#include <CSRMatrix.hpp>
Public Member Functions | |
CSRMatrix (const Vector< ValueType > &values, const Vector< IndexType > &colIdxs, const Vector< IndexType > &rowOffs) | |
Constructor for CSRMatrix. | |
CSRMatrix (const Executor exec) | |
~CSRMatrix ()=default | |
Default destructor. | |
const Executor & | exec () const |
Get the executor associated with this matrix. | |
IndexType | nRows () const |
Get the number of rows in the matrix. | |
IndexType | nNonZeros () const |
Get the number of non-zero values in the matrix. | |
Vector< ValueType > & | values () |
Get a span to the values array. | |
Vector< IndexType > & | colIdxs () |
Get a span to the column indices array. | |
Vector< IndexType > & | rowPtrs () |
Get a span to the row pointers array. | |
const Vector< ValueType > & | values () const |
Get a const span to the values array. | |
const Vector< IndexType > & | colIdxs () const |
Get a const span to the column indices array. | |
const Vector< IndexType > & | rowPtrs () const |
Get a const span to the row pointers array. | |
CSRMatrix< ValueType, IndexType > | copyToExecutor (Executor dstExec) const |
Copy the matrix to another executor. | |
CSRMatrix< ValueType, IndexType > | copyToHost () const |
Copy the matrix to the host. | |
CSRMatrixView< ValueType, IndexType > | view () |
Get a view representation of the matrix's data. | |
const CSRMatrixView< const ValueType, const IndexType > | view () const |
Get a const view representation of the matrix's data. | |
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 83 of file CSRMatrix.hpp.
|
inline |
Constructor for CSRMatrix.
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 94 of file CSRMatrix.hpp.
|
inline |
Definition at line 105 of file CSRMatrix.hpp.
|
default |
Default destructor.
|
inline |
Get a span to the column indices array.
Definition at line 144 of file CSRMatrix.hpp.
|
inline |
Get a const span to the column indices array.
Definition at line 162 of file CSRMatrix.hpp.
|
inline |
Copy the matrix to another executor.
dstExec | The destination executor. |
Definition at line 175 of file CSRMatrix.hpp.
|
inline |
Copy the matrix to the host.
Definition at line 191 of file CSRMatrix.hpp.
|
inline |
Get the executor associated with this matrix.
Definition at line 116 of file CSRMatrix.hpp.
|
inline |
Get the number of non-zero values in the matrix.
Definition at line 132 of file CSRMatrix.hpp.
|
inline |
Get the number of rows in the matrix.
Definition at line 122 of file CSRMatrix.hpp.
|
inline |
Get a span to the row pointers array.
Definition at line 150 of file CSRMatrix.hpp.
|
inline |
Get a const span to the row pointers array.
Definition at line 168 of file CSRMatrix.hpp.
|
inline |
Get a span to the values array.
Definition at line 138 of file CSRMatrix.hpp.
|
inline |
Get a const span to the values array.
Definition at line 156 of file CSRMatrix.hpp.
|
inline |
Get a view representation of the matrix's data.
Definition at line 200 of file CSRMatrix.hpp.
|
inline |
Get a const view representation of the matrix's data.
Definition at line 209 of file CSRMatrix.hpp.