LLT Class Template Reference

List of all members.


Detailed Description

template<typename MatrixType>
class Eigen::LLT< MatrixType >

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

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

Note that during the decomposition, only the upper triangular part of A is considered. Therefore, the strict lower part does not have to store correct values.

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

Public Member Functions

void compute (const MatrixType &matrix)
bool isPositiveDefinite (void) const
 LLT (const MatrixType &matrix)
Part< MatrixType, LowerTriangular > matrixL (void) const
template<typename RhsDerived, typename ResDerived>
bool solve (const MatrixBase< RhsDerived > &b, MatrixBase< ResDerived > *result) const
template<typename Derived>
bool solveInPlace (MatrixBase< Derived > &bAndX) const

Protected Attributes

bool m_isPositiveDefinite
MatrixType m_matrix

Member Function Documentation

void compute ( const MatrixType &  a  )  [inline]

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

bool isPositiveDefinite ( void   )  const [inline]

Returns:
true if the matrix is positive definite

Part<MatrixType, LowerTriangular> matrixL ( void   )  const [inline]

Returns:
the lower triangular matrix L

bool solve ( const MatrixBase< RhsDerived > &  b,
MatrixBase< ResDerived > *  result 
) const [inline]

Computes the solution x of $ A x = b $ using the current decomposition of A. The result is stored in result

Returns:
true in case of success, false otherwise.
In other words, it computes $ b = A^{-1} b $ with $ {L^{*}}^{-1} L^{-1} b $ from right to left.

Example:

typedef Matrix<float,Dynamic,2> DataMatrix;
// let's generate some samples on the 3D plane of equation z = 2x+3y (with some noise)
DataMatrix samples = DataMatrix::Random(12,2);
VectorXf elevations = 2*samples.col(0) + 3*samples.col(1) + VectorXf::Random(12)*0.1;
// and let's solve samples * [x y]^T = elevations in least square sense:
Matrix<float,2,1> xy;
(samples.adjoint() * samples).llt().solve((samples.adjoint()*elevations), &xy);
cout << xy << endl;
Output:
2.02
2.97

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

bool solveInPlace ( MatrixBase< Derived > &  bAndX  )  const [inline]

This is the in-place version of solve().

Parameters:
bAndX represents both the right-hand side matrix b and result x.
This version avoids a copy when the right hand side matrix b is not needed anymore.

See also:
LLT::solve(), MatrixBase::llt()


The documentation for this class was generated from the following file:

Generated on Thu Apr 9 10:10:01 2009 for Eigen by  doxygen 1.5.5