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

The base class for the direct Cholesky factorization of Cholmod. More...

#include <CholmodSupport.h>

+ Inheritance diagram for Eigen::CholmodBase< _MatrixType, _UpLo, Derived >:
+ Collaboration diagram for Eigen::CholmodBase< _MatrixType, _UpLo, Derived >:

Public Types

enum  { UpLo = _UpLo }
 
typedef _MatrixType MatrixType
 
typedef MatrixType::Scalar Scalar
 
typedef MatrixType::RealScalar RealScalar
 
typedef MatrixType CholMatrixType
 
typedef MatrixType::Index Index
 

Public Member Functions

 CholmodBase (const MatrixType &matrix)
 
Index cols () const
 
Index rows () const
 
Derived & derived ()
 
const Derived & derived () const
 
ComputationInfo info () const
 Reports whether previous computation was successful. More...
 
Derived & compute (const MatrixType &matrix)
 
template<typename Rhs >
const internal::solve_retval< CholmodBase, Rhs > solve (const MatrixBase< Rhs > &b) const
 
template<typename Rhs >
const internal::sparse_solve_retval< CholmodBase, Rhs > solve (const SparseMatrixBase< Rhs > &b) const
 
void analyzePattern (const MatrixType &matrix)
 
void factorize (const MatrixType &matrix)
 
cholmod_common & cholmod ()
 
template<typename Rhs , typename Dest >
void _solve (const MatrixBase< Rhs > &b, MatrixBase< Dest > &dest) const
 
template<typename RhsScalar , int RhsOptions, typename RhsIndex , typename DestScalar , int DestOptions, typename DestIndex >
void _solve (const SparseMatrix< RhsScalar, RhsOptions, RhsIndex > &b, SparseMatrix< DestScalar, DestOptions, DestIndex > &dest) const
 
Derived & setShift (const RealScalar &offset)
 
template<typename Stream >
void dumpMemory (Stream &)
 

Protected Attributes

cholmod_common m_cholmod
 
cholmod_factor * m_cholmodFactor
 
RealScalar m_shiftOffset [2]
 
ComputationInfo m_info
 
bool m_isInitialized
 
int m_factorizationIsOk
 
int m_analysisIsOk
 

Detailed Description

template<typename _MatrixType, int _UpLo, typename Derived>
class Eigen::CholmodBase< _MatrixType, _UpLo, Derived >

The base class for the direct Cholesky factorization of Cholmod.

See also
class CholmodSupernodalLLT, class CholmodSimplicialLDLT, class CholmodSimplicialLLT

Definition at line 158 of file CholmodSupport.h.

Member Function Documentation

template<typename _MatrixType, int _UpLo, typename Derived>
void Eigen::CholmodBase< _MatrixType, _UpLo, Derived >::analyzePattern ( const MatrixType &  matrix)
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 250 of file CholmodSupport.h.

251  {
252  if(m_cholmodFactor)
253  {
254  cholmod_free_factor(&m_cholmodFactor, &m_cholmod);
255  m_cholmodFactor = 0;
256  }
257  cholmod_sparse A = viewAsCholmod(matrix.template selfadjointView<UpLo>());
258  m_cholmodFactor = cholmod_analyze(&A, &m_cholmod);
259 
260  this->m_isInitialized = true;
261  this->m_info = Success;
262  m_analysisIsOk = true;
263  m_factorizationIsOk = false;
264  }
Definition: math3d.h:219
template<typename _MatrixType, int _UpLo, typename Derived>
cholmod_common& Eigen::CholmodBase< _MatrixType, _UpLo, Derived >::cholmod ( )
inline

Returns a reference to the Cholmod's configuration structure to get a full control over the performed operations. See the Cholmod user guide for details.

Definition at line 285 of file CholmodSupport.h.

285 { return m_cholmod; }
template<typename _MatrixType, int _UpLo, typename Derived>
Derived& Eigen::CholmodBase< _MatrixType, _UpLo, Derived >::compute ( const MatrixType &  matrix)
inline

Computes the sparse Cholesky decomposition of matrix

Definition at line 209 of file CholmodSupport.h.

210  {
212  factorize(matrix);
213  return derived();
214  }
Definition: math3d.h:219
void factorize(const MatrixType &matrix)
void analyzePattern(const MatrixType &matrix)
template<typename _MatrixType, int _UpLo, typename Derived>
void Eigen::CholmodBase< _MatrixType, _UpLo, Derived >::factorize ( const MatrixType &  matrix)
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 272 of file CholmodSupport.h.

273  {
274  eigen_assert(m_analysisIsOk && "You must first call analyzePattern()");
275  cholmod_sparse A = viewAsCholmod(matrix.template selfadjointView<UpLo>());
276  cholmod_factorize_p(&A, m_shiftOffset, 0, 0, m_cholmodFactor, &m_cholmod);
277 
278  // If the factorization failed, minor is the column at which it did. On success minor == n.
279  this->m_info = (m_cholmodFactor->minor == m_cholmodFactor->n ? Success : NumericalIssue);
280  m_factorizationIsOk = true;
281  }
Definition: math3d.h:219
template<typename _MatrixType, int _UpLo, typename Derived>
ComputationInfo Eigen::CholmodBase< _MatrixType, _UpLo, 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 202 of file CholmodSupport.h.

203  {
204  eigen_assert(m_isInitialized && "Decomposition is not initialized.");
205  return m_info;
206  }
template<typename _MatrixType, int _UpLo, typename Derived>
Derived& Eigen::CholmodBase< _MatrixType, _UpLo, Derived >::setShift ( const RealScalar &  offset)
inline

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

During the numerical factorization, an offset term is added to the diagonal coefficients:
d_ii = offset + d_ii

The default is offset=0.

Returns
a reference to *this.

Definition at line 342 of file CholmodSupport.h.

343  {
344  m_shiftOffset[0] = offset;
345  return derived();
346  }
template<typename _MatrixType, int _UpLo, typename Derived>
template<typename Rhs >
const internal::solve_retval<CholmodBase, Rhs> Eigen::CholmodBase< _MatrixType, _UpLo, 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 222 of file CholmodSupport.h.

223  {
224  eigen_assert(m_isInitialized && "LLT is not initialized.");
225  eigen_assert(rows()==b.rows()
226  && "CholmodDecomposition::solve(): invalid number of rows of the right hand side matrix b");
227  return internal::solve_retval<CholmodBase, Rhs>(*this, b.derived());
228  }
template<typename _MatrixType, int _UpLo, typename Derived>
template<typename Rhs >
const internal::sparse_solve_retval<CholmodBase, Rhs> Eigen::CholmodBase< _MatrixType, _UpLo, 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 236 of file CholmodSupport.h.

237  {
238  eigen_assert(m_isInitialized && "LLT is not initialized.");
239  eigen_assert(rows()==b.rows()
240  && "CholmodDecomposition::solve(): invalid number of rows of the right hand side matrix b");
241  return internal::sparse_solve_retval<CholmodBase, Rhs>(*this, b.derived());
242  }

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