Main MRPT website > C++ reference
MRPT logo
Public Types | Public Member Functions | Protected Attributes

LLT< _MatrixType, _UpLo > Class Template Reference


Detailed Description

template<typename _MatrixType, int _UpLo>
class LLT< _MatrixType, _UpLo >

Standard Cholesky decomposition (LL^T) of a matrix and associated features.

Parameters:
MatrixTypethe 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.

See also:
MatrixBase::llt(), class LDLT

Definition at line 58 of file LLT.h.

#include <src/Cholesky/LLT.h>

List of all members.

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
LLTcompute (const MatrixType &matrix)
 Computes / recomputes the Cholesky decomposition A = LL^* = U^*U of matrix.
const MatrixTypematrixLLT () 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

Member Typedef Documentation

template<typename _MatrixType, int _UpLo>
typedef MatrixType::Index LLT< _MatrixType, _UpLo >::Index

Definition at line 70 of file LLT.h.

template<typename _MatrixType, int _UpLo>
typedef _MatrixType LLT< _MatrixType, _UpLo >::MatrixType

Definition at line 61 of file LLT.h.

template<typename _MatrixType, int _UpLo>
typedef NumTraits<typename MatrixType::Scalar>::Real LLT< _MatrixType, _UpLo >::RealScalar

Definition at line 69 of file LLT.h.

template<typename _MatrixType, int _UpLo>
typedef MatrixType::Scalar LLT< _MatrixType, _UpLo >::Scalar

Definition at line 68 of file LLT.h.

template<typename _MatrixType, int _UpLo>
typedef internal::LLT_Traits<MatrixType,UpLo> LLT< _MatrixType, _UpLo >::Traits

Definition at line 78 of file LLT.h.


Member Enumeration Documentation

template<typename _MatrixType, int _UpLo>
anonymous enum
Enumerator:
RowsAtCompileTime 
ColsAtCompileTime 
Options 
MaxColsAtCompileTime 

Definition at line 62 of file LLT.h.

template<typename _MatrixType, int _UpLo>
anonymous enum
Enumerator:
PacketSize 
AlignmentMask 
UpLo 

Definition at line 72 of file LLT.h.


Constructor & Destructor Documentation

template<typename _MatrixType, int _UpLo>
LLT< _MatrixType, _UpLo >::LLT ( ) [inline]

Default Constructor.

The default constructor is useful in cases in which the user intends to perform decompositions via LLT::compute(const MatrixType&).

Definition at line 86 of file LLT.h.

template<typename _MatrixType, int _UpLo>
LLT< _MatrixType, _UpLo >::LLT ( Index  size) [inline]

Default Constructor with memory preallocation.

Like the default constructor but with preallocation of the internal data according to the specified problem size.

See also:
LLT()

Definition at line 94 of file LLT.h.

template<typename _MatrixType, int _UpLo>
LLT< _MatrixType, _UpLo >::LLT ( const MatrixType matrix) [inline]

Definition at line 97 of file LLT.h.

References LLT< _MatrixType, _UpLo >::compute().


Member Function Documentation

template<typename _MatrixType, int _UpLo>
Index LLT< _MatrixType, _UpLo >::cols ( ) const [inline]

Definition at line 168 of file LLT.h.

References LLT< _MatrixType, _UpLo >::m_matrix.

template<typename MatrixType , int _UpLo>
LLT< MatrixType, _UpLo > & LLT< MatrixType, _UpLo >::compute ( const MatrixType a)

Computes / recomputes the Cholesky decomposition A = LL^* = U^*U of matrix.

Returns:
a reference to *this

Definition at line 290 of file LLT.h.

References NumericalIssue, mrpt::math::size(), and Success.

Referenced by LLT< _MatrixType, _UpLo >::LLT().

template<typename _MatrixType, int _UpLo>
ComputationInfo LLT< _MatrixType, _UpLo >::info ( ) const [inline]

Reports whether previous computation was successful.

Returns:
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.

template<typename _MatrixType, int _UpLo>
Traits::MatrixL LLT< _MatrixType, _UpLo >::matrixL ( ) const [inline]
Returns:
a view of the lower triangular matrix L

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().

template<typename _MatrixType, int _UpLo>
const MatrixType& LLT< _MatrixType, _UpLo >::matrixLLT ( ) const [inline]
Returns:
the LLT decomposition matrix

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.

template<typename _MatrixType, int _UpLo>
Traits::MatrixU LLT< _MatrixType, _UpLo >::matrixU ( ) const [inline]
Returns:
a view of the upper triangular matrix U

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().

template<typename MatrixType , int _UpLo>
MatrixType LLT< MatrixType, _UpLo >::reconstructedMatrix ( ) const
Returns:
the matrix represented by the decomposition, i.e., it returns the product: L L^*. This function is provided for debug purpose.

Definition at line 347 of file LLT.h.

References eigen_assert.

template<typename _MatrixType, int _UpLo>
Index LLT< _MatrixType, _UpLo >::rows ( ) const [inline]

Definition at line 167 of file LLT.h.

References LLT< _MatrixType, _UpLo >::m_matrix.

template<typename _MatrixType, int _UpLo>
template<typename Rhs >
const internal::solve_retval<LLT, Rhs> LLT< _MatrixType, _UpLo >::solve ( const MatrixBase< Rhs > &  b) const [inline]
Returns:
the solution x of $ A x = b $ using the current decomposition of A.

Since this LLT class assumes anyway that the matrix A is invertible, the solution theoretically exists and is unique regardless of b.

Example:

Output:

See also:
solveInPlace(), MatrixBase::llt()

Definition at line 130 of file LLT.h.

References eigen_assert, LLT< _MatrixType, _UpLo >::m_isInitialized, and LLT< _MatrixType, _UpLo >::m_matrix.

template<typename MatrixType , int _UpLo>
template<typename Derived >
void LLT< MatrixType, _UpLo >::solveInPlace ( MatrixBase< Derived > &  bAndX) const

Definition at line 335 of file LLT.h.

References eigen_assert.


Member Data Documentation

template<typename _MatrixType, int _UpLo>
ComputationInfo LLT< _MatrixType, _UpLo >::m_info [protected]

Definition at line 177 of file LLT.h.

Referenced by LLT< _MatrixType, _UpLo >::info().

template<typename _MatrixType, int _UpLo>
bool LLT< _MatrixType, _UpLo >::m_isInitialized [protected]
template<typename _MatrixType, int _UpLo>
MatrixType LLT< _MatrixType, _UpLo >::m_matrix [protected]



Page generated by Doxygen 1.7.3 for MRPT 0.9.4 SVN: at Sat Mar 26 06:40:17 UTC 2011