SuanShu, a Java numerical and statistical library

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

java.lang.Object
  extended by com.numericalmethod.suanshu.matrix.doubles.factorization.triangle.LU
All Implemented Interfaces:
LUDecomposition

public class LU
extends java.lang.Object
implements LUDecomposition

LU decomposition of a matrix.

It decomposes an n x n matrix A so that

 P %*% A == L %*% U
 
where P is an n x n permutation matrix,
L is an n x n lower triangular matrix,
U is an n x n upper triangular matrix

That is,

 P.multiply(A) == L.multiply(U)
 
This decomposition can be used to
  1. solve a system of linear equations
  2. compute the determinant

See Also:
Wikipedia: LU decomposition

Nested Class Summary
static class LU.Method
          the methods available to do the LU decomposition
 
Constructor Summary
LU(Matrix A)
          Construct an instance of the LU decomposition.
LU(Matrix A, LU.Method method, double epsilon)
          Construct an instance of the LU decomposition that uses Gaussian Elimination.
 
Method Summary
 LowerTriangularMatrix L()
          Get a copy of the lower triangular matrix L as in P %*% A == L %*% U
 PermutationMatrix P()
          Get a copy of the permutation matrix P as in P %*% A == L %*% U
 UpperTriangularMatrix U()
          Get a copy of the upper triangular matrix U as in P %*% A == L %*% U
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LU

public LU(Matrix A,
          LU.Method method,
          double epsilon)
Construct an instance of the LU decomposition that uses Gaussian Elimination.

Parameters:
A - the matrix to be decomposed such that
P %*% A == L %*% U
method - the algorithm to do the LU decomposition
epsilon - a precision parameter: when a number |x| ≤ ε, it is considered 0

LU

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

Parameters:
A - a matrix
Method Detail

L

public LowerTriangularMatrix L()
Description copied from interface: LUDecomposition
Get a copy of the lower triangular matrix L as in
P %*% A == L %*% U

Specified by:
L in interface LUDecomposition
Returns:
a copy of L

U

public UpperTriangularMatrix U()
Description copied from interface: LUDecomposition
Get a copy of the upper triangular matrix U as in
P %*% A == L %*% U

Specified by:
U in interface LUDecomposition
Returns:
a copy of U

P

public PermutationMatrix P()
Description copied from interface: LUDecomposition
Get a copy of the permutation matrix P as in
P %*% A == L %*% U

Specified by:
P in interface LUDecomposition
Returns:
a copy of P

SuanShu, a Java numerical and statistical library

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