Eigen::SuperILU< MatrixType_ > Class Template Reference

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

+ Inheritance diagram for Eigen::SuperILU< MatrixType_ >:

Public Types

typedef SuperLUBase< MatrixType_, SuperILUBase
 
typedef MatrixType_ MatrixType
 
typedef Base::RealScalar RealScalar
 
typedef Base::Scalar Scalar
 
- Public Types inherited from Eigen::SuperLUBase< MatrixType_, SuperILU< MatrixType_ > >
enum  
 
typedef Matrix< int, MatrixType::RowsAtCompileTime, 1 > IntColVectorType
 
typedef Matrix< int, 1, MatrixType::ColsAtCompileTime > IntRowVectorType
 
typedef SparseMatrix< ScalarLUMatrixType
 
typedef MatrixType_ MatrixType
 
typedef Map< PermutationMatrix< Dynamic, Dynamic, int > > PermutationMap
 
typedef MatrixType::RealScalar RealScalar
 
typedef MatrixType::Scalar Scalar
 
typedef MatrixType::StorageIndex StorageIndex
 
typedef Matrix< Scalar, Dynamic, 1 > Vector
 

Public Member Functions

void analyzePattern (const MatrixType &matrix)
 
void factorize (const MatrixType &matrix)
 
 SuperILU ()
 
 SuperILU (const MatrixType &matrix)
 
 ~SuperILU ()
 
- Public Member Functions inherited from Eigen::SuperLUBase< MatrixType_, SuperILU< MatrixType_ > >
void analyzePattern (const MatrixType &)
 
Index cols () const
 
void compute (const MatrixType &matrix)
 
void dumpMemory (Stream &)
 
ComputationInfo info () const
 Reports whether previous computation was successful. More...
 
superlu_options_t & options ()
 
Index rows () const
 
 SuperLUBase ()
 
 ~SuperLUBase ()
 
- Public Member Functions inherited from Eigen::SparseSolverBase< Derived >
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
 
 SparseSolverBase ()
 
 SparseSolverBase (SparseSolverBase &&other)
 
 ~SparseSolverBase ()
 

Protected Member Functions

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

Protected Attributes

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

Private Member Functions

 SuperILU (SuperILU &)
 

Additional Inherited Members

- Protected Types inherited from Eigen::SuperLUBase< MatrixType_, SuperILU< MatrixType_ > >
typedef SparseSolverBase< SuperILU< MatrixType_ > > Base
 

Detailed Description

template<typename MatrixType_>
class Eigen::SuperILU< MatrixType_ >

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

This class allows to solve for an approximate solution of A.X = B sparse linear problems via an incomplete LU factorization using the SuperLU library. This class is aimed to be used as a preconditioner of the iterative linear solvers.

Warning
This class is only for the 4.x versions of SuperLU. The 3.x and 5.x versions are not supported.
Template Parameters
MatrixType_the type of the sparse matrix A, it must be a SparseMatrix<>

This class follows the sparse solver concept .

See also
Sparse solver concept, class IncompleteLUT, class ConjugateGradient, class BiCGSTAB

Definition at line 843 of file SuperLUSupport.h.

Member Typedef Documentation

◆ Base

template<typename MatrixType_ >
typedef SuperLUBase<MatrixType_,SuperILU> Eigen::SuperILU< MatrixType_ >::Base

Definition at line 846 of file SuperLUSupport.h.

◆ MatrixType

template<typename MatrixType_ >
typedef MatrixType_ Eigen::SuperILU< MatrixType_ >::MatrixType

Definition at line 847 of file SuperLUSupport.h.

◆ RealScalar

template<typename MatrixType_ >
typedef Base::RealScalar Eigen::SuperILU< MatrixType_ >::RealScalar

Definition at line 849 of file SuperLUSupport.h.

◆ Scalar

template<typename MatrixType_ >
typedef Base::Scalar Eigen::SuperILU< MatrixType_ >::Scalar

Definition at line 848 of file SuperLUSupport.h.

Constructor & Destructor Documentation

◆ SuperILU() [1/3]

template<typename MatrixType_ >
Eigen::SuperILU< MatrixType_ >::SuperILU ( )
inline

Definition at line 854 of file SuperLUSupport.h.

854 : Base() { init(); }
SuperLUBase< MatrixType_, SuperILU > Base

◆ SuperILU() [2/3]

template<typename MatrixType_ >
Eigen::SuperILU< MatrixType_ >::SuperILU ( const MatrixType matrix)
inline

