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

Detailed Description

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

Sets the sparsity pattern of the underlying EigenMatrix.

Definition at line 172 of file EigenMatrix.h.

#include <EigenMatrix.h>

Public Member Functions

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

Member Function Documentation

◆ operator()()

template<typename SPARSITY_PATTERN >
void MathLib::SetMatrixSparsity< EigenMatrix, SPARSITY_PATTERN >::operator() ( EigenMatrix & matrix,
SPARSITY_PATTERN const & sparsity_pattern ) const
inline
Note
This operator relies on row-major storage order of the underlying eigen matrix i.e. of the RawMatrixType.

Definition at line 176 of file EigenMatrix.h.

178 {
179 static_assert(EigenMatrix::RawMatrixType::IsRowMajor,
180 "Set matrix sparsity relies on the EigenMatrix to be in "
181 "row-major storage order.");
182
183 assert(matrix.getNumberOfRows() ==
184 static_cast<EigenMatrix::IndexType>(sparsity_pattern.size()));
185
186 matrix.getRawMatrix().reserve(sparsity_pattern);
187 }
RawMatrixType::Index IndexType
Definition EigenMatrix.h:32

References MathLib::EigenMatrix::getNumberOfRows(), and MathLib::EigenMatrix::getRawMatrix().


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