10#include <kernel/lafem/sparse_matrix_csr.hpp>
36 template<
typename DT_,
typename IT_>
73 ASSERTM(i <
_num_row,
"User tried to add input out of bounds of the matrix" );
74 ASSERTM(j <
_num_col,
"User tried to add input out of bounds of the matrix");
125 IT_ _row_cur = IT_(0);
133 IT_ row = (it->first - col) /
max_size;
135 while (_row_cur <row )
137 row_ptr[++_row_cur] = _nnz;
139 val[_nnz] = it->second;
146 row_ptr[++_row_cur] = _nnz;
#define ASSERTM(expr, msg)
Debug-Assertion macro definition with custom message.
#define XASSERTM(expr, msg)
Assertion macro definition with custom message.
Factory for SparseMatrix construction.
Index num_cols() const
Returns number of columns.
Index num_nzes() const
Returns number of non-zero entries.
SparseMatrixCSR< DT_, IT_ > make_csr() const
Returns CSR matrix constructed from Map.
SparseMatrixFactory(Index num_rows, Index num_cols)
Constructor.
Index num_rows() const
Returns number of rows.
Index _num_col
Number of columns for the created matrix.
std::map< IT_, DT_ > memory
Map collecting the input for the matrix.
static constexpr IT_ max_size
Maximal size of matrix.
void add(Index i, Index j, DT_ a_ij)
Adds a new matrix entry to the factory.
Index _num_row
Number of rows for the created matrix.
std::uint64_t Index
Index data type.