mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
added functions to fetch L and U Factors from IncompleteLUT
This commit is contained in:
committed by
Rasmus Munk Larsen
parent
b6849f675d
commit
2926b2e0a9
@@ -129,6 +129,12 @@ class IncompleteLUT : public SparseSolverBase<IncompleteLUT<Scalar_, StorageInde
|
||||
compute(mat);
|
||||
}
|
||||
|
||||
/** \brief Extraction Method for L-Factor */
|
||||
const FactorType matrixL() const;
|
||||
|
||||
/** \brief Extraction Method for U-Factor */
|
||||
const FactorType matrixU() const;
|
||||
|
||||
EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT { return m_lu.rows(); }
|
||||
|
||||
EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT { return m_lu.cols(); }
|
||||
@@ -207,6 +213,28 @@ void IncompleteLUT<Scalar, StorageIndex>::setFillfactor(int fillfactor) {
|
||||
this->m_fillfactor = fillfactor;
|
||||
}
|
||||
|
||||
/**
|
||||
* get L-Factor
|
||||
* \return L-Factor is a matrix containing the lower triangular part of the sparse matrix. All elements of the matrix
|
||||
* above the main diagonal are zero.
|
||||
**/
|
||||
template <typename Scalar, typename StorageIndex>
|
||||
const typename IncompleteLUT<Scalar, StorageIndex>::FactorType IncompleteLUT<Scalar, StorageIndex>::matrixL() const {
|
||||
eigen_assert(m_factorizationIsOk && "factorize() should be called first");
|
||||
return m_lu.template triangularView<UnitLower>();
|
||||
}
|
||||
|
||||
/**
|
||||
* get U-Factor
|
||||
* \return L-Factor is a matrix containing the upper triangular part of the sparse matrix. All elements of the matrix
|
||||
* below the main diagonal are zero.
|
||||
**/
|
||||
template <typename Scalar, typename StorageIndex>
|
||||
const typename IncompleteLUT<Scalar, StorageIndex>::FactorType IncompleteLUT<Scalar, StorageIndex>::matrixU() const {
|
||||
eigen_assert(m_factorizationIsOk && "Factorization must be computed first.");
|
||||
return m_lu.template triangularView<Upper>();
|
||||
}
|
||||
|
||||
template <typename Scalar, typename StorageIndex>
|
||||
template <typename MatrixType_>
|
||||
void IncompleteLUT<Scalar, StorageIndex>::analyzePattern(const MatrixType_& amat) {
|
||||
@@ -418,4 +446,4 @@ void IncompleteLUT<Scalar, StorageIndex>::factorize(const MatrixType_& amat) {
|
||||
|
||||
} // end namespace Eigen
|
||||
|
||||
#endif // EIGEN_INCOMPLETE_LUT_H
|
||||
#endif // EIGEN_INCOMPLETE_LUT_H
|
||||
Reference in New Issue
Block a user