OGS
MathLib::SetMatrixSparsity< LisMatrix, SPARSITY_PATTERN > Struct Template Reference

Detailed Description

template<typename SPARSITY_PATTERN>
struct MathLib::SetMatrixSparsity< LisMatrix, SPARSITY_PATTERN >

Sets the sparsity pattern of the underlying LisMatrix.

Definition at line 176 of file LisMatrix.h.

#include <LisMatrix.h>

Public Member Functions

void operator() (LisMatrix &matrix, SPARSITY_PATTERN const &sparsity_pattern) const

Member Function Documentation

◆ operator()()

template<typename SPARSITY_PATTERN>
void MathLib::SetMatrixSparsity< LisMatrix, SPARSITY_PATTERN >::operator() ( LisMatrix & matrix,
SPARSITY_PATTERN const & sparsity_pattern ) const
inline

Definition at line 178 of file LisMatrix.h.

180 {
181 auto const n_rows = matrix.getNumberOfRows();
183 row_sizes.reserve(n_rows);
184
185 // LIS needs 1 more entry, otherwise it starts reallocating arrays.
187 back_inserter(row_sizes), [](auto const i) { return i + 1; });
188
189 int ierr = lis_matrix_malloc(matrix.AA_, 0, row_sizes.data());
191 }
bool checkLisError(int err)
Definition LisCheck.h:20

References MathLib::LisMatrix::AA_, MathLib::checkLisError(), and MathLib::LisMatrix::getNumberOfRows().


The documentation for this struct was generated from the following file: