JADE v6.1

com.dautelle.math
Class LUDecomposition

java.lang.Object
  extended bycom.dautelle.realtime.RealtimeObject
      extended bycom.dautelle.math.LUDecomposition
All Implemented Interfaces:
Realtime, java.io.Serializable

public final class LUDecomposition
extends RealtimeObject

This class represents the decomposition of a Matrix into a product of lower and upper triangular matrices (L and U, respectively).

This decomposition is typically used to resolve linear systems of equations (Gaussian elimination) or to calculate the determinant of a square Matrix (O(n³)).

Numerical stability is guaranteed through pivoting if the Operable elements of this matrix are derived from java.lang.Number. For others elements types, numerical stability can be ensured by setting the appropriate pivot comparator (see setPivotComparator(java.util.Comparator)).

Instances of this class are created using the Matrix.lu() factory methods.

Version:
6.0, April 28, 2004
Author:
Jean-Marie Dautelle
See Also:
LU Decomposition -- from MathWorld, Serialized Form

Nested Class Summary
 
Nested classes inherited from class com.dautelle.realtime.RealtimeObject
RealtimeObject.Factory
 
Field Summary
static java.util.Comparator NUMBER_COMPARATOR
          Holds the comparator for pivoting java.lang.Number instances.
 
Method Summary
 Operable determinant()
          Returns the determinant of the Matrix having this LUDecomposition.
 java.lang.Object export()
          Exports this object out of the current pool context.
 Matrix inverse()
          Returns the solution X of the equation: A * X = Identity with this = A.lu() using back and forward substitutions.
 void setPivotComparator(java.util.Comparator cmp)
          Sets the local comparator used for pivoting during LU decomposition (default NUMBER_COMPARATOR).
 Matrix solve(Matrix B)
          Returns the solution X of the equation: A * X = B with this = A.lu() using back and forward substitutions.
 java.lang.Object toHeap()
          Moves this object to the heap.
 
Methods inherited from class com.dautelle.realtime.RealtimeObject
clone, isLocalObject, isPoolObject, recycle
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NUMBER_COMPARATOR

public static final java.util.Comparator NUMBER_COMPARATOR
Holds the comparator for pivoting java.lang.Number instances.

Method Detail

setPivotComparator

public void setPivotComparator(java.util.Comparator cmp)
Sets the local comparator used for pivoting during LU decomposition (default NUMBER_COMPARATOR).

Parameters:
cmp - the comparator for pivoting.

solve

public Matrix solve(Matrix B)
Returns the solution X of the equation: A * X = B with this = A.lu() using back and forward substitutions.

Parameters:
B - the input vector.
Returns:
the solution X = (1 / A) * B.
Throws:
DimensionException - if A.getRowDimension() != B.getRowDimension().

inverse

public Matrix inverse()
Returns the solution X of the equation: A * X = Identity with this = A.lu() using back and forward substitutions. This method uses PoolContext internally.

Returns:
this.solve(Identity)

determinant

public Operable determinant()
Returns the determinant of the Matrix having this LUDecomposition.

Returns:
the determinant of the matrix source.

export

public java.lang.Object export()
Description copied from interface: Realtime
Exports this object out of the current pool context. Realtime members are exported as well (recursion). This method affects only objects belonging to the current pool context. To avoid pool depletion, a "free" object from the outer pool is moved to replace the object being exported.

Specified by:
export in interface Realtime
Overrides:
export in class RealtimeObject

toHeap

public java.lang.Object toHeap()
Description copied from interface: Realtime
Moves this object to the heap. Realtime members are moved to the heap as well (recursion). This method affects only objects belonging to a pool context (current or not).

Specified by:
toHeap in interface Realtime
Overrides:
toHeap in class RealtimeObject

JADE v6.1

Copyright © 2004 Jean-Marie Dautelle.