Standard Cholesky decomposition (LL^T) of a matrix and associated features. More...
#include <LLT.h>
Public Types | |
enum | { RowsAtCompileTime = MatrixType::RowsAtCompileTime, ColsAtCompileTime = MatrixType::ColsAtCompileTime, MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime } |
enum | { PacketSize = internal::packet_traits<Scalar>::size, AlignmentMask = int(PacketSize)-1, UpLo = _UpLo } |
typedef Eigen::Index | Index |
typedef _MatrixType | MatrixType |
typedef NumTraits< typename MatrixType::Scalar >::Real | RealScalar |
typedef MatrixType::Scalar | Scalar |
typedef MatrixType::StorageIndex | StorageIndex |
typedef internal::LLT_Traits< MatrixType, UpLo > | Traits |
Public Member Functions | |
template<typename RhsType , typename DstType > | |
EIGEN_DEVICE_FUNC void | _solve_impl (const RhsType &rhs, DstType &dst) const |
template<typename RhsType , typename DstType > | |
void | _solve_impl (const RhsType &rhs, DstType &dst) const |
const LLT & | adjoint () const |
Index | cols () const |
template<typename InputType > | |
LLT & | compute (const EigenBase< InputType > &matrix) |
template<typename InputType > | |
LLT< MatrixType, _UpLo > & | compute (const EigenBase< InputType > &a) |
ComputationInfo | info () const |
Reports whether previous computation was successful. More... | |
LLT () | |
Default Constructor. More... | |
LLT (Index size) | |
Default Constructor with memory preallocation. More... | |
template<typename InputType > | |
LLT (const EigenBase< InputType > &matrix) | |
template<typename InputType > | |
LLT (EigenBase< InputType > &matrix) | |
Constructs a LDLT factorization from a given matrix. More... | |
Traits::MatrixL | matrixL () const |
const MatrixType & | matrixLLT () const |
Traits::MatrixU | matrixU () const |
template<typename VectorType > | |
LLT | rankUpdate (const VectorType &vec, const RealScalar &sigma=1) |
template<typename VectorType > | |
LLT< _MatrixType, _UpLo > | rankUpdate (const VectorType &v, const RealScalar &sigma) |
RealScalar | rcond () const |
MatrixType | reconstructedMatrix () const |
Index | rows () const |
template<typename Rhs > | |
const Solve< LLT, Rhs > | solve (const MatrixBase< Rhs > &b) const |
template<typename Derived > | |
void | solveInPlace (const MatrixBase< Derived > &bAndX) const |
Static Protected Member Functions | |
static void | check_template_parameters () |
Protected Attributes | |
ComputationInfo | m_info |
bool | m_isInitialized |
RealScalar | m_l1_norm |
MatrixType | m_matrix |
Standard Cholesky decomposition (LL^T) of a matrix and associated features.
_MatrixType | the type of the matrix of which we are computing the LL^T Cholesky decomposition |
_UpLo | the triangular part that will be used for the decompositon: Lower (default) or Upper. The other triangular part won't be read. |
This class performs a LL^T Cholesky decomposition of a symmetric, positive definite matrix A such that A = LL^* = U^*U, where L is lower triangular.
While the Cholesky decomposition is particularly useful to solve selfadjoint problems like D^*D x = b, for that purpose, we recommend the Cholesky decomposition without square root which is more stable and even faster. Nevertheless, this standard Cholesky decomposition remains useful in many other situations like generalised eigen problems with hermitian matrices.
Remember that Cholesky decompositions are not rank-revealing. This LLT decomposition is only stable on positive definite matrices, use LDLT instead for the semidefinite case. Also, do not use a Cholesky decomposition to determine whether a system of equations has a solution.
Example:
Output:
Performance: for best performance, it is recommended to use a column-major storage format with the Lower triangular part (the default), or, equivalently, a row-major storage format with the Upper triangular part. Otherwise, you might get a 20% slowdown for the full factorization step, and rank-updates can be up to 3 times slower.
This class supports the inplace decomposition mechanism.
Note that during the decomposition, only the lower (or upper, as defined by _UpLo) triangular part of A is considered. Therefore, the strict lower part does not have to store correct values.
typedef Eigen::Index Eigen::LLT< _MatrixType, _UpLo >::Index |
typedef _MatrixType Eigen::LLT< _MatrixType, _UpLo >::MatrixType |
typedef NumTraits<typename MatrixType::Scalar>::Real Eigen::LLT< _MatrixType, _UpLo >::RealScalar |
typedef MatrixType::Scalar Eigen::LLT< _MatrixType, _UpLo >::Scalar |
typedef MatrixType::StorageIndex Eigen::LLT< _MatrixType, _UpLo >::StorageIndex |
typedef internal::LLT_Traits<MatrixType,UpLo> Eigen::LLT< _MatrixType, _UpLo >::Traits |
anonymous enum |
anonymous enum |
|
inline |
|
inlineexplicit |
|
inlineexplicit |
|
inlineexplicit |
Constructs a LDLT factorization from a given matrix.
This overloaded constructor is provided for inplace decomposition when MatrixType
is a Eigen::Ref.
EIGEN_DEVICE_FUNC void Eigen::LLT< _MatrixType, _UpLo >::_solve_impl | ( | const RhsType & | rhs, |
DstType & | dst | ||
) | const |
void Eigen::LLT< _MatrixType, _UpLo >::_solve_impl | ( | const RhsType & | rhs, |
DstType & | dst | ||
) | const |
|
inline |
*this
, that is, a const reference to the decomposition itself as the underlying matrix is self-adjoint.This method is provided for compatibility with other matrix decompositions, thus enabling generic code such as:
|
inlinestaticprotected |
|
inline |
LLT& Eigen::LLT< _MatrixType, _UpLo >::compute | ( | const EigenBase< InputType > & | matrix | ) |
LLT<MatrixType,_UpLo>& Eigen::LLT< _MatrixType, _UpLo >::compute | ( | const EigenBase< InputType > & | a | ) |
Computes / recomputes the Cholesky decomposition A = LL^* = U^*U of matrix
Example:
Output:
|
inline |
|
inline |
|
inline |
|
inline |
LLT Eigen::LLT< _MatrixType, _UpLo >::rankUpdate | ( | const VectorType & | vec, |
const RealScalar & | sigma = 1 |
||
) |
LLT<_MatrixType,_UpLo> Eigen::LLT< _MatrixType, _UpLo >::rankUpdate | ( | const VectorType & | v, |
const RealScalar & | sigma | ||
) |
|
inline |
MatrixType Eigen::LLT< MatrixType, _UpLo >::reconstructedMatrix | ( | ) | const |
|
inline |
|
inline |
Since this LLT class assumes anyway that the matrix A is invertible, the solution theoretically exists and is unique regardless of b.
Example:
Output:
void Eigen::LLT< MatrixType, _UpLo >::solveInPlace | ( | const MatrixBase< Derived > & | bAndX | ) | const |
|
protected |
|
protected |
|
protected |
|
protected |