Eigen::PardisoLU< MatrixType > Class Template Reference

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

+ Inheritance diagram for Eigen::PardisoLU< MatrixType >:

Public Types

typedef Base::RealScalar RealScalar
 
typedef Base::Scalar Scalar
 
- Public Types inherited from Eigen::PardisoImpl< PardisoLU< MatrixType > >
enum  
 
typedef Matrix< StorageIndex, MatrixType::RowsAtCompileTime, 1 > IntColVectorType
 
typedef Matrix< StorageIndex, 1, MatrixType::ColsAtCompileTime > IntRowVectorType
 
typedef Traits::MatrixType MatrixType
 
typedef Array< StorageIndex, 64, 1, DontAlign > ParameterType
 
typedef Traits::RealScalar RealScalar
 
typedef Traits::Scalar Scalar
 
typedef SparseMatrix< Scalar, RowMajor, StorageIndexSparseMatrixType
 
typedef Traits::StorageIndex StorageIndex
 
typedef Matrix< Scalar, Dynamic, 1 > VectorType
 

Public Member Functions

Derived & compute (const MatrixType &matrix)
 
 PardisoLU ()
 
 PardisoLU (const MatrixType &matrix)
 
- Public Member Functions inherited from Eigen::PardisoImpl< PardisoLU< MatrixType > >
void _solve_impl (const MatrixBase< BDerived > &b, MatrixBase< XDerived > &x) const
 
void _solve_impl (const MatrixBase< Rhs > &b, MatrixBase< Dest > &dest) const
 
PardisoLU< MatrixType > & analyzePattern (const MatrixType &matrix)
 
Index cols () const
 
PardisoLU< MatrixType > & compute (const MatrixType &matrix)
 
PardisoLU< MatrixType > & factorize (const MatrixType &matrix)
 
ComputationInfo info () const
 Reports whether previous computation was successful. More...
 
 PardisoImpl ()
 
ParameterTypepardisoParameterArray ()
 
Index rows () const
 
 ~PardisoImpl ()
 
- 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 Types

typedef PardisoImpl< PardisoLUBase
 
- Protected Types inherited from Eigen::PardisoImpl< PardisoLU< MatrixType > >
typedef SparseSolverBase< PardisoLU< MatrixType > > Base
 
typedef internal::pardiso_traits< PardisoLU< MatrixType > > Traits
 

Protected Member Functions

void getMatrix (const MatrixType &matrix)
 
void pardisoInit (int type)
 
- Protected Member Functions inherited from Eigen::PardisoImpl< PardisoLU< MatrixType > >
PardisoLU< MatrixType > & derived ()
 
const PardisoLU< MatrixType > & derived () const
 
void manageErrorCode (Index error) const
 
void pardisoInit (int type)
 
void pardisoRelease ()
 

Protected Attributes

SparseMatrixType m_matrix
 
- Protected Attributes inherited from Eigen::PardisoImpl< PardisoLU< MatrixType > >
bool m_analysisIsOk
 
bool m_factorizationIsOk
 
ComputationInfo m_info
 
ParameterType m_iparm
 
bool m_isInitialized
 
SparseMatrixType m_matrix
 
StorageIndex m_msglvl
 
IntColVectorType m_perm
 
void * m_pt [64]
 
Index m_size
 
StorageIndex m_type
 
- Protected Attributes inherited from Eigen::SparseSolverBase< Derived >
bool m_isInitialized
 

Detailed Description

template<typename MatrixType>
class Eigen::PardisoLU< MatrixType >

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

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

By default, it runs in in-core mode. To enable PARDISO's out-of-core feature, set:

solver.pardisoParameterArray()[59] = 1;
BiCGSTAB< SparseMatrix< double > > solver
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 SparseLU

Definition at line 387 of file PardisoSupport.h.

Member Typedef Documentation

◆ Base

template<typename MatrixType >
typedef PardisoImpl<PardisoLU> Eigen::PardisoLU< MatrixType >::Base
protected

Definition at line 390 of file PardisoSupport.h.

◆ RealScalar

template<typename MatrixType >
typedef Base::RealScalar Eigen::PardisoLU< MatrixType >::RealScalar

Definition at line 398 of file PardisoSupport.h.

◆ Scalar

template<typename MatrixType >
typedef Base::Scalar Eigen::PardisoLU< MatrixType >::Scalar

Definition at line 397 of file PardisoSupport.h.

Constructor & Destructor Documentation

◆ PardisoLU() [1/2]

template<typename MatrixType >
Eigen::PardisoLU< MatrixType >::PardisoLU ( )
inline

Definition at line 403 of file PardisoSupport.h.

