Eigen::SimplicialCholesky< MatrixType_, UpLo_, Ordering_ > Class Template Reference
+ Inheritance diagram for Eigen::SimplicialCholesky< MatrixType_, UpLo_, Ordering_ >:

Public Types

enum  { UpLo }
 
typedef SimplicialCholeskyBase< SimplicialCholeskyBase
 
typedef SparseMatrix< Scalar, ColMajor, StorageIndexCholMatrixType
 
typedef internal::traits< SimplicialLDLT< MatrixType, UpLo > > LDLTTraits
 
typedef internal::traits< SimplicialLLT< MatrixType, UpLo > > LLTTraits
 
typedef MatrixType_ MatrixType
 
typedef MatrixType::RealScalar RealScalar
 
typedef MatrixType::Scalar Scalar
 
typedef MatrixType::StorageIndex StorageIndex
 
typedef internal::traits< SimplicialCholeskyTraits
 
typedef Matrix< Scalar, Dynamic, 1 > VectorType
 
- Public Types inherited from Eigen::SimplicialCholeskyBase< SimplicialCholesky< MatrixType_, UpLo_, Ordering_ > >
enum  
 
enum  
 
typedef SparseMatrix< Scalar, ColMajor, StorageIndexCholMatrixType
 
typedef CholMatrixType const * ConstCholMatrixPtr
 
typedef internal::traits< SimplicialCholesky< MatrixType_, UpLo_, Ordering_ > >::MatrixType MatrixType
 
typedef internal::traits< SimplicialCholesky< MatrixType_, UpLo_, Ordering_ > >::OrderingType OrderingType
 
typedef MatrixType::RealScalar RealScalar
 
typedef MatrixType::Scalar Scalar
 
typedef MatrixType::StorageIndex StorageIndex
 
typedef Matrix< StorageIndex, Dynamic, 1 > VectorI
 
typedef Matrix< Scalar, Dynamic, 1 > VectorType
 

Public Member Functions

template<typename Rhs , typename Dest >
void _solve_impl (const MatrixBase< Rhs > &b, MatrixBase< Dest > &dest) const
 
template<typename Rhs , typename Dest >
void _solve_impl (const SparseMatrixBase< Rhs > &b, SparseMatrixBase< Dest > &dest) const
 
void analyzePattern (const MatrixType &a)
 
SimplicialCholeskycompute (const MatrixType &matrix)
 
Scalar determinant () const
 
void factorize (const MatrixType &a)
 
const CholMatrixType rawMatrix () const
 
SimplicialCholeskysetMode (SimplicialCholeskyMode mode)
 
 SimplicialCholesky ()
 
 SimplicialCholesky (const MatrixType &matrix)
 
const VectorType vectorD () const
 
- Public Member Functions inherited from Eigen::SimplicialCholeskyBase< SimplicialCholesky< MatrixType_, UpLo_, Ordering_ > >
Index cols () const
 
SimplicialCholesky< MatrixType_, UpLo_, Ordering_ > & derived ()
 
SimplicialCholesky< MatrixType_, UpLo_, Ordering_ > & derived ()
 
const SimplicialCholesky< MatrixType_, UpLo_, Ordering_ > & derived () const
 
const SimplicialCholesky< MatrixType_, UpLo_, Ordering_ > & derived () const
 
ComputationInfo info () const
 Reports whether previous computation was successful. More...
 
const PermutationMatrix< Dynamic, Dynamic, StorageIndex > & permutationP () const
 
const PermutationMatrix< Dynamic, Dynamic, StorageIndex > & permutationPinv () const
 
Index rows () const
 
SimplicialCholesky< MatrixType_, UpLo_, Ordering_ > & setShift (const RealScalar &offset, const RealScalar &scale=1)
 
 SimplicialCholeskyBase ()
 
 SimplicialCholeskyBase (const MatrixType &matrix)
 
 ~SimplicialCholeskyBase ()
 
- Public Member Functions inherited from Eigen::SparseSolverBase< SimplicialCholesky< MatrixType_, UpLo_, Ordering_ > >
SimplicialCholesky< MatrixType_, UpLo_, Ordering_ > & derived ()
 
const SimplicialCholesky< MatrixType_, UpLo_, Ordering_ > & derived () const
 
const Solve< SimplicialCholesky< MatrixType_, UpLo_, Ordering_ >, Rhs > solve (const MatrixBase< Rhs > &b) const
 
