SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.matrix.doubles.factorization.triangle
Class LDL

java.lang.Object
  extended by com.numericalmethod.suanshu.matrix.doubles.factorization.triangle.LDL

public class LDL
extends java.lang.Object

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.

See Also:
Wikipedia: Avoiding taking square roots

Constructor Summary
LDL(Matrix A)
          Construct an instance of the LDL decomposition.
 
Method Summary
 DiagonalMatrix D()
          Get a copy of the diagonal matrix D as in A = L %*% D %*% Lt
 LowerTriangularMatrix L()
          Get a copy of the lower triangular matrix L as in A = L %*% D %*% Lt
 UpperTriangularMatrix Lt()
          Get a copy of the transpose of the lower triangular matrix L as in A = L %*% Lt The transpose is upper triangular.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LDL

public LDL(Matrix A)
Construct an instance of the LDL decomposition.

Parameters:
A - a real and symmetric (hence square) matrix
Throws:
java.lang.IllegalArgumentException - if A is not symmetric
Method Detail

L

public LowerTriangularMatrix L()
Get a copy of the lower triangular matrix L as in A = L %*% D %*% Lt

Returns:
a copy of L

Lt

public UpperTriangularMatrix Lt()
Get a copy of the transpose of the lower triangular matrix L as in A = L %*% Lt

The transpose is upper triangular.

Returns:
a copy of Lt

D

public DiagonalMatrix D()
Get a copy of the diagonal matrix D as in A = L %*% D %*% Lt

Returns:
a copy of D

SuanShu, a Java numerical and statistical library

Copyright © 2011 Numerical Method Inc. Ltd. All Rights Reserved.