10#include <kernel/lafem/sparse_matrix_csr.hpp> 
   36    template<
typename DT_, 
typename IT_>
 
   61        XASSERTM(num_cols <= 
Index(
max_size), 
"User tried to generate a Matrix with more than 100000 colums!");
 
   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");
 
  126        IT_* row_ptr = matrix.
row_ptr();
 
  127        IT_* col_ind = matrix.
col_ind();
 
  128        DT_* val = matrix.
val();
 
  134        IT_ _row_cur = IT_(0);
 
  142          IT_ row = (it->first - col) / 
max_size;
 
  144          while (_row_cur <row )
 
  146            row_ptr[++_row_cur] = _nnz;
 
  148          val[_nnz] = it->second;
 
  155          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.
IT_ * col_ind()
Retrieve column indices array.
DT_ * val()
Retrieve non zero element array.
IT_ * row_ptr()
Retrieve row start index array.
Factory for SparseMatrix construction.
Index columns() const
Returns number of columns.
Index rows() const
Returns number of rows.
Index size() const
Returns product of number columns and number rows.
SparseMatrixCSR< DT_, IT_ > make_csr() const
Returns CSR matrix constructed from Map.
SparseMatrixFactory(Index num_rows, Index num_cols)
Constructor.
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 used_elements() const
Returns number of used elements.
Index _num_row
Number of rows for the created matrix.
std::uint64_t Index
Index data type.