Definition at line 856 of file SuperLUSupport.h.

856  : Base()
857  {
858  init();
859  Base::compute(matrix);
860  }
void compute(const MatrixType &matrix)

◆ ~SuperILU()

template<typename MatrixType_ >
Eigen::SuperILU< MatrixType_ >::~SuperILU ( )
inline

Definition at line 862 of file SuperLUSupport.h.

863  {
864  }

◆ SuperILU() [3/3]

template<typename MatrixType_ >
Eigen::SuperILU< MatrixType_ >::SuperILU ( SuperILU< MatrixType_ > &  )
inlineprivate

Definition at line 938 of file SuperLUSupport.h.

938 { }

Member Function Documentation

◆ analyzePattern()

template<typename MatrixType_ >
void Eigen::SuperILU< 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 872 of file SuperLUSupport.h.

873  {
874  Base::analyzePattern(matrix);
875  }
void analyzePattern(const MatrixType &)

◆ factorize()

template<typename MatrixType >
void Eigen::SuperILU< 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 942 of file SuperLUSupport.h.

943 {
944  eigen_assert(m_analysisIsOk && "You must first call analyzePattern()");
945  if(!m_analysisIsOk)
946  {
948  return;
949  }
950 
951  this->initFactorization(a);
952 
953  int info = 0;
954  RealScalar recip_pivot_growth, rcond;
955 
956  StatInit(&m_sluStat);
957  SuperLU_gsisx(&m_sluOptions, &m_sluA, m_q.data(), m_p.data(), &m_sluEtree[0],
959  &m_sluL, &m_sluU,
960  NULL, 0,
961  &m_sluB, &m_sluX,
962  &recip_pivot_growth, &rcond,
963  &m_sluStat, &info, Scalar());
964  StatFree(&m_sluStat);
965 
966  // FIXME how to better check for errors ???
967  m_info = info == 0 ? Success : NumericalIssue;
968  m_factorizationIsOk = true;
969 }
#define eigen_assert(x)
Definition: Macros.h:902
const Scalar * data() const
std::vector< int > m_sluEtree
Matrix< RealScalar, Dynamic, 1 > m_sluRscale
SuperMatrix m_sluL
SuperLUStat_t m_sluStat
Base::RealScalar RealScalar
SuperMatrix m_sluU
IntRowVectorType m_q
Matrix< RealScalar, Dynamic, 1 > m_sluCscale
IntColVectorType m_p
superlu_options_t m_sluOptions
Base::Scalar Scalar
ComputationInfo m_info
ComputationInfo info() const
Reports whether previous computation was successful.
@ NumericalIssue
Definition: Constants.h:448
@ InvalidInput
Definition: Constants.h:453
@ Success
Definition: Constants.h:446

◆ init()

template<typename MatrixType_ >
void Eigen::SuperILU< MatrixType_ >::init ( )
inlineprotected

Definition at line 918 of file SuperLUSupport.h.

919  {
920  Base::init();
921 
922  ilu_set_default_options(&m_sluOptions);
923  m_sluOptions.PrintStat = NO;
924  m_sluOptions.ConditionNumber = NO;
925  m_sluOptions.Trans = NOTRANS;
926  m_sluOptions.ColPerm = MMD_AT_PLUS_A;
927 
928  // no attempt to preserve column sum
929  m_sluOptions.ILU_MILU = SILU;
930  // only basic ILU(k) support -- no direct control over memory consumption
931  // better to use ILU_DropRule = DROP_BASIC | DROP_AREA
932  // and set ILU_FillFactor to max memory growth
933  m_sluOptions.ILU_DropRule = DROP_BASIC;
934  m_sluOptions.ILU_DropTol = NumTraits<Scalar>::dummy_precision()*10;
935  }

Member Data Documentation

◆ m_analysisIsOk

template<typename MatrixType_ >
int Eigen::SuperLUBase< MatrixType_, Derived >::m_analysisIsOk
protected

Definition at line 465 of file SuperLUSupport.h.

◆ m_extractedDataAreDirty

template<typename MatrixType_ >
bool Eigen::SuperLUBase< MatrixType_, Derived >::m_extractedDataAreDirty
mutableprotected

Definition at line 466 of file SuperLUSupport.h.

◆ m_factorizationIsOk

template<typename MatrixType_ >
int Eigen::SuperLUBase< MatrixType_, Derived >::m_factorizationIsOk
protected

Definition at line 464 of file SuperLUSupport.h.

◆ m_info

