org.ojalgo.matrix.decomposition
Class LUDecomposition<N extends Number>

java.lang.Object
  extended by org.ojalgo.matrix.decomposition.LUDecomposition<N>
All Implemented Interfaces:
LU<N>, MatrixDecomposition<N>

public abstract class LUDecomposition<N extends Number>
extends Object
implements LU<N>


Nested Class Summary
static interface LUDecomposition.LUStore<N extends Number>
           Only classes that will act as a delegate to LUDecomposition should implement this interface.
static class LUDecomposition.Pivot
           
 
Method Summary
 boolean compute(MatrixStore<N> aStore)
           
 boolean equals(BasicMatrix aMtrx, NumberContext aCntxt)
           
 boolean equals(MatrixStore<N> aStore, NumberContext aCntxt)
           
 MatrixStore<N> getD()
           
 N getDeterminant()
           
 MatrixStore<N> getInverse()
          The output must be a "right inverse" and a "generalised inverse".
 MatrixStore<N> getL()
           
 MatrixStore<N> getP()
           
 int[] getPivotOrder()
           
 int getRank()
           
 MatrixStore<N> getU()
           
 MatrixStore<N> invert(MatrixStore<N> aStore)
          A convenience method that produces exactly the same result as if you first call MatrixDecomposition.compute(MatrixStore) and then MatrixDecomposition.getInverse().
 boolean isComputed()
           
 boolean isFullSize()
           
 boolean isSingular()
           
 boolean isSolvable()
           
static LU<BigDecimal> makeBig()
           
static LU<ComplexNumber> makeComplex()
           
static LU<Double> makeDensePrimitive()
           
static LU<Double> makeJama()
           
static LU<Double> makeRawPrimitive()
           
 void reset()
           
 MatrixStore<N> solve(MatrixStore<N> aRHS)
          Solves [this][X] = [aRHS] by first solving
 Future<DecomposeAndSolve<N>> solve(MatrixStore<N> aBody, MatrixStore<N> aRHS)
          Will solve [aBody][X]=[aRHS] concurrently by first calling MatrixDecomposition.compute(MatrixStore) using [aBody], and then MatrixDecomposition.solve(MatrixStore) using [aRHS].
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.ojalgo.matrix.decomposition.MatrixDecomposition
equals, invert, isComputed, solve
 

Method Detail

makeBig

public static final LU<BigDecimal> makeBig()

makeComplex

public static final LU<ComplexNumber> makeComplex()

makeDensePrimitive

public static final LU<Double> makeDensePrimitive()

makeJama

public static final LU<Double> makeJama()

makeRawPrimitive

public static final LU<Double> makeRawPrimitive()

compute

public boolean compute(MatrixStore<N> aStore)
Specified by:
compute in interface MatrixDecomposition<N extends Number>
Parameters:
aStore - A matrix to decompose
Returns:
true if the computation suceeded; false if not

equals

public boolean equals(MatrixStore<N> aStore,
                      NumberContext aCntxt)
Specified by:
equals in interface MatrixDecomposition<N extends Number>

getD

public MatrixStore<N> getD()
Specified by:
getD in interface LU<N extends Number>

getDeterminant

public N getDeterminant()
Specified by:
getDeterminant in interface LU<N extends Number>

getInverse

public MatrixStore<N> getInverse()
Description copied from interface: MatrixDecomposition
The output must be a "right inverse" and a "generalised inverse".

Specified by:
getInverse in interface MatrixDecomposition<N extends Number>
See Also:
BasicMatrix.invert()

getL

public MatrixStore<N> getL()
Specified by:
getL in interface LU<N extends Number>

getP

public MatrixStore<N> getP()
Specified by:
getP in interface LU<N extends Number>

getPivotOrder

public int[] getPivotOrder()
Specified by:
getPivotOrder in interface LU<N extends Number>

getRank

public int getRank()
Specified by:
getRank in interface LU<N extends Number>

getU

public MatrixStore<N> getU()
Specified by:
getU in interface LU<N extends Number>

isFullSize

public final boolean isFullSize()
Specified by:
isFullSize in interface MatrixDecomposition<N extends Number>
Returns:
True if the implementation generates a full sized decomposition.

isSingular

public boolean isSingular()
Specified by:
isSingular in interface LU<N extends Number>

isSolvable

public boolean isSolvable()
Specified by:
isSolvable in interface MatrixDecomposition<N extends Number>
Returns:
true if it is ok to call MatrixDecomposition.solve(MatrixStore) (computation was successful); false if not
See Also:
MatrixDecomposition.solve(MatrixStore), MatrixDecomposition.isComputed()

reset

public void reset()
Specified by:
reset in interface MatrixDecomposition<N extends Number>

solve

public MatrixStore<N> solve(MatrixStore<N> aRHS)
Solves [this][X] = [aRHS] by first solving
[L][Y] = [aRHS]
and then
[U][X] = [Y]
.

Specified by:
solve in interface MatrixDecomposition<N extends Number>
Parameters:
aRHS - The right hand side
Returns:
[X]

equals

public boolean equals(BasicMatrix aMtrx,
                      NumberContext aCntxt)
Specified by:
equals in interface MatrixDecomposition<N extends Number>

invert

public final MatrixStore<N> invert(MatrixStore<N> aStore)
Description copied from interface: MatrixDecomposition
A convenience method that produces exactly the same result as if you first call MatrixDecomposition.compute(MatrixStore) and then MatrixDecomposition.getInverse().

Specified by:
invert in interface MatrixDecomposition<N extends Number>

isComputed

public boolean isComputed()
Specified by:
isComputed in interface MatrixDecomposition<N extends Number>
Returns:
true if computation has been attemped; false if not.
See Also:
MatrixDecomposition.compute(MatrixStore), MatrixDecomposition.isSolvable()

solve

public Future<DecomposeAndSolve<N>> solve(MatrixStore<N> aBody,
                                          MatrixStore<N> aRHS)
Description copied from interface: MatrixDecomposition
Will solve [aBody][X]=[aRHS] concurrently by first calling MatrixDecomposition.compute(MatrixStore) using [aBody], and then MatrixDecomposition.solve(MatrixStore) using [aRHS]. If either of the input [aBody] or [aRHS] is set to null the corresponing calculation is skipped.

Specified by:
solve in interface MatrixDecomposition<N extends Number>
Parameters:
aBody - The equation system body
aRHS - The equation system right hand side
Returns:
The matrix decomposition and the equation system solution, [X]