![]() |
Ginkgo Generated from branch based on master. Ginkgo version 1.7.0
A numerical linear algebra library targeting many-core architectures
|
This structure is used as an intermediate type to assemble a sparse matrix. More...
#include <ginkgo/core/base/matrix_assembly_data.hpp>
Public Types | |
using | value_type = ValueType |
using | index_type = IndexType |
Public Member Functions | |
matrix_assembly_data (dim< 2 > size) | |
void | add_value (index_type row, index_type col, value_type val) |
Sets the matrix value at (row, col). | |
void | set_value (index_type row, index_type col, value_type val) |
Sets the matrix value at (row, col). | |
value_type | get_value (index_type row, index_type col) |
Gets the matrix value at (row, col). | |
bool | contains (index_type row, index_type col) |
Returns true iff the matrix contains an entry at (row, col). | |
dim< 2 > | get_size () const noexcept |
size_type | get_num_stored_elements () const noexcept |
matrix_data< ValueType, IndexType > | get_ordered_data () const |
This structure is used as an intermediate type to assemble a sparse matrix.
The matrix is stored as a set of nonzero elements, where each element is a triplet of the form (row_index, column_index, value).
New values can be added by using the matrix_assembly_data::add_value or matrix_assembly_data::set_value
ValueType | type of matrix values stored in the structure |
IndexType | type of matrix indexes stored in the structure |
|
inline |
Sets the matrix value at (row, col).
If there is an existing value, it will be set to the sum of the existing and new value, otherwise the value will be inserted.
row | the row where the value should be added |
col | the column where the value should be added |
val | the value to be added to (row, col) |
References gko::one().
|
inline |
Returns true iff the matrix contains an entry at (row, col).
row | the row index |
col | the column index |
|
inlinenoexcept |
|
inline |
References gko::one().
Referenced by gko::ReadableFromMatrixData< ValueType, IndexType >::read().
|
inlinenoexcept |
|
inline |
Gets the matrix value at (row, col).
row | the row index |
col | the column index |
References gko::one().
|
inline |
Sets the matrix value at (row, col).
If there is an existing value, it will be overwritten by the new value.
row | the row index |
col | the column index |
val | the value to be written to (row, col) |
References gko::one().