Eigen::CholmodDecomposition< MatrixType_, UpLo_ > Class Template Reference

A general Cholesky factorization and solver based on Cholmod. More...

#include <CholmodSupport.h>

+ Inheritance diagram for Eigen::CholmodDecomposition< MatrixType_, UpLo_ >:

Public Types

typedef MatrixType_ MatrixType
 
- Public Types inherited from Eigen::CholmodBase< MatrixType_, Lower, CholmodDecomposition< MatrixType_, Lower > >
enum  
 
enum  
 
typedef MatrixType_ MatrixType
 
typedef MatrixType::Scalar Scalar
 
typedef MatrixType::RealScalar RealScalar
 
typedef MatrixType CholMatrixType
 
typedef MatrixType::StorageIndex StorageIndex
 

Public Member Functions

 CholmodDecomposition ()
 
 CholmodDecomposition (const MatrixType &matrix)
 
 ~CholmodDecomposition ()
 
void setMode (CholmodMode mode)
 
- Public Member Functions inherited from Eigen::CholmodBase< MatrixType_, Lower, CholmodDecomposition< MatrixType_, Lower > >
 CholmodBase ()
 
 CholmodBase (const MatrixType &matrix)
 
 ~CholmodBase ()
 
StorageIndex cols () const
 
StorageIndex rows () const
 
ComputationInfo info () const
 Reports whether previous computation was successful. More...
 
CholmodDecomposition< MatrixType_, Lower > & compute (const MatrixType &matrix)
 
void analyzePattern (const MatrixType &matrix)
 
void factorize (const MatrixType &matrix)
 
cholmod_common & cholmod ()
 
void _solve_impl (const MatrixBase< Rhs > &b, MatrixBase< Dest > &dest) const
 
void _solve_impl (const SparseMatrixBase< RhsDerived > &b, SparseMatrixBase< DestDerived > &dest) const
 
CholmodDecomposition< MatrixType_, Lower > & setShift (const RealScalar &offset)
 
Scalar determinant () const
 
Scalar logDeterminant () const
 
void dumpMemory (Stream &)
 
- Public Member Functions inherited from Eigen::SparseSolverBase< Derived >
 SparseSolverBase ()
 
 SparseSolverBase (SparseSolverBase &&other)
 
 ~SparseSolverBase ()
 
Derived & derived ()
 
const Derived & derived () const
 
template<typename Rhs >
const Solve< Derived, Rhs > solve (const MatrixBase< Rhs > &b) const
 
template<typename Rhs >
const Solve< Derived, Rhs > solve (const SparseMatrixBase< Rhs > &b) const
 
template<typename Rhs , typename Dest >
void _solve_impl (const SparseMatrixBase< Rhs > &b, SparseMatrixBase< Dest > &dest) const
 

Protected Member Functions

void init ()
 
- Protected Member Functions inherited from Eigen::CholmodBase< MatrixType_, Lower, CholmodDecomposition< MatrixType_, Lower > >
CholmodDecomposition< MatrixType_, Lower > & derived ()
 
const CholmodDecomposition< MatrixType_, Lower > & derived () const
 

Private Types

typedef CholmodBase< MatrixType_, UpLo_, CholmodDecompositionBase
 

Private Attributes

cholmod_common m_cholmod
 

Additional Inherited Members

- Protected Types inherited from Eigen::CholmodBase< MatrixType_, Lower, CholmodDecomposition< MatrixType_, Lower > >
typedef SparseSolverBase< CholmodDecomposition< MatrixType_, Lower > > Base
 
- Protected Attributes inherited from Eigen::CholmodBase< MatrixType_, Lower, CholmodDecomposition< MatrixType_, Lower > >
cholmod_common m_cholmod
 
cholmod_factor * m_cholmodFactor
 
double m_shiftOffset [2]
 
ComputationInfo m_info
 
int m_factorizationIsOk
 
int m_analysisIsOk
 
bool m_isInitialized
 
- Protected Attributes inherited from Eigen::SparseSolverBase< Derived >
bool m_isInitialized
 

Detailed Description

template<typename MatrixType_, int UpLo_ = Lower>
class Eigen::CholmodDecomposition< MatrixType_, UpLo_ >

A general Cholesky factorization and solver based on Cholmod.

This class allows to solve for A.X = B sparse linear problems via a LL^T or LDL^T Cholesky factorization using the Cholmod library. The sparse matrix A must be selfadjoint and positive definite. The vectors or matrices X and B can be either dense or sparse.

This variant permits to change the underlying Cholesky method at runtime. On the other hand, it does not provide access to the result of the factorization. The default is to let Cholmod automatically choose between a simplicial and supernodal factorization.

Template Parameters
MatrixType_the type of the sparse matrix A, it must be a SparseMatrix<>
UpLo_the triangular part that will be used for the computations. It can be Lower or Upper. Default is Lower.

