11#ifndef EIGEN_SIMPLICIAL_CHOLESKY_H
12#define EIGEN_SIMPLICIAL_CHOLESKY_H
15#include "./InternalHeaderCheck.h"
19enum SimplicialCholeskyMode { SimplicialCholeskyLLT, SimplicialCholeskyLDLT };
22template <
typename CholMatrixType,
typename InputMatrixType>
23struct simplicial_cholesky_grab_input {
24 using ConstCholMatrixPtr =
const CholMatrixType*;
25 static void run(
const InputMatrixType& input, ConstCholMatrixPtr& pmat, CholMatrixType& tmp) {
31template <
typename MatrixType>
32struct simplicial_cholesky_grab_input<MatrixType, MatrixType> {
33 using ConstMatrixPtr =
const MatrixType*;
34 static void run(
const MatrixType& input, ConstMatrixPtr& pmat, MatrixType& ) { pmat = &input; }
43template <
bool UseAMDFastPath>
44struct simplicial_cholesky_amd_dispatch {
45 template <
int UpLo_,
bool NonHermitian,
typename Ordering,
typename MatrixType,
typename CholMatrixType,
47 static void run(
const MatrixType& a, CholMatrixType& C, Perm& perm) {
48 permute_symm_to_fullsymm<UpLo_, NonHermitian>(a, C,
nullptr);
55struct simplicial_cholesky_amd_dispatch<true> {
56 template <
int UpLo_,
bool ,
typename Ordering,
typename MatrixType,
typename CholMatrixType,
58 static void run(
const MatrixType& a, CholMatrixType& , Perm& perm) {
64 ordering(a.template selfadjointView<UpLo_>(), perm);
82template <
typename Derived>
85 using Base::m_isInitialized;
88 using MatrixType =
typename internal::traits<Derived>::MatrixType;
89 using OrderingType =
typename internal::traits<Derived>::OrderingType;
90 enum { UpLo = internal::traits<Derived>::UpLo };
91 using Scalar =
typename MatrixType::Scalar;
92 using RealScalar =
typename MatrixType::RealScalar;
93 using DiagonalScalar =
typename internal::traits<Derived>::DiagonalScalar;
94 using StorageIndex =
typename MatrixType::StorageIndex;
96 using ConstCholMatrixPtr =
const CholMatrixType*;
100 enum { ColsAtCompileTime = MatrixType::ColsAtCompileTime, MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime };
107 : m_info(
Success), m_factorizationIsOk(false), m_analysisIsOk(false), m_shiftOffset(0), m_shiftScale(1) {}
110 : m_info(
Success), m_factorizationIsOk(false), m_analysisIsOk(false), m_shiftOffset(0), m_shiftScale(1) {
111 derived().compute(matrix);
114 Derived& derived() {
return *
static_cast<Derived*
>(
this); }
115 const Derived& derived()
const {
return *
static_cast<const Derived*
>(
this); }
117 inline Index cols()
const {
return m_matrix.cols(); }
118 inline Index rows()
const {
return m_matrix.rows(); }
126 eigen_assert(m_isInitialized &&
"Decomposition is not initialized.");
148 Derived&
setShift(
const DiagonalScalar& offset,
const DiagonalScalar& scale = 1) {
149 m_shiftOffset = offset;
150 m_shiftScale = scale;
154#ifndef EIGEN_PARSED_BY_DOXYGEN
156 template <
typename Stream>
157 void dumpMemory(Stream& s) {
160 << ((total += (m_matrix.
cols() + 1) *
sizeof(
int) + m_matrix.
nonZeros() * (
sizeof(
int) +
sizeof(Scalar))) >> 20)
163 s <<
" diag: " << ((total += m_diag.size() *
sizeof(Scalar)) >> 20) <<
"Mb"
165 s <<
" tree: " << ((total += m_parent.size() *
sizeof(
int)) >> 20) <<
"Mb"
167 s <<
" nonzeros: " << ((total += m_workSpace.size() *
sizeof(
int)) >> 20) <<
"Mb"
169 s <<
" perm: " << ((total += m_P.
size() *
sizeof(
int)) >> 20) <<
"Mb"
171 s <<
" perm^-1: " << ((total += m_Pinv.
size() *
sizeof(
int)) >> 20) <<
"Mb"
173 s <<
" TOTAL: " << (total >> 20) <<
"Mb"
178 template <
typename Rhs,
typename Dest>
179 void _solve_impl(
const MatrixBase<Rhs>& b, MatrixBase<Dest>& dest)
const {
180 eigen_assert(m_factorizationIsOk &&
181 "The decomposition is not in a valid state for solving, you must first call either compute() or "
182 "symbolic()/numeric()");
183 eigen_assert(m_matrix.
rows() == b.rows());
193 derived().matrixL().solveInPlace(dest);
195 if (m_diag.size() > 0) dest = m_diag.asDiagonal().inverse() * dest;
198 derived().matrixU().solveInPlace(dest);
200 if (m_P.
size() > 0) dest = m_Pinv * dest;
203 template <
typename Rhs,
typename Dest>
204 void _solve_impl(
const SparseMatrixBase<Rhs>& b, SparseMatrixBase<Dest>& dest)
const {
205 internal::solve_sparse_through_dense_panels(derived(), b, dest);
212 template <
bool DoLDLT,
bool NonHermitian>
214 eigen_assert(matrix.rows() == matrix.cols());
215 Index size = matrix.cols();
216 CholMatrixType tmp(size, size);
217 ConstCholMatrixPtr pmat;
218 ordering<NonHermitian>(matrix, pmat, tmp);
219 analyzePattern_preordered(*pmat, DoLDLT);
220 factorize_preordered<DoLDLT, NonHermitian>(*pmat);
223 template <
bool DoLDLT,
bool NonHermitian>
224 void factorize(
const MatrixType& a) {
225 eigen_assert(a.rows() == a.cols());
226 Index size = a.cols();
227 CholMatrixType tmp(size, size);
228 ConstCholMatrixPtr pmat;
232 internal::simplicial_cholesky_grab_input<CholMatrixType, MatrixType>::run(a, pmat, tmp);
234 internal::permute_symm_to_symm<UpLo, Upper, NonHermitian>(a, tmp, m_P.
indices().data());
238 factorize_preordered<DoLDLT, NonHermitian>(*pmat);
241 template <
bool DoLDLT,
bool NonHermitian>
242 void factorize_preordered(
const CholMatrixType& a);
243 template <
bool DoLDLT,
bool NonHermitian,
bool UsePackets>
244 void factorize_preordered_impl(
const CholMatrixType& a);
246 template <
bool DoLDLT,
bool NonHermitian>
247 void analyzePattern(
const MatrixType& a) {
248 eigen_assert(a.rows() == a.cols());
249 Index size = a.cols();
250 CholMatrixType tmp(size, size);
251 ConstCholMatrixPtr pmat;
252 ordering<NonHermitian>(a, pmat, tmp);
253 analyzePattern_preordered(*pmat, DoLDLT);
255 void analyzePattern_preordered(
const CholMatrixType& a,
bool doLDLT);
257 template <
bool NonHermitian>
258 void ordering(
const MatrixType& a, ConstCholMatrixPtr& pmat, CholMatrixType& ap);
260 inline DiagonalScalar getDiag(Scalar x) {
return internal::traits<Derived>::getDiag(x); }
261 inline Scalar getSymm(Scalar x) {
return internal::traits<Derived>::getSymm(x); }
265 inline bool operator()(
const Index& row,
const Index& col,
const Scalar&)
const {
return row != col; }
271 bool m_factorizationIsOk;
274 CholMatrixType m_matrix;
281 DiagonalScalar m_shiftOffset;
282 DiagonalScalar m_shiftScale;
285template <
typename MatrixType_,
int UpLo_ =
Lower,
288template <
typename MatrixType_,
int UpLo_ =
Lower,
291template <
typename MatrixType_,
int UpLo_ =
Lower,
294template <
typename MatrixType_,
int UpLo_ =
Lower,
297template <
typename MatrixType_,
int UpLo_ =
Lower,
303template <
typename MatrixType_,
int UpLo_,
typename Ordering_>
304struct traits<
SimplicialLLT<MatrixType_, UpLo_, Ordering_> > {
305 using MatrixType = MatrixType_;
306 using OrderingType = Ordering_;
307 enum { UpLo = UpLo_ };
308 using Scalar =
typename MatrixType::Scalar;
309 using DiagonalScalar =
typename MatrixType::RealScalar;
310 using StorageIndex =
typename MatrixType::StorageIndex;
311 using CholMatrixType = SparseMatrix<Scalar, ColMajor, StorageIndex>;
312 using MatrixL = TriangularView<const CholMatrixType, Eigen::Lower>;
313 using MatrixU = TriangularView<const typename CholMatrixType::AdjointReturnType, Eigen::Upper>;
314 static inline MatrixL getL(
const CholMatrixType& m) {
return MatrixL(m); }
315 static inline MatrixU getU(
const CholMatrixType& m) {
return MatrixU(m.adjoint()); }
316 static inline DiagonalScalar getDiag(Scalar x) {
return numext::real(x); }
317 static inline Scalar getSymm(Scalar x) {
return numext::conj(x); }
320template <
typename MatrixType_,
int UpLo_,
typename Ordering_>
321struct traits<SimplicialLDLT<MatrixType_, UpLo_, Ordering_> > {
322 using MatrixType = MatrixType_;
323 using OrderingType = Ordering_;
324 enum { UpLo = UpLo_ };
325 using Scalar =
typename MatrixType::Scalar;
326 using DiagonalScalar =
typename MatrixType::RealScalar;
327 using StorageIndex =
typename MatrixType::StorageIndex;
328 using CholMatrixType = SparseMatrix<Scalar, ColMajor, StorageIndex>;
329 using MatrixL = TriangularView<const CholMatrixType, Eigen::UnitLower>;
330 using MatrixU = TriangularView<const typename CholMatrixType::AdjointReturnType, Eigen::UnitUpper>;
331 static inline MatrixL getL(
const CholMatrixType& m) {
return MatrixL(m); }
332 static inline MatrixU getU(
const CholMatrixType& m) {
return MatrixU(m.adjoint()); }
333 static inline DiagonalScalar getDiag(Scalar x) {
return numext::real(x); }
334 static inline Scalar getSymm(Scalar x) {
return numext::conj(x); }
337template <
typename MatrixType_,
int UpLo_,
typename Ordering_>
338struct traits<SimplicialNonHermitianLLT<MatrixType_, UpLo_, Ordering_> > {
339 using MatrixType = MatrixType_;
340 using OrderingType = Ordering_;
341 enum { UpLo = UpLo_ };
342 using Scalar =
typename MatrixType::Scalar;
343 using DiagonalScalar =
typename MatrixType::Scalar;
344 using StorageIndex =
typename MatrixType::StorageIndex;
345 using CholMatrixType = SparseMatrix<Scalar, ColMajor, StorageIndex>;
346 using MatrixL = TriangularView<const CholMatrixType, Eigen::Lower>;
347 using MatrixU = TriangularView<const typename CholMatrixType::ConstTransposeReturnType, Eigen::Upper>;
348 static inline MatrixL getL(
const CholMatrixType& m) {
return MatrixL(m); }
349 static inline MatrixU getU(
const CholMatrixType& m) {
return MatrixU(m.transpose()); }
350 static inline DiagonalScalar getDiag(Scalar x) {
return x; }
351 static inline Scalar getSymm(Scalar x) {
return x; }
354template <
typename MatrixType_,
int UpLo_,
typename Ordering_>
355struct traits<SimplicialNonHermitianLDLT<MatrixType_, UpLo_, Ordering_> > {
356 using MatrixType = MatrixType_;
357 using OrderingType = Ordering_;
358 enum { UpLo = UpLo_ };
359 using Scalar =
typename MatrixType::Scalar;
360 using DiagonalScalar =
typename MatrixType::Scalar;
361 using StorageIndex =
typename MatrixType::StorageIndex;
362 using CholMatrixType = SparseMatrix<Scalar, ColMajor, StorageIndex>;
363 using MatrixL = TriangularView<const CholMatrixType, Eigen::UnitLower>;
364 using MatrixU = TriangularView<const typename CholMatrixType::ConstTransposeReturnType, Eigen::UnitUpper>;
365 static inline MatrixL getL(
const CholMatrixType& m) {
return MatrixL(m); }
366 static inline MatrixU getU(
const CholMatrixType& m) {
return MatrixU(m.transpose()); }
367 static inline DiagonalScalar getDiag(Scalar x) {
return x; }
368 static inline Scalar getSymm(Scalar x) {
return x; }
371template <
typename MatrixType_,
int UpLo_,
typename Ordering_>
372struct traits<SimplicialCholesky<MatrixType_, UpLo_, Ordering_> > {
373 using MatrixType = MatrixType_;
374 using OrderingType = Ordering_;
375 enum { UpLo = UpLo_ };
376 using Scalar =
typename MatrixType::Scalar;
377 using DiagonalScalar =
typename MatrixType::RealScalar;
378 static inline DiagonalScalar getDiag(Scalar x) {
return numext::real(x); }
379 static inline Scalar getSymm(Scalar x) {
return numext::conj(x); }
404template <
typename MatrixType_,
int UpLo_,
typename Ordering_>
407 using MatrixType = MatrixType_;
408 enum { UpLo = UpLo_ };
410 using Scalar =
typename MatrixType::Scalar;
411 using RealScalar =
typename MatrixType::RealScalar;
412 using StorageIndex =
typename MatrixType::StorageIndex;
415 using Traits = internal::traits<SimplicialLLT>;
416 using MatrixL =
typename Traits::MatrixL;
417 using MatrixU =
typename Traits::MatrixU;
427 eigen_assert(Base::m_factorizationIsOk &&
"Simplicial LLT not factorized");
428 return Traits::getL(Base::m_matrix);
433 eigen_assert(Base::m_factorizationIsOk &&
"Simplicial LLT not factorized");
434 return Traits::getU(Base::m_matrix);
462 eigen_assert(Base::m_factorizationIsOk && Base::m_info ==
Success &&
463 "Simplicial LLT is not factorized, or its factorization failed");
464 Scalar detL = Base::m_matrix.diagonal().prod();
465 return numext::abs2(detL);
470 eigen_assert(Base::m_factorizationIsOk && Base::m_info ==
Success &&
471 "Simplicial LLT is not factorized, or its factorization failed");
472 return numext::abs2(Base::m_matrix.diagonal().prod());
481 eigen_assert(Base::m_factorizationIsOk && Base::m_info ==
Success &&
482 "Simplicial LLT is not factorized, or its factorization failed");
483 return RealScalar(2) * Base::m_matrix.diagonal().cwiseAbs().array().log().sum();
492 eigen_assert(Base::m_factorizationIsOk && Base::m_info ==
Success &&
493 "Simplicial LLT is not factorized, or its factorization failed");
518template <
typename MatrixType_,
int UpLo_,
typename Ordering_>
521 using MatrixType = MatrixType_;
522 enum { UpLo = UpLo_ };
524 using Scalar =
typename MatrixType::Scalar;
525 using RealScalar =
typename MatrixType::RealScalar;
526 using StorageIndex =
typename MatrixType::StorageIndex;
529 using Traits = internal::traits<SimplicialLDLT>;
530 using MatrixL =
typename Traits::MatrixL;
531 using MatrixU =
typename Traits::MatrixU;
542 eigen_assert(Base::m_factorizationIsOk &&
"Simplicial LDLT not factorized");
547 eigen_assert(Base::m_factorizationIsOk &&
"Simplicial LDLT not factorized");
548 return Traits::getL(Base::m_matrix);
553 eigen_assert(Base::m_factorizationIsOk &&
"Simplicial LDLT not factorized");
554 return Traits::getU(Base::m_matrix);
582 eigen_assert(Base::m_factorizationIsOk && Base::m_info ==
Success &&
583 "Simplicial LDLT is not factorized, or its factorization failed");
584 return Base::m_diag.prod();
589 eigen_assert(Base::m_factorizationIsOk && Base::m_info ==
Success &&
590 "Simplicial LDLT is not factorized, or its factorization failed");
591 return numext::abs(Base::m_diag.real().prod());
600 eigen_assert(Base::m_factorizationIsOk && Base::m_info ==
Success &&
601 "Simplicial LDLT is not factorized, or its factorization failed");
602 return Base::m_diag.real().cwiseAbs().array().log().sum();
607 eigen_assert(Base::m_factorizationIsOk && Base::m_info ==
Success &&
608 "Simplicial LDLT is not factorized, or its factorization failed");
609 return Scalar(Base::m_diag.real().array().sign().prod());
633template <
typename MatrixType_,
int UpLo_,
typename Ordering_>
637 using MatrixType = MatrixType_;
638 enum { UpLo = UpLo_ };
640 using Scalar =
typename MatrixType::Scalar;
641 using RealScalar =
typename MatrixType::RealScalar;
642 using StorageIndex =
typename MatrixType::StorageIndex;
645 using Traits = internal::traits<SimplicialNonHermitianLLT>;
646 using MatrixL =
typename Traits::MatrixL;
647 using MatrixU =
typename Traits::MatrixU;
658 eigen_assert(Base::m_factorizationIsOk &&
"Simplicial LLT not factorized");
659 return Traits::getL(Base::m_matrix);
664 eigen_assert(Base::m_factorizationIsOk &&
"Simplicial LLT not factorized");
665 return Traits::getU(Base::m_matrix);
693 eigen_assert(Base::m_factorizationIsOk && Base::m_info ==
Success &&
694 "Simplicial LLT is not factorized, or its factorization failed");
695 Scalar detL = Base::m_matrix.diagonal().prod();
701 eigen_assert(Base::m_factorizationIsOk && Base::m_info ==
Success &&
702 "Simplicial LLT is not factorized, or its factorization failed");
703 return numext::abs2(Base::m_matrix.diagonal().prod());
712 eigen_assert(Base::m_factorizationIsOk && Base::m_info ==
Success &&
713 "Simplicial LLT is not factorized, or its factorization failed");
714 return RealScalar(2) * Base::m_matrix.diagonal().cwiseAbs().array().log().sum();
719 eigen_assert(Base::m_factorizationIsOk && Base::m_info ==
Success &&
720 "Simplicial LLT is not factorized, or its factorization failed");
721 Scalar signL = Base::m_matrix.diagonal().array().sign().prod();
722 return signL * signL;
746template <
typename MatrixType_,
int UpLo_,
typename Ordering_>
750 using MatrixType = MatrixType_;
751 enum { UpLo = UpLo_ };
753 using Scalar =
typename MatrixType::Scalar;
754 using RealScalar =
typename MatrixType::RealScalar;
755 using StorageIndex =
typename MatrixType::StorageIndex;
758 using Traits = internal::traits<SimplicialNonHermitianLDLT>;
759 using MatrixL =
typename Traits::MatrixL;
760 using MatrixU =
typename Traits::MatrixU;
771 eigen_assert(Base::m_factorizationIsOk &&
"Simplicial LDLT not factorized");
776 eigen_assert(Base::m_factorizationIsOk &&
"Simplicial LDLT not factorized");
777 return Traits::getL(Base::m_matrix);
782 eigen_assert(Base::m_factorizationIsOk &&
"Simplicial LDLT not factorized");
783 return Traits::getU(Base::m_matrix);
811 eigen_assert(Base::m_factorizationIsOk && Base::m_info ==
Success &&
812 "Simplicial LDLT is not factorized, or its factorization failed");
813 return Base::m_diag.prod();
818 eigen_assert(Base::m_factorizationIsOk && Base::m_info ==
Success &&
819 "Simplicial LDLT is not factorized, or its factorization failed");
820 return numext::abs(Base::m_diag.prod());
829 eigen_assert(Base::m_factorizationIsOk && Base::m_info ==
Success &&
830 "Simplicial LDLT is not factorized, or its factorization failed");
831 return Base::m_diag.cwiseAbs().array().log().sum();
836 eigen_assert(Base::m_factorizationIsOk && Base::m_info ==
Success &&
837 "Simplicial LDLT is not factorized, or its factorization failed");
838 return Base::m_diag.array().sign().prod();
848template <
typename MatrixType_,
int UpLo_,
typename Ordering_>
851 using MatrixType = MatrixType_;
852 enum { UpLo = UpLo_ };
854 using Scalar =
typename MatrixType::Scalar;
855 using RealScalar =
typename MatrixType::RealScalar;
856 using StorageIndex =
typename MatrixType::StorageIndex;
859 using LDLTTraits = internal::traits<SimplicialLDLT<MatrixType, UpLo>>;
860 using LLTTraits = internal::traits<SimplicialLLT<MatrixType, UpLo>>;
863 SimplicialCholesky() : Base(), m_LDLT(
true) {}
865 explicit SimplicialCholesky(
const MatrixType& matrix) : Base(), m_LDLT(
true) {
compute(matrix); }
867 SimplicialCholesky& setMode(SimplicialCholeskyMode mode) {
869 case SimplicialCholeskyLLT:
872 case SimplicialCholeskyLDLT:
882 inline const VectorType vectorD()
const {
883 eigen_assert(Base::m_factorizationIsOk &&
"Simplicial Cholesky not factorized");
886 inline const CholMatrixType rawMatrix()
const {
887 eigen_assert(Base::m_factorizationIsOk &&
"Simplicial Cholesky not factorized");
888 return Base::m_matrix;
892 SimplicialCholesky&
compute(
const MatrixType& matrix) {
928 template <
typename Rhs,
typename Dest>
930 eigen_assert(Base::m_factorizationIsOk &&
931 "The decomposition is not in a valid state for solving, you must first call either compute() or "
932 "symbolic()/numeric()");
933 eigen_assert(Base::m_matrix.rows() == b.rows());
935 if (Base::m_info !=
Success)
return;
937 if (Base::m_P.size() > 0)
938 dest = Base::m_P * b;
942 if (Base::m_matrix.nonZeros() > 0)
945 LDLTTraits::getL(Base::m_matrix).solveInPlace(dest);
947 LLTTraits::getL(Base::m_matrix).solveInPlace(dest);
950 if (Base::m_diag.size() > 0) dest = Base::m_diag.
real().asDiagonal().inverse() * dest;
952 if (Base::m_matrix.nonZeros() > 0)
955 LDLTTraits::getU(Base::m_matrix).solveInPlace(dest);
957 LLTTraits::getU(Base::m_matrix).solveInPlace(dest);
960 if (Base::m_P.size() > 0) dest = Base::m_Pinv * dest;
964 template <
typename Rhs,
typename Dest>
965 void _solve_impl(
const SparseMatrixBase<Rhs>& b, SparseMatrixBase<Dest>& dest)
const {
966 internal::solve_sparse_through_dense_panels(*
this, b, dest);
969 Scalar determinant()
const {
970 eigen_assert(Base::m_factorizationIsOk && Base::m_info ==
Success &&
971 "Simplicial Cholesky is not factorized, or its factorization failed");
973 return Base::m_diag.prod();
975 Scalar detL = Diagonal<const CholMatrixType>(Base::m_matrix).prod();
976 return numext::abs2(detL);
984template <
typename Derived>
985template <
bool NonHermitian>
986void SimplicialCholeskyBase<Derived>::ordering(
const MatrixType& a, ConstCholMatrixPtr& pmat, CholMatrixType& ap) {
987 eigen_assert(a.rows() == a.cols());
988 const Index size = a.rows();
994 constexpr bool kUseAMDFastPath = std::is_same<OrderingType, AMDOrdering<StorageIndex> >::value;
995 internal::simplicial_cholesky_amd_dispatch<kUseAMDFastPath>::template run<UpLo, NonHermitian, OrderingType>(
999 if (m_Pinv.size() > 0)
1000 m_P = m_Pinv.inverse();
1004 ap.resize(size, size);
1005 internal::permute_symm_to_symm<UpLo, Upper, NonHermitian>(a, ap, m_P.indices().data());
1009 EIGEN_IF_CONSTEXPR (
int(UpLo) ==
int(
Lower) || MatrixType::IsRowMajor) {
1011 ap.resize(size, size);
1012 internal::permute_symm_to_symm<UpLo, Upper, NonHermitian>(a, ap,
nullptr);
1014 internal::simplicial_cholesky_grab_input<CholMatrixType, MatrixType>::run(a, pmat, ap);
constexpr RealReturnType real() const
Definition DenseBase.h:93
Base class for all dense matrices, vectors, and expressions.
Definition MatrixBase.h:53
The matrix class, also used for vectors and row-vectors.
Definition Matrix.h:188
Index size() const
Definition PermutationMatrix.h:139
Permutation matrix.
Definition PermutationMatrix.h:346
constexpr const IndicesType & indices() const
Definition PermutationMatrix.h:400
SimplicialCholeskyBase()
Definition SimplicialCholesky.h:106
void compute(const MatrixType &matrix)
Definition SimplicialCholesky.h:213
ComputationInfo info() const
Reports whether previous computation was successful.
Definition SimplicialCholesky.h:125
const PermutationMatrix< Dynamic, Dynamic, StorageIndex > & permutationP() const
Definition SimplicialCholesky.h:132
Derived & setShift(const DiagonalScalar &offset, const DiagonalScalar &scale=1)
Definition SimplicialCholesky.h:148
const PermutationMatrix< Dynamic, Dynamic, StorageIndex > & permutationPinv() const
Definition SimplicialCholesky.h:136
Definition SimplicialCholesky.h:849
void factorize(const MatrixType &a)
Definition SimplicialCholesky.h:920
void analyzePattern(const MatrixType &a)
Definition SimplicialCholesky.h:906
SimplicialCholesky & compute(const MatrixType &matrix)
Definition SimplicialCholesky.h:892
A direct sparse LDLT Cholesky factorizations without square root.
Definition SimplicialCholesky.h:519
RealScalar logAbsDeterminant() const
Definition SimplicialCholesky.h:599
Scalar determinant() const
Definition SimplicialCholesky.h:581
const MatrixL matrixL() const
Definition SimplicialCholesky.h:546
SimplicialLDLT(const MatrixType &matrix)
Definition SimplicialCholesky.h:538
Scalar signDeterminant() const
Definition SimplicialCholesky.h:606
const MatrixU matrixU() const
Definition SimplicialCholesky.h:552
void analyzePattern(const MatrixType &a)
Definition SimplicialCholesky.h:569
void factorize(const MatrixType &a)
Definition SimplicialCholesky.h:578
const VectorType vectorD() const
Definition SimplicialCholesky.h:541
RealScalar absDeterminant() const
Definition SimplicialCholesky.h:588
SimplicialLDLT & compute(const MatrixType &matrix)
Definition SimplicialCholesky.h:558
SimplicialLDLT()
Definition SimplicialCholesky.h:535
A direct sparse LLT Cholesky factorizations.
Definition SimplicialCholesky.h:405
Scalar signDeterminant() const
Definition SimplicialCholesky.h:491
const MatrixL matrixL() const
Definition SimplicialCholesky.h:426
SimplicialLLT & compute(const MatrixType &matrix)
Definition SimplicialCholesky.h:438
Scalar determinant() const
Definition SimplicialCholesky.h:461
RealScalar logAbsDeterminant() const
Definition SimplicialCholesky.h:480
RealScalar absDeterminant() const
Definition SimplicialCholesky.h:469
const MatrixU matrixU() const
Definition SimplicialCholesky.h:432
SimplicialLLT()
Definition SimplicialCholesky.h:421
void analyzePattern(const MatrixType &a)
Definition SimplicialCholesky.h:449
void factorize(const MatrixType &a)
Definition SimplicialCholesky.h:458
SimplicialLLT(const MatrixType &matrix)
Definition SimplicialCholesky.h:423
A direct sparse LDLT Cholesky factorizations without square root, for symmetric non-hermitian matrice...
Definition SimplicialCholesky.h:748
SimplicialNonHermitianLDLT()
Definition SimplicialCholesky.h:764
Scalar determinant() const
Definition SimplicialCholesky.h:810
RealScalar absDeterminant() const
Definition SimplicialCholesky.h:817
Scalar signDeterminant() const
Definition SimplicialCholesky.h:835
RealScalar logAbsDeterminant() const
Definition SimplicialCholesky.h:828
SimplicialNonHermitianLDLT & compute(const MatrixType &matrix)
Definition SimplicialCholesky.h:787
const MatrixU matrixU() const
Definition SimplicialCholesky.h:781
const MatrixL matrixL() const
Definition SimplicialCholesky.h:775
const VectorType vectorD() const
Definition SimplicialCholesky.h:770
SimplicialNonHermitianLDLT(const MatrixType &matrix)
Definition SimplicialCholesky.h:767
void factorize(const MatrixType &a)
Definition SimplicialCholesky.h:807
void analyzePattern(const MatrixType &a)
Definition SimplicialCholesky.h:798
A direct sparse LLT Cholesky factorizations, for symmetric non-hermitian matrices.
Definition SimplicialCholesky.h:635
void factorize(const MatrixType &a)
Definition SimplicialCholesky.h:689
const MatrixU matrixU() const
Definition SimplicialCholesky.h:663
RealScalar absDeterminant() const
Definition SimplicialCholesky.h:700
SimplicialNonHermitianLLT()
Definition SimplicialCholesky.h:651
SimplicialNonHermitianLLT & compute(const MatrixType &matrix)
Definition SimplicialCholesky.h:669
Scalar determinant() const
Definition SimplicialCholesky.h:692
const MatrixL matrixL() const
Definition SimplicialCholesky.h:657
void analyzePattern(const MatrixType &a)
Definition SimplicialCholesky.h:680
RealScalar logAbsDeterminant() const
Definition SimplicialCholesky.h:711
SimplicialNonHermitianLLT(const MatrixType &matrix)
Definition SimplicialCholesky.h:654
Scalar signDeterminant() const
Definition SimplicialCholesky.h:718
A versatile sparse matrix representation.
Definition SparseMatrix.h:122
Index cols() const
Definition SparseMatrix.h:162
Index rows() const
Definition SparseMatrix.h:160
Index nonZeros() const
Definition SparseCompressedBase.h:65
SparseSolverBase()=default
ComputationInfo
Definition Constants.h:455
@ Lower
Definition Constants.h:212
@ Upper
Definition Constants.h:214
@ Success
Definition Constants.h:457
Definition SimplicialCholesky.h:264