Go to the documentation of this file.
10 #ifndef EIGEN_SIMPLICIAL_CHOLESKY_H
11 #define EIGEN_SIMPLICIAL_CHOLESKY_H
21 template<
typename CholMatrixType,
typename InputMatrixType>
31 template<
typename MatrixType>
54 template<
typename Derived>
96 Derived&
derived() {
return *
static_cast<Derived*
>(
this); }
97 const Derived&
derived()
const {
return *
static_cast<const Derived*
>(
this); }
139 #ifndef EIGEN_PARSED_BY_DOXYGEN
141 template<
typename Stream>
146 s <<
" diag: " << ((total+=
m_diag.size() *
sizeof(
Scalar)) >> 20) <<
"Mb" <<
"\n";
147 s <<
" tree: " << ((total+=
m_parent.size() *
sizeof(
int)) >> 20) <<
"Mb" <<
"\n";
149 s <<
" perm: " << ((total+=
m_P.
size() *
sizeof(
int)) >> 20) <<
"Mb" <<
"\n";
150 s <<
" perm^-1: " << ((total+=
m_Pinv.
size() *
sizeof(
int)) >> 20) <<
"Mb" <<
"\n";
151 s <<
" TOTAL: " << (total>> 20) <<
"Mb" <<
"\n";
155 template<
typename Rhs,
typename Dest>
158 eigen_assert(
m_factorizationIsOk &&
"The decomposition is not in a valid state for solving, you must first call either compute() or symbolic()/numeric()");
170 derived().matrixL().solveInPlace(dest);
173 dest =
m_diag.asDiagonal().inverse() * dest;
176 derived().matrixU().solveInPlace(dest);
182 template<
typename Rhs,
typename Dest>
188 #endif // EIGEN_PARSED_BY_DOXYGEN
193 template<
bool DoLDLT>
202 factorize_preordered<DoLDLT>(*pmat);
205 template<
bool DoLDLT>
220 tmp.template selfadjointView<Upper>() =
a.template selfadjointView<UpLo>().twistedBy(
m_P);
224 factorize_preordered<DoLDLT>(*pmat);
227 template<
bool DoLDLT>
266 template<
typename _MatrixType,
int _UpLo = Lower,
typename _Ordering = AMDOrdering<
typename _MatrixType::StorageIndex> >
class SimplicialLLT;
267 template<
typename _MatrixType,
int _UpLo = Lower,
typename _Ordering = AMDOrdering<
typename _MatrixType::StorageIndex> >
class SimplicialLDLT;
268 template<
typename _MatrixType,
int _UpLo = Lower,
typename _Ordering = AMDOrdering<
typename _MatrixType::StorageIndex> >
class SimplicialCholesky;
272 template<
typename _MatrixType,
int _UpLo,
typename _Ordering>
struct traits<
SimplicialLLT<_MatrixType,_UpLo,_Ordering> >
276 enum { UpLo = _UpLo };
286 template<
typename _MatrixType,
int _UpLo,
typename _Ordering>
struct traits<
SimplicialLDLT<_MatrixType,_UpLo,_Ordering> >
290 enum { UpLo = _UpLo };
304 enum { UpLo = _UpLo };
329 template<
typename _MatrixType,
int _UpLo,
typename _Ordering>
330 class SimplicialLLT :
public SimplicialCholeskyBase<SimplicialLLT<_MatrixType,_UpLo,_Ordering> >
366 Base::template compute<false>(
matrix);
389 Base::template factorize<false>(
a);
420 template<
typename _MatrixType,
int _UpLo,
typename _Ordering>
421 class SimplicialLDLT :
public SimplicialCholeskyBase<SimplicialLDLT<_MatrixType,_UpLo,_Ordering> >
463 Base::template compute<true>(
matrix);
486 Base::template factorize<true>(
a);
502 template<
typename _MatrixType,
int _UpLo,
typename _Ordering>
503 class SimplicialCholesky :
public SimplicialCholeskyBase<SimplicialCholesky<_MatrixType,_UpLo,_Ordering> >
556 Base::template compute<true>(
matrix);
558 Base::template compute<false>(
matrix);
582 Base::template factorize<true>(
a);
584 Base::template factorize<false>(
a);
588 template<
typename Rhs,
typename Dest>
626 template<
typename Rhs,
typename Dest>
649 template<
typename Derived>
660 C =
a.template selfadjointView<UpLo>();
666 if(m_Pinv.size()>0) m_P = m_Pinv.inverse();
670 ap.template selfadjointView<Upper>() =
a.template selfadjointView<UpLo>().twistedBy(m_P);
676 if(
int(UpLo)==
int(
Lower) || MatrixType::IsRowMajor)
680 ap.template selfadjointView<Upper>() =
a.template selfadjointView<UpLo>();
689 #endif // EIGEN_SIMPLICIAL_CHOLESKY_H
void resize(Index rows, Index cols)
bool operator()(const Index &row, const Index &col, const Scalar &) const
const MatrixL matrixL() const
internal::traits< SimplicialLDLT > Traits
void _solve_impl(const SparseMatrixBase< Rhs > &b, SparseMatrixBase< Dest > &dest) const
void factorize_preordered(const CholMatrixType &a)
Matrix< Scalar, Dynamic, 1 > VectorType
Map< Matrix< Scalar, Dynamic, Dynamic, ColMajor >, 0, OuterStride<> > MatrixType
internal::traits< SimplicialLLT > Traits
MatrixType::StorageIndex StorageIndex
TriangularView< const typename CholMatrixType::AdjointReturnType, Eigen::Upper > MatrixU
static MatrixU getU(const MatrixType &m)
A base class for direct sparse Cholesky factorizations.
MatrixType::Scalar Scalar
const PermutationMatrix< Dynamic, Dynamic, StorageIndex > & permutationPinv() const
SimplicialLDLT(const MatrixType &matrix)
const MatrixU matrixU() const
Scalar determinant() const
MatrixType::StorageIndex StorageIndex
internal::traits< SimplicialLLT< MatrixType, UpLo > > LLTTraits
SimplicialLDLT & compute(const MatrixType &matrix)
A direct sparse LDLT Cholesky factorizations without square root.
NumTraits< Scalar >::Real RealScalar
MatrixType::RealScalar RealScalar
EIGEN_DEVICE_FUNC ColXpr col(Index i)
This is the const version of col().
void analyzePattern(const MatrixType &a)
SparseMatrix< Scalar, ColMajor, StorageIndex > CholMatrixType
void factorize(const MatrixType &a)
MatrixType::StorageIndex StorageIndex
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Abs2ReturnType abs2() const
static MatrixL getL(const MatrixType &m)
ComputationInfo info() const
Reports whether previous computation was successful.
Matrix< Scalar, Dynamic, 1 > VectorType
const PermutationMatrix< Dynamic, Dynamic, StorageIndex > & permutationP() const
const VectorType vectorD() const
Map< Matrix< T, Dynamic, Dynamic, ColMajor >, 0, OuterStride<> > matrix(T *data, int rows, int cols, int stride)
A direct sparse LLT Cholesky factorizations.
static MatrixL getL(const MatrixType &m)
TriangularView< const CholMatrixType, Eigen::UnitLower > MatrixL
PermutationMatrix< Dynamic, Dynamic, StorageIndex > m_Pinv
SparseMatrix< Scalar, ColMajor, Index > CholMatrixType
MatrixType::Scalar Scalar
SparseMatrix< Scalar, ColMajor, StorageIndex > CholMatrixType
SimplicialCholeskyBase< SimplicialCholesky > Base
void _solve_impl(const SparseMatrixBase< Rhs > &b, SparseMatrixBase< Dest > &dest) const
const CholMatrixType * ConstCholMatrixPtr
Derived & setShift(const RealScalar &offset, const RealScalar &scale=1)
void _solve_impl(const MatrixBase< Rhs > &b, MatrixBase< Dest > &dest) const
const MatrixL matrixL() const
MatrixType::RealScalar RealScalar
const ConstDiagonalReturnType diagonal() const
SparseSolverBase< Derived > Base
MatrixType::RealScalar RealScalar
void _solve_impl(const MatrixBase< Rhs > &b, MatrixBase< Dest > &dest) const
Matrix< Scalar, Dynamic, 1 > VectorType
SparseMatrix< Scalar, ColMajor, StorageIndex > CholMatrixType
void factorize(const MatrixType &a)
static MatrixU getU(const MatrixType &m)
MatrixType::Scalar Scalar
Matrix< Scalar, Dynamic, 1 > VectorType
SimplicialCholeskyBase(const MatrixType &matrix)
const CholMatrixType rawMatrix() const
Expression of a diagonal/subdiagonal/superdiagonal in a matrix.
EIGEN_DEVICE_FUNC RowXpr row(Index i)
This is the const version of row(). */.
void analyzePattern(const MatrixType &a)
SimplicialCholeskyBase< SimplicialLLT > Base
void analyzePattern(const MatrixType &a, bool doLDLT)
SimplicialCholeskyBase< SimplicialLDLT > Base
void ordering(const MatrixType &a, ConstCholMatrixPtr &pmat, CholMatrixType &ap)
SimplicialCholesky & setMode(SimplicialCholeskyMode mode)
MatrixType::Scalar Scalar
SparseMatrix< Scalar, ColMajor, StorageIndex > CholMatrixType
void factorize(const MatrixType &a)
const MatrixU matrixU() const
const VectorType vectorD() const
MatrixType::RealScalar RealScalar
MatrixType::Scalar Scalar
const Derived & derived() const
A base class for sparse solvers.
MatrixType::StorageIndex StorageIndex
void analyzePattern_preordered(const CholMatrixType &a, bool doLDLT)
internal::traits< Derived >::OrderingType OrderingType
internal::traits< Derived >::MatrixType MatrixType
MatrixType::Scalar Scalar
enable_if< Rhs::ColsAtCompileTime!=1 &&Dest::ColsAtCompileTime!=1 >::type solve_sparse_through_dense_panels(const Decomposition &dec, const Rhs &rhs, Dest &dest)
TriangularView< const typename CholMatrixType::AdjointReturnType, Eigen::UnitUpper > MatrixU
Base class of any sparse matrices or sparse expressions.
void analyzePattern(const MatrixType &a)
static constexpr size_t size(Tuple< Args... > &)
Provides access to the number of elements in a tuple as a compile-time constant expression.
void dumpMemory(Stream &s)
internal::traits< SimplicialCholesky > Traits
SimplicialCholesky & compute(const MatrixType &matrix)
void compute(const MatrixType &matrix)
SimplicialLLT(const MatrixType &matrix)
Base class for all dense matrices, vectors, and expressions.
PermutationMatrix< Dynamic, Dynamic, StorageIndex > m_P
MatrixType::StorageIndex StorageIndex
internal::traits< SimplicialLDLT< MatrixType, UpLo > > LDLTTraits
Scalar determinant() const
SimplicialCholesky(const MatrixType &matrix)
Expression of a triangular part in a matrix.
TriangularView< const CholMatrixType, Eigen::Lower > MatrixL
SimplicialLLT & compute(const MatrixType &matrix)
Matrix< StorageIndex, Dynamic, 1 > VectorI
void factorize(const MatrixType &a)
MatrixType::StorageIndex StorageIndex
SparseMatrix< Scalar, ColMajor, StorageIndex > CholMatrixType
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Scalar determinant() const
~SimplicialCholeskyBase()
control_box_rst
Author(s): Christoph Rösmann
autogenerated on Wed Mar 2 2022 00:06:14