# SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.algebra.linear.matrix.doubles.factorization.triangle

## Class LDLt

• java.lang.Object
• com.numericalmethod.suanshu.algebra.linear.matrix.doubles.factorization.triangle.LDLt

• public class LDLt
extends Object
The LDL decomposition decomposes a real and symmetric (hence square) matrix A into A = L * D * Lt. L is a lower triangular matrix. D is a diagonal matrix. Unlike Cholesky decomposition, this decomposition applies to all real and symmetric matrices, whether positive definite or not. Moreover, when A is positive definite the elements of the diagonal matrix D are all positive. In other words, if A is semi/positive/negative definite, so is D. This algorithm eliminates the need to take square roots.
Wikipedia: Avoiding taking square roots
• ### Constructor Summary

Constructors
Constructor and Description
LDLt(Matrix A)
Run the LDL decomposition on a real and symmetric (hence square) matrix.
LDLt(Matrix A, double epsilon)
Run the LDL decomposition on a real and symmetric (hence square) matrix.
• ### Method Summary

All Methods
Modifier and Type Method and Description
DiagonalMatrix D()
Get D the the diagonal matrix in the LDL decomposition.
LowerTriangularMatrix L()
Get L as in the LDL decomposition.
UpperTriangularMatrix Lt()
Get the transpose of L as in the LDL decomposition.
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• ### Constructor Detail

• #### LDLt

public LDLt(Matrix A,
double epsilon)
Run the LDL decomposition on a real and symmetric (hence square) matrix.
Parameters:
A - a real and symmetric (hence square) matrix
epsilon - a precision parameter: when a number |x| ≤ ε, it is considered 0
Throws:
IllegalArgumentException - if A is not symmetric
• #### LDLt

public LDLt(Matrix A)
Run the LDL decomposition on a real and symmetric (hence square) matrix.
Parameters:
A - a real and symmetric (hence square) matrix
Throws:
IllegalArgumentException - if A is not symmetric
• ### Method Detail

• #### L

public LowerTriangularMatrix L()
Get L as in the LDL decomposition.
Returns:
L
• #### Lt

public UpperTriangularMatrix Lt()
Get the transpose of L as in the LDL decomposition. The transpose is upper triangular.
Returns:
L'
• #### D

public DiagonalMatrix D()
Get D the the diagonal matrix in the LDL decomposition.
Returns:
D