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

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

public abstract class CholeskyDecomposition<N extends Number>
extends Object
implements Cholesky<N>


Field Summary
static boolean DEBUG
           
 
Method Summary
 boolean compute(MatrixStore<N> aStore)
           
 boolean computeWithCheck(MatrixStore<N> aStore)
           
 boolean equals(MatrixDecomposition<N> aDecomp, NumberContext aCntxt)
           
 boolean equals(MatrixStore<N> aStore, NumberContext aCntxt)
           
 boolean equals(Object someObj)
           
 N getDeterminant()
           
 MatrixStore<N> getInverse()
          The output must be a "right inverse" and a "generalised inverse".
 MatrixStore<N> getL()
           
 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 isAspectRatioNormal()
           
 boolean isComputed()
           
 boolean isFullSize()
           
 boolean isSolvable()
           
 boolean isSPD()
          To use the Cholesky decomposition rather than the LU decomposition the matrix must be symmetric and positive definite.
static Cholesky<BigDecimal> makeBig()
           
static Cholesky<ComplexNumber> makeComplex()
           
static Cholesky<Double> makeJama()
           
static Cholesky<Double> makePrimitive()
           
 MatrixStore<N> reconstruct()
           
 void reset()
          Delete computed results, and resets attributes to default values
 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
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.ojalgo.matrix.decomposition.MatrixDecomposition
equals, invert, isComputed, solve
 

Field Detail

DEBUG

public static boolean DEBUG
Method Detail

makeBig

public static final Cholesky<BigDecimal> makeBig()

makeComplex

public static final Cholesky<ComplexNumber> makeComplex()

makeJama

public static final Cholesky<Double> makeJama()

makePrimitive

public static final Cholesky<Double> makePrimitive()

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

computeWithCheck

public boolean computeWithCheck(MatrixStore<N> aStore)
Specified by:
computeWithCheck in interface Cholesky<N extends Number>

equals

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

getDeterminant

public N getDeterminant()
Specified by:
getDeterminant in interface Cholesky<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 Cholesky<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.

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()

isSPD

public boolean isSPD()
Description copied from interface: Cholesky
To use the Cholesky decomposition rather than the LU decomposition the matrix must be symmetric and positive definite. It is recommended that the decomposition algorithm checks for this during calculation. Possibly the matrix could be assumed to be symmetric (to improve performance) but tests should be made to assure the matrix is positive definite.

Specified by:
isSPD in interface Cholesky<N extends Number>
Returns:
true if the tests did not fail.

reconstruct

public MatrixStore<N> reconstruct()
Specified by:
reconstruct in interface MatrixDecomposition<N extends Number>

reset

public void reset()
Description copied from interface: MatrixDecomposition
Delete computed results, and resets attributes to default values

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 final boolean equals(MatrixDecomposition<N> aDecomp,
                            NumberContext aCntxt)
Specified by:
equals in interface MatrixDecomposition<N extends Number>

equals

public boolean equals(Object someObj)
Overrides:
equals in class Object

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>

isAspectRatioNormal

public final boolean isAspectRatioNormal()

isComputed

public final 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]