Robust Cholesky decomposition of a matrix with pivoting. More...
Public Member Functions | |
LDLT & | compute (const MatrixType &matrix) |
bool | isNegative (void) const |
bool | isPositive (void) const |
LDLT (Index size) | |
Default Constructor with memory preallocation. | |
LDLT () | |
Default Constructor. | |
Traits::MatrixL | matrixL () const |
const MatrixType & | matrixLDLT () const |
Traits::MatrixU | matrixU () const |
MatrixType | reconstructedMatrix () const |
template<typename Rhs > | |
const internal::solve_retval < LDLT, Rhs > | solve (const MatrixBase< Rhs > &b) const |
const TranspositionType & | transpositionsP () const |
Diagonal< const MatrixType > | vectorD (void) const |
Robust Cholesky decomposition of a matrix with pivoting.
MatrixType | the type of the matrix of which to compute the LDL^T Cholesky decomposition |
Perform a robust Cholesky decomposition of a positive semidefinite or negative semidefinite matrix such that
, where P is a permutation matrix, L is lower triangular with a unit diagonal and D is a diagonal matrix.
The decomposition uses pivoting to ensure stability, so that L will have zeros in the bottom right rank(A) - n submatrix. Avoiding the square root on D also stabilizes the computation.
Remember that Cholesky decompositions are not rank-revealing. Also, do not use a Cholesky decomposition to determine whether a system of equations has a solution.
LDLT | ( | ) | [inline] |
Default Constructor.
The default constructor is useful in cases in which the user intends to perform decompositions via LDLT::compute(const MatrixType&).
LDLT | ( | 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.
LDLT< MatrixType, _UpLo > & compute | ( | const MatrixType & | a | ) | [inline] |
Compute / recompute the LDLT decomposition A = L D L^* = U^* D U of matrix
bool isNegative | ( | void | ) | const [inline] |
bool isPositive | ( | void | ) | const [inline] |
Traits::MatrixL matrixL | ( | void | ) | const [inline] |
const MatrixType& matrixLDLT | ( | ) | const [inline] |
TODO: document the storage layout
Traits::MatrixU matrixU | ( | ) | const [inline] |
MatrixType reconstructedMatrix | ( | ) | const [inline] |
const internal::solve_retval<LDLT, Rhs> solve | ( | const MatrixBase< Rhs > & | b | ) | const [inline] |
This method just tries to find as good a solution as possible. If you want to check whether a solution exists or if it is accurate, just call this function to get a result and then compute the error of this result, or use MatrixBase::isApprox() directly, for instance like this:
bool a_solution_exists = (A*result).isApprox(b, precision);
This method avoids dividing by zero, so that the non-existence of a solution doesn't by itself mean that you'll get inf
or nan
values.
const TranspositionType& transpositionsP | ( | ) | const [inline] |
Diagonal<const MatrixType> vectorD | ( | void | ) | const [inline] |