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

A sparse direct LU factorization and solver based on the SuperLU library. More...

#include <SuperLUSupport.h>

+ Inheritance diagram for Eigen::SuperLU< _MatrixType >:
+ Collaboration diagram for Eigen::SuperLU< _MatrixType >:

Public Types

typedef SuperLUBase< _MatrixType, SuperLUBase
 
typedef _MatrixType MatrixType
 
typedef Base::Scalar Scalar
 
typedef Base::RealScalar RealScalar
 
typedef Base::Index Index
 
typedef Base::IntRowVectorType IntRowVectorType
 
typedef Base::IntColVectorType IntColVectorType
 
typedef Base::LUMatrixType LUMatrixType
 
typedef TriangularView< LUMatrixType, Lower|UnitDiag > LMatrixType
 
typedef TriangularView< LUMatrixType, Upper > UMatrixType
 
- Public Types inherited from Eigen::SuperLUBase< _MatrixType, SuperLU< _MatrixType > >
typedef _MatrixType MatrixType
 
typedef MatrixType::Scalar Scalar
 
typedef MatrixType::RealScalar RealScalar
 
typedef MatrixType::Index Index
 
typedef Matrix< Scalar, Dynamic, 1 > Vector
 
typedef Matrix< int, 1, MatrixType::ColsAtCompileTime > IntRowVectorType
 
typedef Matrix< int, MatrixType::RowsAtCompileTime, 1 > IntColVectorType
 
typedef SparseMatrix< Scalar > LUMatrixType
 

Public Member Functions

 SuperLU (const MatrixType &matrix)
 
void analyzePattern (const MatrixType &matrix)
 
void factorize (const MatrixType &matrix)
 
template<typename Rhs , typename Dest >
void _solve (const MatrixBase< Rhs > &b, MatrixBase< Dest > &dest) const
 
const LMatrixTypematrixL () const
 
const UMatrixTypematrixU () const
 
const IntColVectorTypepermutationP () const
 
const IntRowVectorTypepermutationQ () const
 
Scalar determinant () const
 
- Public Member Functions inherited from Eigen::SuperLUBase< _MatrixType, SuperLU< _MatrixType > >
SuperLU< _MatrixType > & derived ()
 
const SuperLU< _MatrixType > & derived () const
 
Index rows () const
 
Index cols () const
 
superlu_options_t & options ()
 
ComputationInfo info () const
 Reports whether previous computation was successful. More...
 
void compute (const MatrixType &matrix)
 
const internal::solve_retval< SuperLUBase, Rhs > solve (const MatrixBase< Rhs > &b) const
 
const internal::sparse_solve_retval< SuperLUBase, Rhs > solve (const SparseMatrixBase< Rhs > &b) const
 
void analyzePattern (const MatrixType &)
 
void dumpMemory (Stream &)
 

Protected Member Functions

void init ()
 
- Protected Member Functions inherited from Eigen::SuperLUBase< _MatrixType, SuperLU< _MatrixType > >
void initFactorization (const MatrixType &a)
 
void init ()
 
void extractData () const
 
void clearFactors ()
 

Additional Inherited Members

- Protected Attributes inherited from Eigen::SuperLUBase< _MatrixType, SuperLU< _MatrixType > >
LUMatrixType m_l
 
LUMatrixType m_u
 
IntColVectorType m_p
 
IntRowVectorType m_q
 
LUMatrixType m_matrix
 
SluMatrix m_sluA
 
SuperMatrix m_sluL
 
SuperMatrix m_sluU
 
SluMatrix m_sluB
 
SluMatrix m_sluX
 
SuperLUStat_t m_sluStat
 
superlu_options_t m_sluOptions
 
std::vector< int > m_sluEtree
 
Matrix< RealScalar, Dynamic, 1 > m_sluRscale
 
Matrix< RealScalar, Dynamic, 1 > m_sluCscale
 
Matrix< RealScalar, Dynamic, 1 > m_sluFerr
 
Matrix< RealScalar, Dynamic, 1 > m_sluBerr
 
char m_sluEqued
 
ComputationInfo m_info
 
bool m_isInitialized
 
int m_factorizationIsOk
 
int m_analysisIsOk
 
bool m_extractedDataAreDirty
 

Detailed Description

template<typename _MatrixType>
class Eigen::SuperLU< _MatrixType >

A sparse direct LU factorization and solver based on the SuperLU library.

This class allows to solve for A.X = B sparse linear problems via a direct LU factorization using the SuperLU library. The sparse matrix A must be squared and invertible. The vectors or matrices X and B can be either dense or sparse.

Template Parameters
_MatrixTypethe type of the sparse matrix A, it must be a SparseMatrix<>
See also
TutorialSparseDirectSolvers

Definition at line 479 of file SuperLUSupport.h.

Member Function Documentation

template<typename _MatrixType>
void Eigen::SuperLU< _MatrixType >::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 513 of file SuperLUSupport.h.

514  {
515  m_info = InvalidInput;
516  m_isInitialized = false;
518  }
Definition: math3d.h:219
void analyzePattern(const MatrixType &)
template<typename MatrixType >
void Eigen::SuperLU< MatrixType >::factorize ( const MatrixType &  matrix)

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 604 of file SuperLUSupport.h.

605 {
606  eigen_assert(m_analysisIsOk && "You must first call analyzePattern()");
607  if(!m_analysisIsOk)
608  {
609  m_info = InvalidInput;
610  return;
611  }
612 
613  this->initFactorization(a);
614 
615  m_sluOptions.ColPerm = COLAMD;
616  int info = 0;
617  RealScalar recip_pivot_growth, rcond;
618  RealScalar ferr, berr;
619 
620  StatInit(&m_sluStat);
621  SuperLU_gssvx(&m_sluOptions, &m_sluA, m_q.data(), m_p.data(), &m_sluEtree[0],
622  &m_sluEqued, &m_sluRscale[0], &m_sluCscale[0],
623  &m_sluL, &m_sluU,
624  NULL, 0,
625  &m_sluB, &m_sluX,
626  &recip_pivot_growth, &rcond,
627  &ferr, &berr,
628  &m_sluStat, &info, Scalar());
629  StatFree(&m_sluStat);
630 
631  m_extractedDataAreDirty = true;
632 
633  // FIXME how to better check for errors ???
634  m_info = info == 0 ? Success : NumericalIssue;
635  m_factorizationIsOk = true;
636 }
EIGEN_STRONG_INLINE const Scalar * data() const
ComputationInfo info() const
Reports whether previous computation was successful.

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