const Solve< SimplicialCholesky< MatrixType_, UpLo_, Ordering_ >, Rhs > solve (const SparseMatrixBase< Rhs > &b) const
 
 SparseSolverBase ()
 
 SparseSolverBase (SparseSolverBase &&other)
 
 ~SparseSolverBase ()
 

Protected Attributes

bool m_LDLT
 
- Protected Attributes inherited from Eigen::SimplicialCholeskyBase< SimplicialCholesky< MatrixType_, UpLo_, Ordering_ > >
bool m_analysisIsOk
 
VectorType m_diag
 
bool m_factorizationIsOk
 
ComputationInfo m_info
 
CholMatrixType m_matrix
 
VectorI m_nonZerosPerCol
 
PermutationMatrix< Dynamic, Dynamic, StorageIndexm_P
 
VectorI m_parent
 
PermutationMatrix< Dynamic, Dynamic, StorageIndexm_Pinv
 
RealScalar m_shiftOffset
 
RealScalar m_shiftScale
 
- Protected Attributes inherited from Eigen::SparseSolverBase< SimplicialCholesky< MatrixType_, UpLo_, Ordering_ > >
bool m_isInitialized
 

Additional Inherited Members

- Protected Member Functions inherited from Eigen::SimplicialCholeskyBase< SimplicialCholesky< MatrixType_, UpLo_, Ordering_ > >
void analyzePattern (const MatrixType &a, bool doLDLT)
 
void analyzePattern_preordered (const CholMatrixType &a, bool doLDLT)
 
void compute (const MatrixType &matrix)
 
void factorize (const MatrixType &a)
 
void factorize_preordered (const CholMatrixType &a)
 
void ordering (const MatrixType &a, ConstCholMatrixPtr &pmat, CholMatrixType &ap)
 

Detailed Description

template<typename MatrixType_, int UpLo_, typename Ordering_>
class Eigen::SimplicialCholesky< MatrixType_, UpLo_, Ordering_ >

Deprecated:
use SimplicialLDLT or class SimplicialLLT
See also
class SimplicialLDLT, class SimplicialLLT

Definition at line 513 of file SimplicialCholesky.h.

Member Typedef Documentation

◆ Base

template<typename MatrixType_ , int UpLo_, typename Ordering_ >
typedef SimplicialCholeskyBase<SimplicialCholesky> Eigen::SimplicialCholesky< MatrixType_, UpLo_, Ordering_ >::Base

Definition at line 518 of file SimplicialCholesky.h.

◆ CholMatrixType

template<typename MatrixType_ , int UpLo_, typename Ordering_ >
typedef SparseMatrix<Scalar,ColMajor,StorageIndex> Eigen::SimplicialCholesky< MatrixType_, UpLo_, Ordering_ >::CholMatrixType

Definition at line 522 of file SimplicialCholesky.h.

◆ LDLTTraits

template<typename MatrixType_ , int UpLo_, typename Ordering_ >
typedef internal::traits<SimplicialLDLT<MatrixType,UpLo> > Eigen::SimplicialCholesky< MatrixType_, UpLo_, Ordering_ >::LDLTTraits

Definition at line 525 of file SimplicialCholesky.h.

◆ LLTTraits

template<typename MatrixType_ , int UpLo_, typename Ordering_ >
typedef internal::traits<SimplicialLLT<MatrixType,UpLo> > Eigen::SimplicialCholesky< MatrixType_, UpLo_, Ordering_ >::LLTTraits

Definition at line 526 of file SimplicialCholesky.h.

◆ MatrixType

template<typename MatrixType_ , int UpLo_, typename Ordering_ >
typedef MatrixType_ Eigen::SimplicialCholesky< MatrixType_, UpLo_, Ordering_ >::MatrixType

Definition at line 516 of file SimplicialCholesky.h.

◆ RealScalar

template<typename MatrixType_ , int UpLo_, typename Ordering_ >
typedef MatrixType::RealScalar Eigen::SimplicialCholesky< MatrixType_, UpLo_, Ordering_ >::RealScalar

Definition at line 520 of file SimplicialCholesky.h.

◆ Scalar

template<typename MatrixType_ , int UpLo_, typename Ordering_ >
typedef MatrixType::Scalar Eigen::SimplicialCholesky< MatrixType_, UpLo_, Ordering_ >::Scalar

Definition at line 519 of file SimplicialCholesky.h.

◆ StorageIndex