404  : Base()
405  {
407  }
void pardisoInit(int type)
PardisoImpl< PardisoLU > Base

◆ PardisoLU() [2/2]

template<typename MatrixType >
Eigen::PardisoLU< MatrixType >::PardisoLU ( const MatrixType matrix)
inlineexplicit

Definition at line 409 of file PardisoSupport.h.

410  : Base()
411  {
413  compute(matrix);
414  }
Derived & compute(const MatrixType &matrix)

Member Function Documentation

◆ compute()

template<typename MatrixType >
Derived & Eigen::PardisoImpl< Derived >::compute

Definition at line 179 of file PardisoSupport.h.

263 {
264  m_size = a.rows();
265  eigen_assert(a.rows() == a.cols());
266 
267  pardisoRelease();
269  derived().getMatrix(a);
270 
271  Index error;
272  error = internal::pardiso_run_selector<StorageIndex>::run(m_pt, 1, 1, m_type, 12, internal::convert_index<StorageIndex>(m_size),
274  m_perm.data(), 0, m_iparm.data(), m_msglvl, NULL, NULL);
275  manageErrorCode(error);
276  m_analysisIsOk = true;
277  m_factorizationIsOk = true;
278  m_isInitialized = true;
279  return derived();
280 }
#define eigen_assert(x)
Definition: Macros.h:902
SparseMatrixType m_matrix
const Scalar * data() const
Derived & setZero(Index size)
const Scalar * valuePtr() const
Definition: SparseMatrix.h:177
const StorageIndex * outerIndexPtr() const
Definition: SparseMatrix.h:195
const StorageIndex * innerIndexPtr() const
Definition: SparseMatrix.h:186
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:82

◆ getMatrix()

template<typename MatrixType >
void Eigen::PardisoLU< MatrixType >::getMatrix ( const MatrixType matrix)
inlineprotected

Definition at line 416 of file PardisoSupport.h.

417  {
418  m_matrix = matrix;
420  }

◆ pardisoInit()

template<typename MatrixType >
void Eigen::PardisoImpl< Derived >::pardisoInit
inlineprotected

Definition at line 195 of file PardisoSupport.h.

196  {
197  m_type = type;
198  bool symmetric = std::abs(m_type) < 10;
199  m_iparm[0] = 1; // No solver default
200  m_iparm[1] = 2; // use Metis for the ordering
201  m_iparm[2] = 0; // Reserved. Set to zero. (??Numbers of processors, value of OMP_NUM_THREADS??)
202  m_iparm[3] = 0; // No iterative-direct algorithm
203  m_iparm[4] = 0; // No user fill-in reducing permutation
204  m_iparm[5] = 0; // Write solution into x, b is left unchanged
205  m_iparm[6] = 0; // Not in use
206  m_iparm[7] = 2; // Max numbers of iterative refinement steps
207  m_iparm[8] = 0; // Not in use
208  m_iparm[9] = 13; // Perturb the pivot elements with 1E-13
209  m_iparm[10] = symmetric ? 0 : 1; // Use nonsymmetric permutation and scaling MPS
210  m_iparm[11] = 0; // Not in use
211  m_iparm[12] = symmetric ? 0 : 1; // Maximum weighted matching algorithm is switched-off (default for symmetric).
212  // Try m_iparm[12] = 1 in case of inappropriate accuracy
213  m_iparm[13] = 0; // Output: Number of perturbed pivots
214  m_iparm[14] = 0; // Not in use
215  m_iparm[15] = 0; // Not in use
216  m_iparm[16] = 0; // Not in use
217  m_iparm[17] = -1; // Output: Number of nonzeros in the factor LU
218  m_iparm[18] = -1; // Output: Mflops for LU factorization
219  m_iparm[19] = 0; // Output: Numbers of CG Iterations
220 
221  m_iparm[20] = 0; // 1x1 pivoting
222  m_iparm[26] = 0; // No matrix checker
223  m_iparm[27] = (sizeof(RealScalar) == 4) ? 1 : 0;
224  m_iparm[34] = 1; // C indexing
225  m_iparm[36] = 0; // CSR
226  m_iparm[59] = 0; // 0 - In-Core ; 1 - Automatic switch between In-Core and Out-of-Core modes ; 2 - Out-of-Core
227 
228  memset(m_pt, 0, sizeof(m_pt));
229  }
const AbsReturnType abs() const
Base::RealScalar RealScalar

Member Data Documentation

◆ m_matrix

template<typename MatrixType >
SparseMatrixType Eigen::PardisoImpl< Derived >::m_matrix
mutableprotected

Definition at line 250 of file PardisoSupport.h.


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