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 189 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 193 of file EigenMatrix.h.

195  {
196  static_assert(EigenMatrix::RawMatrixType::IsRowMajor,
197  "Set matrix sparsity relies on the EigenMatrix to be in "
198  "row-major storage order.");
199 
200  assert(matrix.getNumberOfRows() ==
201  static_cast<EigenMatrix::IndexType>(sparsity_pattern.size()));
202 
203  matrix.getRawMatrix().reserve(sparsity_pattern);
204  }
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: