10 #ifndef EIGEN_KLUSUPPORT_H
11 #define EIGEN_KLUSUPPORT_H
37 klu_common *Common,
double) {
38 return klu_solve(Symbolic, Numeric, internal::convert_index<int>(ldim), internal::convert_index<int>(nrhs),
B,
42 inline int klu_solve(klu_symbolic *Symbolic, klu_numeric *Numeric,
Index ldim,
Index nrhs, std::complex<double>
B[],
43 klu_common *Common, std::complex<double>) {
44 return klu_z_solve(Symbolic, Numeric, internal::convert_index<int>(ldim), internal::convert_index<int>(nrhs),
49 klu_common *Common,
double) {
50 return klu_tsolve(Symbolic, Numeric, internal::convert_index<int>(ldim), internal::convert_index<int>(nrhs),
B,
54 inline int klu_tsolve(klu_symbolic *Symbolic, klu_numeric *Numeric,
Index ldim,
Index nrhs, std::complex<double>
B[],
55 klu_common *Common, std::complex<double>) {
56 return klu_z_tsolve(Symbolic, Numeric, internal::convert_index<int>(ldim), internal::convert_index<int>(nrhs),
60 inline klu_numeric *
klu_factor(
int Ap[],
int Ai[],
double Ax[], klu_symbolic *Symbolic, klu_common *Common,
double) {
61 return klu_factor(Ap, Ai, Ax, Symbolic, Common);
64 inline klu_numeric *
klu_factor(
int Ap[],
int Ai[], std::complex<double> Ax[], klu_symbolic *Symbolic,
65 klu_common *Common, std::complex<double>) {
69 template <
typename MatrixType_>
92 template <
typename InputMatrixType>
144 template <
typename InputMatrixType>
159 template <
typename InputMatrixType>
189 template <
typename InputMatrixType>
200 template <
typename BDerived,
typename XDerived>
206 void extractData()
const;
245 template <
typename MatrixDerived>
282 template<
typename MatrixType>
283 void KLU<MatrixType>::extractData()
const
285 if (m_extractedDataAreDirty)
287 eigen_assert(
false &&
"KLU: extractData Not Yet Implemented");
295 m_l.resizeNonZeros(lnz);
298 m_u.resizeNonZeros(unz);
305 m_u.outerIndexPtr(), m_u.innerIndexPtr(), m_u.valuePtr(),
306 m_p.data(), m_q.data(), 0, 0, 0, m_numeric);
308 m_extractedDataAreDirty =
false;
312 template<
typename MatrixType>
315 eigen_assert(
false &&
"KLU: extractData Not Yet Implemented");
320 template <
typename MatrixType>
321 template <
typename BDerived,
typename XDerived>
326 "The decomposition is not in a valid state for solving, you must first call either compute() or "
327 "analyzePattern()/factorize()");
330 int info =
klu_solve(m_symbolic, m_numeric,
b.rows(), rhsCols,
x.const_cast_derived().data(),
331 const_cast<klu_common *
>(&m_common),
Scalar());
#define EIGEN_NOEXCEPT
Definition: Macros.h:1267
#define EIGEN_CONSTEXPR
Definition: Macros.h:758
#define eigen_assert(x)
Definition: Macros.h:910
#define EIGEN_STATIC_ASSERT(X, MSG)
Definition: StaticAssert.h:26
int rows
Definition: Tutorial_commainit_02.cpp:1
int cols
Definition: Tutorial_commainit_02.cpp:1
Scalar * b
Definition: benchVecAdd.cpp:17
SCALAR Scalar
Definition: bench_gemm.cpp:45
NumTraits< Scalar >::Real RealScalar
Definition: bench_gemm.cpp:46
Definition: KLUSupport.h:70
MatrixType_ MatrixType
Definition: KLUSupport.h:77
klu_symbolic * m_symbolic
Definition: KLUSupport.h:270
EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
Definition: KLUSupport.h:103
const klu_common & kluCommon() const
Definition: KLUSupport.h:173
void compute(const InputMatrixType &matrix)
Definition: KLUSupport.h:145
KLUMatrixRef mp_matrix
Definition: KLUSupport.h:267
void factorize(const InputMatrixType &matrix)
Definition: KLUSupport.h:190
void factorize_impl()
Definition: KLUSupport.h:235
int m_analysisIsOk
Definition: KLUSupport.h:274
SparseSolverBase< KLU< MatrixType_ > > Base
Definition: KLUSupport.h:72
~KLU()
Definition: KLUSupport.h:98
void grab(const EigenBase< MatrixDerived > &A)
Definition: KLUSupport.h:246
Ref< const KLUMatrixType, StandardCompressedFormat > KLUMatrixRef
Definition: KLUSupport.h:86
KLU()
Definition: KLUSupport.h:90
KLU(const KLU &)
Definition: KLUSupport.h:278
EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
Definition: KLUSupport.h:104
klu_numeric * m_numeric
Definition: KLUSupport.h:269
MatrixType::StorageIndex StorageIndex
Definition: KLUSupport.h:80
ComputationInfo info() const
Reports whether previous computation was successful.
Definition: KLUSupport.h:111
KLUMatrixType m_dummy
Definition: KLUSupport.h:266
KLU(const InputMatrixType &matrix)
Definition: KLUSupport.h:93
Matrix< Scalar, Dynamic, 1 > Vector
Definition: KLUSupport.h:81
bool _solve_impl(const MatrixBase< BDerived > &b, MatrixBase< XDerived > &x) const
Definition: KLUSupport.h:322
SparseMatrix< Scalar, ColMajor, int > KLUMatrixType
Definition: KLUSupport.h:85
MatrixType::RealScalar RealScalar
Definition: KLUSupport.h:79
@ ColsAtCompileTime
Definition: KLUSupport.h:87
@ MaxColsAtCompileTime
Definition: KLUSupport.h:87
bool m_extractedDataAreDirty
Definition: KLUSupport.h:275
void analyzePattern_impl()
Definition: KLUSupport.h:220
int m_factorizationIsOk
Definition: KLUSupport.h:273
Matrix< int, 1, MatrixType::ColsAtCompileTime > IntRowVectorType
Definition: KLUSupport.h:82
ComputationInfo m_info
Definition: KLUSupport.h:272
klu_common m_common
Definition: KLUSupport.h:271
klu_common & kluCommon()
Definition: KLUSupport.h:181
Matrix< int, MatrixType::RowsAtCompileTime, 1 > IntColVectorType
Definition: KLUSupport.h:83
MatrixType::Scalar Scalar
Definition: KLUSupport.h:78
SparseMatrix< Scalar > LUMatrixType
Definition: KLUSupport.h:84
void grab(const KLUMatrixRef &A)
Definition: KLUSupport.h:251
void init()
Definition: KLUSupport.h:210
void analyzePattern(const InputMatrixType &matrix)
Definition: KLUSupport.h:160
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:52
A base class for sparse solvers.
Definition: SparseSolverBase.h:67
void _solve_impl(const SparseMatrixBase< Rhs > &b, SparseMatrixBase< Dest > &dest) const
Definition: SparseSolverBase.h:104
bool m_isInitialized
Definition: SparseSolverBase.h:110
Definition: matrices.h:74
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
#define min(a, b)
Definition: datatypes.h:22
void determinant(const MatrixType &m)
Definition: determinant.cpp:15
ComputationInfo
Definition: Constants.h:438
@ NumericalIssue
Definition: Constants.h:442
@ InvalidInput
Definition: Constants.h:447
@ Success
Definition: Constants.h:440
const unsigned int RowMajorBit
Definition: Constants.h:70
int info
Definition: level2_cplx_impl.h:39
EIGEN_DEVICE_FUNC T * construct_at(T *p, Args &&... args)
Definition: Memory.h:1321
EIGEN_DEVICE_FUNC void destroy_at(T *p)
Definition: Memory.h:1335
EIGEN_DEVICE_FUNC internal::add_const_on_value_type_t< EIGEN_MATHFUNC_RETVAL(real_ref, Scalar)> real_ref(const Scalar &x)
Definition: MathFunctions.h:1051
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:70
int umfpack_get_numeric(int Lp[], int Lj[], double Lx[], int Up[], int Ui[], double Ux[], int P[], int Q[], double Dx[], int *do_recip, double Rs[], void *Numeric)
Definition: UmfPackSupport.h:232
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:83
klu_numeric * klu_factor(int Ap[], int Ai[], double Ax[], klu_symbolic *Symbolic, klu_common *Common, double)
Definition: KLUSupport.h:60
int klu_solve(klu_symbolic *Symbolic, klu_numeric *Numeric, Index ldim, Index nrhs, double B[], klu_common *Common, double)
A sparse LU factorization and solver based on KLU.
Definition: KLUSupport.h:36
int klu_tsolve(klu_symbolic *Symbolic, klu_numeric *Numeric, Index ldim, Index nrhs, double B[], klu_common *Common, double)
Definition: KLUSupport.h:48
int umfpack_get_lunz(int *lnz, int *unz, int *n_row, int *n_col, int *nz_udiag, void *Numeric, double)
Definition: UmfPackSupport.h:211
list x
Definition: plotDoE.py:28
Definition: EigenBase.h:33