template<typename MatrixType_ , int UpLo_, typename Ordering_ >
typedef MatrixType::StorageIndex Eigen::SimplicialCholesky< MatrixType_, UpLo_, Ordering_ >::StorageIndex

Definition at line 521 of file SimplicialCholesky.h.

◆ Traits

template<typename MatrixType_ , int UpLo_, typename Ordering_ >
typedef internal::traits<SimplicialCholesky> Eigen::SimplicialCholesky< MatrixType_, UpLo_, Ordering_ >::Traits

Definition at line 524 of file SimplicialCholesky.h.

◆ VectorType

template<typename MatrixType_ , int UpLo_, typename Ordering_ >
typedef Matrix<Scalar,Dynamic,1> Eigen::SimplicialCholesky< MatrixType_, UpLo_, Ordering_ >::VectorType

Definition at line 523 of file SimplicialCholesky.h.

Member Enumeration Documentation

◆ anonymous enum

template<typename MatrixType_ , int UpLo_, typename Ordering_ >
anonymous enum
Enumerator
UpLo 

Definition at line 517 of file SimplicialCholesky.h.

Constructor & Destructor Documentation

◆ SimplicialCholesky() [1/2]

template<typename MatrixType_ , int UpLo_, typename Ordering_ >
Eigen::SimplicialCholesky< MatrixType_, UpLo_, Ordering_ >::SimplicialCholesky ( )
inline

Definition at line 528 of file SimplicialCholesky.h.

528 : Base(), m_LDLT(true) {}
SimplicialCholeskyBase< SimplicialCholesky > Base

◆ SimplicialCholesky() [2/2]

template<typename MatrixType_ , int UpLo_, typename Ordering_ >
Eigen::SimplicialCholesky< MatrixType_, UpLo_, Ordering_ >::SimplicialCholesky ( const MatrixType matrix)
inlineexplicit

Definition at line 530 of file SimplicialCholesky.h.

531  : Base(), m_LDLT(true)
532  {
533  compute(matrix);
534  }
SimplicialCholesky & compute(const MatrixType &matrix)

Member Function Documentation

◆ _solve_impl() [1/2]

template<typename MatrixType_ , int UpLo_, typename Ordering_ >
template<typename Rhs , typename Dest >
void Eigen::SimplicialCholesky< MatrixType_, UpLo_, Ordering_ >::_solve_impl ( const MatrixBase< Rhs > &  b,
MatrixBase< Dest > &  dest 
) const
inline

Definition at line 599 of file SimplicialCholesky.h.

600  {
601  eigen_assert(Base::m_factorizationIsOk && "The decomposition is not in a valid state for solving, you must first call either compute() or symbolic()/numeric()");
602  eigen_assert(Base::m_matrix.rows()==b.rows());
603 
604  if(Base::m_info!=Success)
605  return;
606 
607  if(Base::m_P.size()>0)
608  dest = Base::m_P * b;
609  else
610  dest = b;
611 
612  if(Base::m_matrix.nonZeros()>0) // otherwise L==I
613  {
614  if(m_LDLT)
615  LDLTTraits::getL(Base::m_matrix).solveInPlace(dest);
616  else
617  LLTTraits::getL(Base::m_matrix).solveInPlace(dest);
618  }
619 
620  if(Base::m_diag.size()>0)
621  dest = Base::m_diag.real().asDiagonal().inverse() * dest;
622 
623  if (Base::m_matrix.nonZeros()>0) // otherwise I==I
624  {
625  if(m_LDLT)
626  LDLTTraits::getU(Base::m_matrix).solveInPlace(dest);
627  else
628  LLTTraits::getU(Base::m_matrix).solveInPlace(dest);
629  }
630 
631  if(Base::m_P.size()>0)
632  dest = Base::m_Pinv * dest;
633  }
Array< int, 3, 1 > b
#define eigen_assert(x)
Definition: Macros.h:902
PermutationMatrix< Dynamic, Dynamic, StorageIndex > m_P
PermutationMatrix< Dynamic, Dynamic, StorageIndex > m_Pinv
@ Success
Definition: Constants.h:446

◆ _solve_impl() [2/2]

template<typename MatrixType_ , int UpLo_, typename Ordering_ >
template<typename Rhs , typename Dest >
void Eigen::SimplicialCholesky< MatrixType_, UpLo_, Ordering_ >::_solve_impl ( const SparseMatrixBase< Rhs > &  b,
SparseMatrixBase< Dest > &  dest 
) const
inline

