Shapeworks Studio  2.1
Shape analysis software suite
List of all members | Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
Eigen::SimplicialCholeskyBase< Derived > Class Template Reference

A direct sparse Cholesky factorizations. More...

#include <SimplicialCholesky.h>

+ Inheritance diagram for Eigen::SimplicialCholeskyBase< Derived >:
+ Collaboration diagram for Eigen::SimplicialCholeskyBase< Derived >:

Classes

struct  keep_diag
 

Public Types

enum  { UpLo = internal::traits<Derived>::UpLo }
 
typedef internal::traits< Derived >::MatrixType MatrixType
 
typedef MatrixType::Scalar Scalar
 
typedef MatrixType::RealScalar RealScalar
 
typedef MatrixType::Index Index
 
typedef SparseMatrix< Scalar, ColMajor, Index > CholMatrixType
 
typedef Matrix< Scalar, Dynamic, 1 > VectorType
 

Public Member Functions

 SimplicialCholeskyBase ()
 
 SimplicialCholeskyBase (const MatrixType &matrix)
 
Derived & derived ()
 
const Derived & derived () const
 
Index cols () const
 
Index rows () const
 
ComputationInfo info () const
 Reports whether previous computation was successful. More...
 
template<typename Rhs >
const internal::solve_retval< SimplicialCholeskyBase, Rhs > solve (const MatrixBase< Rhs > &b) const
 
template<typename Rhs >
const internal::sparse_solve_retval< SimplicialCholeskyBase, Rhs > solve (const SparseMatrixBase< Rhs > &b) const
 
const PermutationMatrix< Dynamic, Dynamic, Index > & permutationP () const
 
const PermutationMatrix< Dynamic, Dynamic, Index > & permutationPinv () const
 
Derived & setShift (const RealScalar &offset, const RealScalar &scale=1)
 
template<typename Stream >
void dumpMemory (Stream &s)
 
template<typename Rhs , typename Dest >
void _solve (const MatrixBase< Rhs > &b, MatrixBase< Dest > &dest) const
 

Protected Member Functions

template<bool DoLDLT>
void compute (const MatrixType &matrix)
 
template<bool DoLDLT>
void factorize (const MatrixType &a)
 
template<bool DoLDLT>
void factorize_preordered (const CholMatrixType &a)
 
void analyzePattern (const MatrixType &a, bool doLDLT)
 
void analyzePattern_preordered (const CholMatrixType &a, bool doLDLT)
 
void ordering (const MatrixType &a, CholMatrixType &ap)
 

Protected Attributes

ComputationInfo m_info
 
bool m_isInitialized
 
bool m_factorizationIsOk
 
bool m_analysisIsOk
 
CholMatrixType m_matrix
 
VectorType m_diag
 
VectorXi m_parent
 
VectorXi m_nonZerosPerCol
 
PermutationMatrix< Dynamic, Dynamic, Index > m_P
 
PermutationMatrix< Dynamic, Dynamic, Index > m_Pinv
 
RealScalar m_shiftOffset
 
RealScalar m_shiftScale
 

Detailed Description

template<typename Derived>
class Eigen::SimplicialCholeskyBase< Derived >

A direct sparse Cholesky factorizations.

These classes provide LL^T and LDL^T Cholesky factorizations of sparse matrices that are selfadjoint and positive definite. The factorization allows for solving A.X = B where X and B can be either dense or sparse.

In order to reduce the fill-in, a symmetric permutation P is applied prior to the factorization such that the factorized matrix is P A P^-1.

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

Definition at line 36 of file SimplicialCholesky.h.

Constructor & Destructor Documentation

template<typename Derived>
Eigen::SimplicialCholeskyBase< Derived >::SimplicialCholeskyBase ( )
inline

Default constructor

Definition at line 50 of file SimplicialCholesky.h.

51  : m_info(Success), m_isInitialized(false), m_shiftOffset(0), m_shiftScale(1)
52  {}

