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 |
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.
#include <src/Cholesky/LLT.h>
Public Types | |
enum | { RowsAtCompileTime = MatrixType::RowsAtCompileTime, ColsAtCompileTime = MatrixType::ColsAtCompileTime, Options = MatrixType::Options, MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime } |
enum | { PacketSize = internal::packet_traits<Scalar>::size, AlignmentMask = int(PacketSize)-1, UpLo = _UpLo } |
typedef _MatrixType | MatrixType |
typedef MatrixType::Scalar | Scalar |
typedef NumTraits< typename MatrixType::Scalar >::Real | RealScalar |
typedef MatrixType::Index | Index |
typedef internal::LLT_Traits < MatrixType, UpLo > | Traits |
Public Member Functions | |
LLT () | |
Default Constructor. | |
LLT (Index size) | |
Default Constructor with memory preallocation. | |
LLT (const MatrixType &matrix) | |
Traits::MatrixU | matrixU () const |
Traits::MatrixL | matrixL () const |
template<typename Rhs > | |
const internal::solve_retval < LLT, Rhs > | solve (const MatrixBase< Rhs > &b) const |
template<typename Derived > | |
void | solveInPlace (MatrixBase< Derived > &bAndX) const |
LLT & | compute (const MatrixType &matrix) |
Computes / recomputes the Cholesky decomposition A = LL^* = U^*U of matrix. | |
const MatrixType & | matrixLLT () const |
MatrixType | reconstructedMatrix () const |
ComputationInfo | info () const |
Reports whether previous computation was successful. | |
Index | rows () const |
Index | cols () const |
Protected Attributes | |
MatrixType | m_matrix |
bool | m_isInitialized |
ComputationInfo | m_info |
typedef _MatrixType LLT< _MatrixType, _UpLo >::MatrixType |
typedef NumTraits<typename MatrixType::Scalar>::Real LLT< _MatrixType, _UpLo >::RealScalar |
typedef internal::LLT_Traits<MatrixType,UpLo> LLT< _MatrixType, _UpLo >::Traits |
anonymous enum |
anonymous enum |
Default Constructor.
The default constructor is useful in cases in which the user intends to perform decompositions via LLT::compute(const MatrixType&).
LLT< _MatrixType, _UpLo >::LLT | ( | const MatrixType & | matrix | ) | [inline] |
Definition at line 97 of file LLT.h.
References LLT< _MatrixType, _UpLo >::compute().
Definition at line 168 of file LLT.h.
References LLT< _MatrixType, _UpLo >::m_matrix.
LLT< MatrixType, _UpLo > & LLT< MatrixType, _UpLo >::compute | ( | const MatrixType & | a | ) |
Computes / recomputes the Cholesky decomposition A = LL^* = U^*U of matrix.
Definition at line 290 of file LLT.h.
References NumericalIssue, mrpt::math::size(), and Success.
Referenced by LLT< _MatrixType, _UpLo >::LLT().
ComputationInfo LLT< _MatrixType, _UpLo >::info | ( | ) | const [inline] |
Reports whether previous computation was successful.
Success
if computation was succesful, NumericalIssue
if the matrix.appears to be negative. Definition at line 161 of file LLT.h.
References eigen_assert, LLT< _MatrixType, _UpLo >::m_info, and LLT< _MatrixType, _UpLo >::m_isInitialized.
Traits::MatrixL LLT< _MatrixType, _UpLo >::matrixL | ( | ) | const [inline] |
Definition at line 112 of file LLT.h.
References eigen_assert, LLT< _MatrixType, _UpLo >::m_isInitialized, and LLT< _MatrixType, _UpLo >::m_matrix.
Referenced by GeneralizedSelfAdjointEigenSolver< _MatrixType >::compute().
const MatrixType& LLT< _MatrixType, _UpLo >::matrixLLT | ( | ) | const [inline] |
TODO: document the storage layout
Definition at line 147 of file LLT.h.
References eigen_assert, LLT< _MatrixType, _UpLo >::m_isInitialized, and LLT< _MatrixType, _UpLo >::m_matrix.
Traits::MatrixU LLT< _MatrixType, _UpLo >::matrixU | ( | ) | const [inline] |
Definition at line 105 of file LLT.h.
References eigen_assert, LLT< _MatrixType, _UpLo >::m_isInitialized, and LLT< _MatrixType, _UpLo >::m_matrix.
Referenced by GeneralizedSelfAdjointEigenSolver< _MatrixType >::compute().
MatrixType LLT< MatrixType, _UpLo >::reconstructedMatrix | ( | ) | const |
Definition at line 347 of file LLT.h.
References eigen_assert.
Definition at line 167 of file LLT.h.
References LLT< _MatrixType, _UpLo >::m_matrix.
const internal::solve_retval<LLT, Rhs> LLT< _MatrixType, _UpLo >::solve | ( | const MatrixBase< Rhs > & | b | ) | const [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:
Definition at line 130 of file LLT.h.
References eigen_assert, LLT< _MatrixType, _UpLo >::m_isInitialized, and LLT< _MatrixType, _UpLo >::m_matrix.
void LLT< MatrixType, _UpLo >::solveInPlace | ( | MatrixBase< Derived > & | bAndX | ) | const |
Definition at line 335 of file LLT.h.
References eigen_assert.
ComputationInfo LLT< _MatrixType, _UpLo >::m_info [protected] |
Definition at line 177 of file LLT.h.
Referenced by LLT< _MatrixType, _UpLo >::info().
bool LLT< _MatrixType, _UpLo >::m_isInitialized [protected] |
Definition at line 176 of file LLT.h.
Referenced by LLT< _MatrixType, _UpLo >::info(), LLT< _MatrixType, _UpLo >::matrixL(), LLT< _MatrixType, _UpLo >::matrixLLT(), LLT< _MatrixType, _UpLo >::matrixU(), and LLT< _MatrixType, _UpLo >::solve().
MatrixType LLT< _MatrixType, _UpLo >::m_matrix [protected] |
Definition at line 175 of file LLT.h.
Referenced by LLT< _MatrixType, _UpLo >::cols(), LLT< _MatrixType, _UpLo >::matrixL(), LLT< _MatrixType, _UpLo >::matrixLLT(), LLT< _MatrixType, _UpLo >::matrixU(), LLT< _MatrixType, _UpLo >::rows(), and LLT< _MatrixType, _UpLo >::solve().
Page generated by Doxygen 1.7.3 for MRPT 0.9.4 SVN: at Sat Mar 26 06:16:28 UTC 2011 |