Definition at line 637 of file SimplicialCholesky.h.

638  {
640  }
std::enable_if_t< Rhs::ColsAtCompileTime!=1 &&Dest::ColsAtCompileTime!=1 > solve_sparse_through_dense_panels(const Decomposition &dec, const Rhs &rhs, Dest &dest)

◆ analyzePattern()

template<typename MatrixType_ , int UpLo_, typename Ordering_ >
void Eigen::SimplicialCholesky< MatrixType_, UpLo_, Ordering_ >::analyzePattern ( const MatrixType a)
inline

Performs a symbolic decomposition on the sparcity of matrix.

This function is particularly useful when solving for several problems having the same structure.

See also
factorize()

Definition at line 578 of file SimplicialCholesky.h.

579  {
581  }
void analyzePattern(const MatrixType &a, bool doLDLT)

◆ compute()

template<typename MatrixType_ , int UpLo_, typename Ordering_ >
SimplicialCholesky& Eigen::SimplicialCholesky< MatrixType_, UpLo_, Ordering_ >::compute ( const MatrixType matrix)
inline

Computes the sparse Cholesky decomposition of matrix

Definition at line 563 of file SimplicialCholesky.h.

564  {
565  if(m_LDLT)
566  Base::template compute<true>(matrix);
567  else
568  Base::template compute<false>(matrix);
569  return *this;
570  }

◆ determinant()

template<typename MatrixType_ , int UpLo_, typename Ordering_ >
Scalar Eigen::SimplicialCholesky< MatrixType_, UpLo_, Ordering_ >::determinant ( ) const
inline

Definition at line 642 of file SimplicialCholesky.h.

643  {
644  if(m_LDLT)
645  {
646  return Base::m_diag.prod();
647  }
648  else
649  {
650  Scalar detL = Diagonal<const CholMatrixType>(Base::m_matrix).prod();
651  return numext::abs2(detL);
652  }
653  }
bool abs2(bool x)

◆ factorize()

template<typename MatrixType_ , int UpLo_, typename Ordering_ >
void Eigen::SimplicialCholesky< MatrixType_, UpLo_, Ordering_ >::factorize ( const MatrixType a)
inline

Performs a numeric decomposition of matrix

The given matrix must has the same sparcity than the matrix on which the symbolic decomposition has been performed.

See also
analyzePattern()

Definition at line 589 of file SimplicialCholesky.h.

590  {
591  if(m_LDLT)
592  Base::template factorize<true>(a);
593  else
594  Base::template factorize<false>(a);
595  }

◆ rawMatrix()

template<typename MatrixType_ , int UpLo_, typename Ordering_ >
const CholMatrixType Eigen::SimplicialCholesky< MatrixType_, UpLo_, Ordering_ >::rawMatrix ( ) const
inline

Definition at line 557 of file SimplicialCholesky.h.

557  {
558  eigen_assert(Base::m_factorizationIsOk && "Simplicial Cholesky not factorized");
559  return Base::m_matrix;
560  }

◆ setMode()

template<typename MatrixType_ , int UpLo_, typename Ordering_ >
SimplicialCholesky& Eigen::SimplicialCholesky< MatrixType_, UpLo_, Ordering_ >::setMode ( SimplicialCholeskyMode  mode)
inline

Definition at line 536 of file SimplicialCholesky.h.

537  {
538  switch(mode)
539  {
541  m_LDLT = false;
542  break;
544  m_LDLT = true;
545  break;
546  default:
547  break;
548  }
549 
550  return *this;
551  }
@ SimplicialCholeskyLDLT
@ SimplicialCholeskyLLT

◆ vectorD()

template<typename MatrixType_ , int UpLo_, typename Ordering_ >
const VectorType Eigen::SimplicialCholesky< MatrixType_, UpLo_, Ordering_ >::vectorD ( ) const
inline

Definition at line 553 of file SimplicialCholesky.h.

553  {
554  eigen_assert(Base::m_factorizationIsOk && "Simplicial Cholesky not factorized");
555  return Base::m_diag;
556  }

Member Data Documentation

◆ m_LDLT

template<typename MatrixType_ , int UpLo_, typename Ordering_ >
bool Eigen::SimplicialCholesky< MatrixType_, UpLo_, Ordering_ >::m_LDLT
protected

Definition at line 656 of file SimplicialCholesky.h.


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