template<typename MatrixType_ >
ComputationInfo Eigen::SuperLUBase< MatrixType_, Derived >::m_info
mutableprotected

Definition at line 463 of file SuperLUSupport.h.

◆ m_isInitialized

template<typename MatrixType_ >
bool Eigen::SparseSolverBase< Derived >::m_isInitialized
mutableprotected

Definition at line 324 of file SparseSolverBase.h.

◆ m_l

template<typename MatrixType_ >
LUMatrixType Eigen::SuperLUBase< MatrixType_, Derived >::m_l
mutableprotected

Definition at line 447 of file SuperLUSupport.h.

◆ m_matrix

template<typename MatrixType_ >
LUMatrixType Eigen::SuperLUBase< MatrixType_, Derived >::m_matrix
mutableprotected

Definition at line 452 of file SuperLUSupport.h.

◆ m_p

template<typename MatrixType_ >
IntColVectorType Eigen::SuperLUBase< MatrixType_, Derived >::m_p
mutableprotected

Definition at line 449 of file SuperLUSupport.h.

◆ m_q

template<typename MatrixType_ >
IntRowVectorType Eigen::SuperLUBase< MatrixType_, Derived >::m_q
mutableprotected

Definition at line 450 of file SuperLUSupport.h.

◆ m_sluA

template<typename MatrixType_ >
SluMatrix Eigen::SuperLUBase< MatrixType_, Derived >::m_sluA
mutableprotected

Definition at line 453 of file SuperLUSupport.h.

◆ m_sluB

template<typename MatrixType_ >
SluMatrix Eigen::SuperLUBase< MatrixType_, Derived >::m_sluB
mutableprotected

Definition at line 455 of file SuperLUSupport.h.

◆ m_sluBerr

template<typename MatrixType_ >
Matrix<RealScalar,Dynamic,1> Eigen::SuperLUBase< MatrixType_, Derived >::m_sluBerr
protected

Definition at line 460 of file SuperLUSupport.h.

◆ m_sluCscale

template<typename MatrixType_ >
Matrix<RealScalar,Dynamic,1> Eigen::SuperLUBase< MatrixType_, Derived >::m_sluCscale
protected

Definition at line 459 of file SuperLUSupport.h.

◆ m_sluEqued

template<typename MatrixType_ >
char Eigen::SuperLUBase< MatrixType_, Derived >::m_sluEqued
mutableprotected

Definition at line 461 of file SuperLUSupport.h.

◆ m_sluEtree

template<typename MatrixType_ >
std::vector<int> Eigen::SuperLUBase< MatrixType_, Derived >::m_sluEtree
mutableprotected

Definition at line 458 of file SuperLUSupport.h.

◆ m_sluFerr

template<typename MatrixType_ >
Matrix<RealScalar,Dynamic,1> Eigen::SuperLUBase< MatrixType_, Derived >::m_sluFerr
mutableprotected

Definition at line 460 of file SuperLUSupport.h.

◆ m_sluL

template<typename MatrixType_ >
SuperMatrix Eigen::SuperLUBase< MatrixType_, Derived >::m_sluL
mutableprotected

Definition at line 454 of file SuperLUSupport.h.

◆ m_sluOptions

template<typename MatrixType_ >
superlu_options_t Eigen::SuperLUBase< MatrixType_, Derived >::m_sluOptions
mutableprotected

Definition at line 457 of file SuperLUSupport.h.

◆ m_sluRscale

template<typename MatrixType_ >
Matrix<RealScalar,Dynamic,1> Eigen::SuperLUBase< MatrixType_, Derived >::m_sluRscale
mutableprotected

Definition at line 459 of file SuperLUSupport.h.

◆ m_sluStat

template<typename MatrixType_ >
SuperLUStat_t Eigen::SuperLUBase< MatrixType_, Derived >::m_sluStat
mutableprotected

Definition at line 456 of file SuperLUSupport.h.

◆ m_sluU

template<typename MatrixType_ >
SuperMatrix Eigen::SuperLUBase< MatrixType_, Derived >::m_sluU
protected

Definition at line 454 of file SuperLUSupport.h.

◆ m_sluX

template<typename MatrixType_ >
SluMatrix Eigen::SuperLUBase< MatrixType_, Derived >::m_sluX
protected

Definition at line 455 of file SuperLUSupport.h.

◆ m_u

template<typename MatrixType_ >
LUMatrixType Eigen::SuperLUBase< MatrixType_, Derived >::m_u
mutableprotected

Definition at line 448 of file SuperLUSupport.h.


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