Orbital library

orbital.math
Class LUDecomposition

java.lang.Object
  extended by orbital.math.LUDecomposition
All Implemented Interfaces:
java.io.Serializable

public final class LUDecomposition
extends java.lang.Object
implements java.io.Serializable

LUDecomposition class, decomposing A into P.A = L.U.

Author:
André Platzer
See Also:
decompose(Matrix), NumericalAlgorithms, Serialized Form
Invariants:
!isInvertible() || getP().multiply(A).equals(getL().multiply(getU()))
Stereotype:
Structure, Wrapper
Note:
this class is more or less just a workaround for returning multiple values.

Constructor Summary
protected LUDecomposition(Matrix A, Matrix P, boolean sign)
          Gaussian LU-decomposition implementation.
 
Method Summary
static LUDecomposition decompose(Matrix M)
          Get the Gaussian LU-decomposition of a matrix.
 Arithmetic det()
          The determinant of A.
 Matrix getL()
          lower triangular matrix L with diagonal 1s.
 Matrix getP()
          permutation matrix.
 Matrix getU()
          upper triangular matrix U.
 boolean isInvertible()
          A is regular if and only if U is which depends upon whether there is a 0 on the diagonal.
 boolean isRegular()
          Deprecated. Since Orbital1.1 use isInvertible() instead.
 int linearRank()
          Rank of the matrix.
 Vector solve(Vector b)
          Solve LES A.b.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LUDecomposition

protected LUDecomposition(Matrix A,
                          Matrix P,
                          boolean sign)
Gaussian LU-decomposition implementation. Such that P.A = L.U

Preconditions:
A.isSquare()
Method Detail

decompose

public static LUDecomposition decompose(Matrix M)
Get the Gaussian LU-decomposition of a matrix. Such that P.A = L.U

Number of multiplications is 1/3*(n3-n)

Preconditions:
M.isSquare()

isInvertible

public boolean isInvertible()
                     throws java.lang.ArithmeticException
A is regular if and only if U is which depends upon whether there is a 0 on the diagonal.

Throws:
java.lang.ArithmeticException
See Also:
Matrix.isInvertible()

isRegular

public boolean isRegular()
                  throws java.lang.ArithmeticException
Deprecated. Since Orbital1.1 use isInvertible() instead.

Throws:
java.lang.ArithmeticException

linearRank

public int linearRank()
Rank of the matrix. i.e. the number of non-zero elements on the diagonal of U.

See Also:
Matrix.linearRank()

det

public Arithmetic det()
The determinant of A.

det A = (-1)p*det U where p = sign P is the number of permutations in P. Since det(P)*det(A) = det(P.A) = det(L.U) = det(L)*det(U) = det(U).

See Also:
Matrix.det()

getL

public Matrix getL()
lower triangular matrix L with diagonal 1s.

Because of pivotising for numberical stability, this matrix only contains values with an absolute =<1.


getU

public Matrix getU()
upper triangular matrix U.


getP

public Matrix getP()
permutation matrix.


solve

public Vector solve(Vector b)
Solve LES A.b.

Implementation solves L.z = P.b per forward-substitution, and then solves R.x = z per backward-substitution.

Returns:
x such that A.x = b.

Orbital library
1.2.0: 23 Apr 2008

Copyright © 1996-2006 André Platzer
All Rights Reserved.