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 171 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 175 of file EigenMatrix.h.

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

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


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