NDEVR
API Documentation
LinearSolverEigen< MatrixType >

linear solver which uses the sparse Cholesky solver from Eigen More...

Collaboration diagram for LinearSolverEigen< MatrixType >:
[legend]

Classes

class  CholeskyDecomposition
 Sub-classing Eigen's SimplicialLDLT to perform ordering with a given ordering. More...

Public Types

typedef Eigen::PermutationMatrix< Eigen::Dynamic, Eigen::Dynamic, int > PermutationMatrix
 Permutation matrix type.
typedef Eigen::SparseMatrix< g_type, Eigen::ColMajor > SparseMatrix
 Column-major Eigen sparse matrix type.
typedef Eigen::Triplet< g_type > Triplet
 Triplet type for sparse matrix construction.

Public Member Functions

 LinearSolverEigen ()
 Default constructor.
bool blockOrdering () const
 do the AMD ordering on the blocks or on the scalar matrix
virtual bool init ()
 Resets the solver for a new factorization.
bool solve (const SparseBlockMatrix< MatrixType > &A, g_type *x, g_type *b)
 Solves the linear system Ax = b using sparse Cholesky decomposition.

Public Attributes

SparseOptimizer optimizer
 The sparse optimizer instance.

Protected Member Functions

void computeSymbolicDecomposition (const SparseBlockMatrix< MatrixType > &A)
 compute the symbolic decompostion of the matrix only once.

Protected Attributes

bool _blockOrdering
 Whether to use block-level AMD ordering.
CholeskyDecomposition _cholesky
 The Cholesky decomposition.
bool _init
 Whether the symbolic decomposition needs to be (re)computed.
SparseMatrix _sparseMatrix
 The Eigen sparse matrix representation.

Detailed Description

template<typename MatrixType>
class LinearSolverEigen< MatrixType >

linear solver which uses the sparse Cholesky solver from Eigen

Has no dependencies except Eigen. Hence, should compile almost everywhere without to much issues. Performance should be similar to CSparse, I guess.

Definition at line 46 of file linear_solver_eigen.h.

Member Function Documentation

◆ computeSymbolicDecomposition()

template<typename MatrixType>
void LinearSolverEigen< MatrixType >::computeSymbolicDecomposition ( const SparseBlockMatrix< MatrixType > & A)
inlineprotected

compute the symbolic decompostion of the matrix only once.

Since A has the same pattern in all the iterations, we only compute the fill-in reducing ordering once and re-use for all the following iterations.

Definition at line 141 of file linear_solver_eigen.h.

References _blockOrdering, _cholesky, and _sparseMatrix.

Referenced by solve().

◆ init()

template<typename MatrixType>
virtual bool LinearSolverEigen< MatrixType >::init ( )
inlinevirtual

Resets the solver for a new factorization.

Returns
True always.

Definition at line 91 of file linear_solver_eigen.h.

References _init.

◆ solve()

template<typename MatrixType>
bool LinearSolverEigen< MatrixType >::solve ( const SparseBlockMatrix< MatrixType > & A,
g_type * x,
g_type * b )
inline

Solves the linear system Ax = b using sparse Cholesky decomposition.

Parameters
[in]AThe sparse block matrix (symmetric, positive definite).
[out]xThe solution vector.
[in]bThe right-hand side vector.
Returns
True on success, false if the matrix is not positive definite.

Definition at line 102 of file linear_solver_eigen.h.

References _cholesky, _init, _sparseMatrix, and computeSymbolicDecomposition().


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