Shapeworks Studio  2.1
Shape analysis software suite
List of all members | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
Eigen::PardisoImpl< Derived > Class Template Reference
+ Inheritance diagram for Eigen::PardisoImpl< Derived >:
+ Collaboration diagram for Eigen::PardisoImpl< Derived >:

Public Types

enum  { ScalarIsComplex = NumTraits<Scalar>::IsComplex }
 
typedef Traits::MatrixType MatrixType
 
typedef Traits::Scalar Scalar
 
typedef Traits::RealScalar RealScalar
 
typedef Traits::Index Index
 
typedef SparseMatrix< Scalar, RowMajor, Index > SparseMatrixType
 
typedef Matrix< Scalar, Dynamic, 1 > VectorType
 
typedef Matrix< Index, 1, MatrixType::ColsAtCompileTime > IntRowVectorType
 
typedef Matrix< Index, MatrixType::RowsAtCompileTime, 1 > IntColVectorType
 
typedef Array< Index, 64, 1, DontAlign > ParameterType
 

Public Member Functions

Index cols () const
 
Index rows () const
 
ComputationInfo info () const
 Reports whether previous computation was successful. More...
 
ParameterTypepardisoParameterArray ()
 
Derived & analyzePattern (const MatrixType &matrix)
 
Derived & factorize (const MatrixType &matrix)
 
Derived & compute (const MatrixType &matrix)
 
template<typename Rhs >
const internal::solve_retval< PardisoImpl, Rhs > solve (const MatrixBase< Rhs > &b) const
 
template<typename Rhs >
const internal::sparse_solve_retval< PardisoImpl, Rhs > solve (const SparseMatrixBase< Rhs > &b) const
 
Derived & derived ()
 
const Derived & derived () const
 
template<typename BDerived , typename XDerived >
bool _solve (const MatrixBase< BDerived > &b, MatrixBase< XDerived > &x) const
 

Protected Member Functions

void pardisoRelease ()
 
void pardisoInit (int type)
 
void manageErrorCode (Index error)
 

Protected Attributes

SparseMatrixType m_matrix
 
ComputationInfo m_info
 
bool m_initialized
 
bool m_analysisIsOk
 
bool m_factorizationIsOk
 
Index m_type
 
Index m_msglvl
 
void * m_pt [64]
 
ParameterType m_iparm
 
IntColVectorType m_perm
 
Index m_size
 

Detailed Description

template<class Derived>
class Eigen::PardisoImpl< Derived >

Definition at line 99 of file PardisoSupport.h.

Member Function Documentation

template<class Derived >
Derived & Eigen::PardisoImpl< Derived >::analyzePattern ( const MatrixType &  matrix)

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 308 of file PardisoSupport.h.

309 {
310  m_size = a.rows();
311  eigen_assert(m_size == a.cols());
312 
313  pardisoRelease();
314  memset(m_pt, 0, sizeof(m_pt));
315  m_perm.setZero(m_size);
316  derived().getMatrix(a);
317 
318  Index error;
319  error = internal::pardiso_run_selector<Index>::run(m_pt, 1, 1, m_type, 11, m_size,
320  m_matrix.valuePtr(), m_matrix.outerIndexPtr(), m_matrix.innerIndexPtr(),
321  m_perm.data(), 0, m_iparm.data(), m_msglvl, NULL, NULL);
322 
323  manageErrorCode(error);
324  m_analysisIsOk = true;
325  m_factorizationIsOk = false;
326  m_initialized = true;
327  return derived();
328 }
const Index * innerIndexPtr() const
Definition: SparseMatrix.h:140
EIGEN_STRONG_INLINE const Scalar * data() const
Derived & setZero(Index size)
const Index * outerIndexPtr() const
Definition: SparseMatrix.h:149
const Scalar * valuePtr() const
Definition: SparseMatrix.h:131
template<class Derived >
Derived & Eigen::PardisoImpl< Derived >::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 331 of file PardisoSupport.h.

332 {
333  eigen_assert(m_analysisIsOk && "You must first call analyzePattern()");
334  eigen_assert(m_size == a.rows() && m_size == a.cols());
335 
336  derived().getMatrix(a);
337 
338  Index error;
339  error = internal::pardiso_run_selector<Index>::run(m_pt, 1, 1, m_type, 22, m_size,
340  m_matrix.valuePtr(), m_matrix.outerIndexPtr(), m_matrix.innerIndexPtr(),
341  m_perm.data(), 0, m_iparm.data(), m_msglvl, NULL, NULL);
342 
343  manageErrorCode(error);
344  m_factorizationIsOk = true;
345  return derived();
346 }
const Index * innerIndexPtr() const
Definition: SparseMatrix.h:140
EIGEN_STRONG_INLINE const Scalar * data() const
const Index * outerIndexPtr() const
Definition: SparseMatrix.h:149
const Scalar * valuePtr() const
Definition: SparseMatrix.h:131
template<class Derived>
ComputationInfo Eigen::PardisoImpl< 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 137 of file PardisoSupport.h.

138  {
139  eigen_assert(m_initialized && "Decomposition is not initialized.");
140  return m_info;
141  }
template<class Derived>
ParameterType& Eigen::PardisoImpl< Derived >::pardisoParameterArray ( )
inline
Warning
for advanced usage only.
Returns
a reference to the parameter array controlling PARDISO. See the PARDISO manual to know how to use it.

Definition at line 146 of file PardisoSupport.h.

147  {
148  return m_iparm;
149  }
template<class Derived>
template<typename Rhs >
const internal::solve_retval<PardisoImpl, Rhs> Eigen::PardisoImpl< 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 175 of file PardisoSupport.h.

176  {
177  eigen_assert(m_initialized && "Pardiso solver is not initialized.");
178  eigen_assert(rows()==b.rows()
179  && "PardisoImpl::solve(): invalid number of rows of the right hand side matrix b");
180  return internal::solve_retval<PardisoImpl, Rhs>(*this, b.derived());
181  }
template<class Derived>
template<typename Rhs >
const internal::sparse_solve_retval<PardisoImpl, Rhs> Eigen::PardisoImpl< 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 189 of file PardisoSupport.h.

190  {
191  eigen_assert(m_initialized && "Pardiso solver is not initialized.");
192  eigen_assert(rows()==b.rows()
193  && "PardisoImpl::solve(): invalid number of rows of the right hand side matrix b");
194  return internal::sparse_solve_retval<PardisoImpl, Rhs>(*this, b.derived());
195  }

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