32 #ifndef EIGEN_PARDISOSUPPORT_H
33 #define EIGEN_PARDISOSUPPORT_H
40 template <
typename MatrixType_>
42 template <
typename MatrixType_,
int Options = Upper>
44 template <
typename MatrixType_,
int Options = Upper>
48 template <
typename IndexType>
50 static IndexType
run(_MKL_DSS_HANDLE_t pt, IndexType maxfct, IndexType mnum, IndexType
type, IndexType phase,
51 IndexType
n,
void*
a, IndexType* ia, IndexType* ja, IndexType* perm, IndexType nrhs,
52 IndexType* iparm, IndexType msglvl,
void*
b,
void*
x) {
54 ::pardiso(pt, &maxfct, &mnum, &
type, &phase, &
n,
a, ia, ja, perm, &nrhs, iparm, &msglvl,
b,
x, &
error);
65 ::pardiso_64(pt, &maxfct, &mnum, &
type, &phase, &
n,
a, ia, ja, perm, &nrhs, iparm, &msglvl,
b,
x, &
error);
70 template <
class Pardiso>
73 template <
typename MatrixType_>
81 template <
typename MatrixType_,
int Options>
89 template <
typename MatrixType_,
int Options>
99 template <
class Derived>
124 "Non-supported index type");
168 template <
typename Rhs,
typename Dest>
176 internal::convert_index<StorageIndex>(
m_size), 0, 0, 0,
195 m_iparm[10] = symmetric ? 0 : 1;
197 m_iparm[12] = symmetric ? 0 : 1;
244 template <
class Derived>
250 m_perm.setZero(m_size);
251 derived().getMatrix(
a);
255 m_pt, 1, 1, m_type, 12, internal::convert_index<StorageIndex>(m_size), m_matrix.valuePtr(),
256 m_matrix.outerIndexPtr(), m_matrix.innerIndexPtr(), m_perm.data(), 0, m_iparm.data(), m_msglvl, NULL, NULL);
257 manageErrorCode(
error);
260 m_isInitialized =
true;
264 template <
class Derived>
270 m_perm.setZero(m_size);
271 derived().getMatrix(
a);
275 m_pt, 1, 1, m_type, 11, internal::convert_index<StorageIndex>(m_size), m_matrix.valuePtr(),
276 m_matrix.outerIndexPtr(), m_matrix.innerIndexPtr(), m_perm.data(), 0, m_iparm.data(), m_msglvl, NULL, NULL);
278 manageErrorCode(
error);
280 m_factorizationIsOk =
false;
281 m_isInitialized =
true;
285 template <
class Derived>
287 eigen_assert(m_analysisIsOk &&
"You must first call analyzePattern()");
290 derived().getMatrix(
a);
294 m_pt, 1, 1, m_type, 22, internal::convert_index<StorageIndex>(m_size), m_matrix.valuePtr(),
295 m_matrix.outerIndexPtr(), m_matrix.innerIndexPtr(), m_perm.data(), 0, m_iparm.data(), m_msglvl, NULL, NULL);
297 manageErrorCode(
error);
302 template <
class Derived>
303 template <
typename BDerived,
typename XDerived>
315 "Row-major right hand sides are not supported");
317 "Row-major matrices of unknowns are not supported");
333 if (rhs_ptr ==
x.derived().data()) {
340 m_pt, 1, 1, m_type, 33, internal::convert_index<StorageIndex>(m_size), m_matrix.valuePtr(),
341 m_matrix.outerIndexPtr(), m_matrix.innerIndexPtr(), m_perm.data(), internal::convert_index<StorageIndex>(nrhs),
342 m_iparm.data(), m_msglvl, rhs_ptr,
x.derived().data());
344 manageErrorCode(
error);
364 template <
typename MatrixType>
412 template <
typename MatrixType,
int UpLo_>
439 m_matrix.template selfadjointView<Upper>() =
matrix.template selfadjointView<UpLo>().twistedBy(p_null);
466 template <
typename MatrixType,
int Options>
492 m_matrix.template selfadjointView<Upper>() =
matrix.template selfadjointView<UpLo>().twistedBy(p_null);
AnnoyingScalar abs(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:135
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
#define eigen_assert(x)
Definition: Macros.h:910
Scalar * b
Definition: benchVecAdd.cpp:17
SCALAR Scalar
Definition: bench_gemm.cpp:45
NumTraits< Scalar >::Real RealScalar
Definition: bench_gemm.cpp:46
MatrixXf MatrixType
Definition: benchmark-blocking-sizes.cpp:52
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:52
Definition: PardisoSupport.h:100
Derived & compute(const MatrixType &matrix)
Definition: PardisoSupport.h:245
StorageIndex m_type
Definition: PardisoSupport.h:237
void * m_pt[64]
Definition: PardisoSupport.h:238
Matrix< StorageIndex, MatrixType::RowsAtCompileTime, 1 > IntColVectorType
Definition: PardisoSupport.h:118
void _solve_impl(const MatrixBase< Rhs > &b, MatrixBase< Dest > &dest) const
@ MaxColsAtCompileTime
Definition: PardisoSupport.h:120
@ ColsAtCompileTime
Definition: PardisoSupport.h:120
@ ScalarIsComplex
Definition: PardisoSupport.h:120
Traits::StorageIndex StorageIndex
Definition: PardisoSupport.h:114
~PardisoImpl()
Definition: PardisoSupport.h:130
Traits::MatrixType MatrixType
Definition: PardisoSupport.h:111
PardisoImpl()
Definition: PardisoSupport.h:122
IntColVectorType m_perm
Definition: PardisoSupport.h:240
ParameterType & pardisoParameterArray()
Definition: PardisoSupport.h:148
SparseMatrixType m_matrix
Definition: PardisoSupport.h:234
Traits::RealScalar RealScalar
Definition: PardisoSupport.h:113
void pardisoInit(int type)
Definition: PardisoSupport.h:182
Index rows() const
Definition: PardisoSupport.h:133
Index cols() const
Definition: PardisoSupport.h:132
Array< StorageIndex, 64, 1, DontAlign > ParameterType
Definition: PardisoSupport.h:119
Matrix< Scalar, Dynamic, 1 > VectorType
Definition: PardisoSupport.h:116
Derived & factorize(const MatrixType &matrix)
Definition: PardisoSupport.h:286
Index m_size
Definition: PardisoSupport.h:241
ComputationInfo info() const
Reports whether previous computation was successful.
Definition: PardisoSupport.h:140
StorageIndex m_msglvl
Definition: PardisoSupport.h:237
internal::pardiso_traits< Derived > Traits
Definition: PardisoSupport.h:106
bool m_factorizationIsOk
Definition: PardisoSupport.h:236
Matrix< StorageIndex, 1, MatrixType::ColsAtCompileTime > IntRowVectorType
Definition: PardisoSupport.h:117
ComputationInfo m_info
Definition: PardisoSupport.h:235
void pardisoRelease()
Definition: PardisoSupport.h:172
SparseMatrix< Scalar, RowMajor, StorageIndex > SparseMatrixType
Definition: PardisoSupport.h:115
bool m_isInitialized
Definition: SparseSolverBase.h:110
void manageErrorCode(Index error) const
Definition: PardisoSupport.h:220
Traits::Scalar Scalar
Definition: PardisoSupport.h:112
SparseSolverBase< Derived > Base
Definition: PardisoSupport.h:102
ParameterType m_iparm
Definition: PardisoSupport.h:239
Derived & analyzePattern(const MatrixType &matrix)
Definition: PardisoSupport.h:265
bool m_analysisIsOk
Definition: PardisoSupport.h:236
A sparse direct Cholesky (LDLT) factorization and solver based on the PARDISO library.
Definition: PardisoSupport.h:467
Base::RealScalar RealScalar
Definition: PardisoSupport.h:476
Base::Scalar Scalar
Definition: PardisoSupport.h:475
PardisoLDLT(const MatrixType &matrix)
Definition: PardisoSupport.h:483
PardisoImpl< PardisoLDLT< MatrixType, Options > > Base
Definition: PardisoSupport.h:469
PardisoLDLT()
Definition: PardisoSupport.h:481
@ UpLo
Definition: PardisoSupport.h:479
void getMatrix(const MatrixType &matrix)
Definition: PardisoSupport.h:488
Base::StorageIndex StorageIndex
Definition: PardisoSupport.h:477
A sparse direct Cholesky (LLT) factorization and solver based on the PARDISO library.
Definition: PardisoSupport.h:413
PardisoImpl< PardisoLLT< MatrixType, UpLo_ > > Base
Definition: PardisoSupport.h:415
Base::StorageIndex StorageIndex
Definition: PardisoSupport.h:423
void getMatrix(const MatrixType &matrix)
Definition: PardisoSupport.h:435
Base::Scalar Scalar
Definition: PardisoSupport.h:421
PardisoLLT(const MatrixType &matrix)
Definition: PardisoSupport.h:429
PardisoLLT()
Definition: PardisoSupport.h:427
Base::RealScalar RealScalar
Definition: PardisoSupport.h:422
@ UpLo
Definition: PardisoSupport.h:424
A sparse direct LU factorization and solver based on the PARDISO library.
Definition: PardisoSupport.h:365
Derived & compute(const MatrixType &matrix)
Definition: PardisoSupport.h:245
SparseMatrixType m_matrix
Definition: PardisoSupport.h:234
void pardisoInit(int type)
Definition: PardisoSupport.h:182
Base::RealScalar RealScalar
Definition: PardisoSupport.h:374
PardisoImpl< PardisoLU > Base
Definition: PardisoSupport.h:367
PardisoLU()
Definition: PardisoSupport.h:379
Base::Scalar Scalar
Definition: PardisoSupport.h:373
PardisoLU(const MatrixType &matrix)
Definition: PardisoSupport.h:381
void getMatrix(const MatrixType &matrix)
Definition: PardisoSupport.h:387
constexpr EIGEN_DEVICE_FUNC const Scalar * data() const
Definition: PlainObjectBase.h:273
EIGEN_DEVICE_FUNC Derived & setZero(Index size)
Definition: CwiseNullaryOp.h:569
void makeCompressed()
Definition: SparseMatrix.h:589
void resize(Index rows, Index cols)
Definition: SparseMatrix.h:734
A base class for sparse solvers.
Definition: SparseSolverBase.h:67
const Solve< Derived, Rhs > solve(const MatrixBase< Rhs > &b) const
Definition: SparseSolverBase.h:84
void _solve_impl(const SparseMatrixBase< Rhs > &b, SparseMatrixBase< Dest > &dest) const
Definition: SparseSolverBase.h:104
bool m_isInitialized
Definition: SparseSolverBase.h:110
Derived & derived()
Definition: SparseSolverBase.h:76
Eigen::Map< Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor >, 0, Eigen::OuterStride<> > matrix(T *data, int rows, int cols, int stride)
Definition: common.h:85
ComputationInfo
Definition: Constants.h:438
@ Symmetric
Definition: Constants.h:229
@ Lower
Definition: Constants.h:211
@ Upper
Definition: Constants.h:213
@ NumericalIssue
Definition: Constants.h:442
@ InvalidInput
Definition: Constants.h:447
@ Success
Definition: Constants.h:440
const unsigned int RowMajorBit
Definition: Constants.h:70
const Scalar * a
Definition: level2_cplx_impl.h:32
Eigen::Matrix< Scalar, Dynamic, Dynamic, ColMajor > tmp
Definition: level3_impl.h:365
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:70
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:83
const int Dynamic
Definition: Constants.h:25
int error
Definition: calibrate.py:297
type
Definition: compute_granudrum_aor.py:141
Definition: Eigen_Colamd.h:49
list x
Definition: plotDoE.py:28
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Definition: NumTraits.h:217
long long int IndexType
Definition: PardisoSupport.h:60
static IndexType run(_MKL_DSS_HANDLE_t pt, IndexType maxfct, IndexType mnum, IndexType type, IndexType phase, IndexType n, void *a, IndexType *ia, IndexType *ja, IndexType *perm, IndexType nrhs, IndexType *iparm, IndexType msglvl, void *b, void *x)
Definition: PardisoSupport.h:61
Definition: PardisoSupport.h:49
static IndexType run(_MKL_DSS_HANDLE_t pt, IndexType maxfct, IndexType mnum, IndexType type, IndexType phase, IndexType n, void *a, IndexType *ia, IndexType *ja, IndexType *perm, IndexType nrhs, IndexType *iparm, IndexType msglvl, void *b, void *x)
Definition: PardisoSupport.h:50
MatrixType_::RealScalar RealScalar
Definition: PardisoSupport.h:93
MatrixType_::Scalar Scalar
Definition: PardisoSupport.h:92
MatrixType_::StorageIndex StorageIndex
Definition: PardisoSupport.h:94
MatrixType_ MatrixType
Definition: PardisoSupport.h:91
MatrixType_::RealScalar RealScalar
Definition: PardisoSupport.h:85
MatrixType_::Scalar Scalar
Definition: PardisoSupport.h:84
MatrixType_ MatrixType
Definition: PardisoSupport.h:83
MatrixType_::StorageIndex StorageIndex
Definition: PardisoSupport.h:86
MatrixType_::Scalar Scalar
Definition: PardisoSupport.h:76
MatrixType_::StorageIndex StorageIndex
Definition: PardisoSupport.h:78
MatrixType_ MatrixType
Definition: PardisoSupport.h:75
MatrixType_::RealScalar RealScalar
Definition: PardisoSupport.h:77
Definition: PardisoSupport.h:71