\implsparsesolverconcept

This class supports all kind of SparseMatrix<>: row or column major; upper, lower, or both; compressed or non compressed.

Warning
Only double precision real and complex scalar types are supported by Cholmod.
See also
Sparse solver concept

Member Typedef Documentation

◆ Base

template<typename MatrixType_ , int UpLo_ = Lower>
typedef CholmodBase<MatrixType_, UpLo_, CholmodDecomposition> Eigen::CholmodDecomposition< MatrixType_, UpLo_ >::Base
private

◆ MatrixType

template<typename MatrixType_ , int UpLo_ = Lower>
typedef MatrixType_ Eigen::CholmodDecomposition< MatrixType_, UpLo_ >::MatrixType

Constructor & Destructor Documentation

◆ CholmodDecomposition() [1/2]

template<typename MatrixType_ , int UpLo_ = Lower>
Eigen::CholmodDecomposition< MatrixType_, UpLo_ >::CholmodDecomposition ( )
inline
696 : Base() { init(); }
void init()
Definition: CholmodSupport.h:730
CholmodBase< MatrixType_, UpLo_, CholmodDecomposition > Base
Definition: CholmodSupport.h:690

References Eigen::CholmodDecomposition< MatrixType_, UpLo_ >::init().

◆ CholmodDecomposition() [2/2]

template<typename MatrixType_ , int UpLo_ = Lower>
Eigen::CholmodDecomposition< MatrixType_, UpLo_ >::CholmodDecomposition ( const MatrixType matrix)
inline
698  : Base() {
699  init();
700  this->compute(matrix);
701  }
CholmodDecomposition< MatrixType_, Lower > & compute(const MatrixType &matrix)
Definition: CholmodSupport.h:294
Eigen::Map< Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor >, 0, Eigen::OuterStride<> > matrix(T *data, int rows, int cols, int stride)
Definition: common.h:85

References Eigen::CholmodBase< MatrixType_, Lower, CholmodDecomposition< MatrixType_, Lower > >::compute(), and Eigen::CholmodDecomposition< MatrixType_, UpLo_ >::init().

◆ ~CholmodDecomposition()

template<typename MatrixType_ , int UpLo_ = Lower>
Eigen::CholmodDecomposition< MatrixType_, UpLo_ >::~CholmodDecomposition ( )
inline
703 {}

Member Function Documentation

◆ init()

template<typename MatrixType_ , int UpLo_ = Lower>
void Eigen::CholmodDecomposition< MatrixType_, UpLo_ >::init ( )
inlineprotected
730  {
731  m_cholmod.final_asis = 1;
732  m_cholmod.supernodal = CHOLMOD_AUTO;
733  }
cholmod_common m_cholmod
Definition: CholmodSupport.h:460

References Eigen::CholmodDecomposition< MatrixType_, UpLo_ >::m_cholmod.

Referenced by Eigen::CholmodDecomposition< MatrixType_, UpLo_ >::CholmodDecomposition().

◆ setMode()

template<typename MatrixType_ , int UpLo_ = Lower>
void Eigen::CholmodDecomposition< MatrixType_, UpLo_ >::setMode ( CholmodMode  mode)
inline
705  {
706  switch (mode) {
707  case CholmodAuto:
708  m_cholmod.final_asis = 1;
709  m_cholmod.supernodal = CHOLMOD_AUTO;
710  break;
712  m_cholmod.final_asis = 0;
713  m_cholmod.supernodal = CHOLMOD_SIMPLICIAL;
714  m_cholmod.final_ll = 1;
715  break;
717  m_cholmod.final_asis = 1;
718  m_cholmod.supernodal = CHOLMOD_SUPERNODAL;
719  break;
720  case CholmodLDLt:
721  m_cholmod.final_asis = 1;
722  m_cholmod.supernodal = CHOLMOD_SIMPLICIAL;
723  break;
724  default:
725  break;
726  }
727  }
@ CholmodSimplicialLLt
Definition: CholmodSupport.h:237
@ CholmodAuto
Definition: CholmodSupport.h:237
@ CholmodLDLt
Definition: CholmodSupport.h:237
@ CholmodSupernodalLLt
Definition: CholmodSupport.h:237

References Eigen::CholmodAuto, Eigen::CholmodLDLt, Eigen::CholmodSimplicialLLt, Eigen::CholmodSupernodalLLt, and Eigen::CholmodDecomposition< MatrixType_, UpLo_ >::m_cholmod.

Referenced by test_cholmod_ST().

Member Data Documentation

◆ m_cholmod

template<typename MatrixType_ , int UpLo_ = Lower>
cholmod_common Eigen::CholmodBase< MatrixType_, UpLo_, Derived >::m_cholmod
mutableprivate

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