Member Function Documentation

template<typename Derived>
template<bool DoLDLT>
void Eigen::SimplicialCholeskyBase< Derived >::compute ( const MatrixType &  matrix)
inlineprotected

Computes the sparse Cholesky decomposition of matrix

Definition at line 184 of file SimplicialCholesky.h.

185  {
186  eigen_assert(matrix.rows()==matrix.cols());
187  Index size = matrix.cols();
188  CholMatrixType ap(size,size);
189  ordering(matrix, ap);
190  analyzePattern_preordered(ap, DoLDLT);
191  factorize_preordered<DoLDLT>(ap);
192  }
Definition: math3d.h:219
template<typename Derived>
ComputationInfo Eigen::SimplicialCholeskyBase< Derived >::info ( ) const
inline

Reports whether previous computation was successful.

Returns
Success if computation was succesful, NumericalIssue if the matrix.appears to be negative.

Definition at line 75 of file SimplicialCholesky.h.

76  {
77  eigen_assert(m_isInitialized && "Decomposition is not initialized.");
78  return m_info;
79  }
template<typename Derived>
const PermutationMatrix<Dynamic,Dynamic,Index>& Eigen::SimplicialCholeskyBase< Derived >::permutationP ( ) const
inline
Returns
the permutation P
See also
permutationPinv()

Definition at line 111 of file SimplicialCholesky.h.

112  { return m_P; }
template<typename Derived>
const PermutationMatrix<Dynamic,Dynamic,Index>& Eigen::SimplicialCholeskyBase< Derived >::permutationPinv ( ) const
inline
Returns
the inverse P^-1 of the permutation P
See also
permutationP()

Definition at line 116 of file SimplicialCholesky.h.

117  { return m_Pinv; }
template<typename Derived>
Derived& Eigen::SimplicialCholeskyBase< Derived >::setShift ( const RealScalar &  offset,
const RealScalar &  scale = 1 
)
inline

Sets the shift parameters that will be used to adjust the diagonal coefficients during the numerical factorization.

During the numerical factorization, the diagonal coefficients are transformed by the following linear model:
d_ii = offset + scale * d_ii

The default is the identity transformation with offset=0, and scale=1.

Returns
a reference to *this.

Definition at line 128 of file SimplicialCholesky.h.

129  {
130  m_shiftOffset = offset;
131  m_shiftScale = scale;
132  return derived();
133  }
template<typename Derived>
template<typename Rhs >
const internal::solve_retval<SimplicialCholeskyBase, Rhs> Eigen::SimplicialCholeskyBase< Derived >::solve ( const MatrixBase< Rhs > &  b) const
inline
Returns
the solution x of $ A x = b $ using the current decomposition of A.
See also
compute()

Definition at line 87 of file SimplicialCholesky.h.

88  {
89  eigen_assert(m_isInitialized && "Simplicial LLT or LDLT is not initialized.");
90  eigen_assert(rows()==b.rows()
91  && "SimplicialCholeskyBase::solve(): invalid number of rows of the right hand side matrix b");
92  return internal::solve_retval<SimplicialCholeskyBase, Rhs>(*this, b.derived());
93  }
template<typename Derived>
template<typename Rhs >
const internal::sparse_solve_retval<SimplicialCholeskyBase, Rhs> Eigen::SimplicialCholeskyBase< Derived >::solve ( const SparseMatrixBase< Rhs > &  b) const
inline
Returns
the solution x of $ A x = b $ using the current decomposition of A.
See also
compute()

Definition at line 101 of file SimplicialCholesky.h.

102  {
103  eigen_assert(m_isInitialized && "Simplicial LLT or LDLT is not initialized.");
104  eigen_assert(rows()==b.rows()
105  && "SimplicialCholesky::solve(): invalid number of rows of the right hand side matrix b");
106  return internal::sparse_solve_retval<SimplicialCholeskyBase, Rhs>(*this, b.derived());
107  }

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