org.ojalgo.matrix.jama
Class JamaCholesky

java.lang.Object
  extended by org.ojalgo.matrix.jama.JamaCholesky
All Implemented Interfaces:
Cholesky<Double>, MatrixDecomposition<Double>

public final class JamaCholesky
extends Object
implements Cholesky<Double>

This class adapts JAMA's CholeskyDecomposition to ojAlgo's Cholesky interface.

Author:
apete

Constructor Summary
JamaCholesky()
          Not recommended to use this constructor directly.
 
Method Summary
 boolean compute(Access2D<?> aStore)
           
 boolean computeWithCheck(MatrixStore<?> aStore)
           
 boolean computeWithoutPivoting(MatrixStore<?> aStore)
           
 boolean equals(MatrixDecomposition<Double> aDecomp, NumberContext aCntxt)
           
 boolean equals(MatrixStore<Double> aStore, NumberContext aCntxt)
           
 JamaMatrix getD()
           
 Double getDeterminant()
           
 JamaMatrix getInverse()
          The output must be a "right inverse" and a "generalised inverse".
 MatrixStore<Double> getInverse(DecompositionStore<Double> preallocated)
          Makes no use of preallocated at all.
 JamaMatrix getL()
           
 JamaMatrix getOldL()
           
 JamaMatrix getOldU()
           
 JamaMatrix getP()
           
 int[] getPivotOrder()
           
 JamaMatrix getR()
           
 int getRank()
           
 JamaMatrix getRowEchelonForm()
           
 JamaMatrix invert(MatrixStore<Double> aStore)
           
 boolean isAspectRatioNormal()
           
 boolean isComputed()
           
 boolean isFullSize()
           
 boolean isSingular()
           
 boolean isSolvable()
           
 boolean isSPD()
          To use the Cholesky decomposition rather than the LU decomposition the matrix must be symmetric and positive definite.
 boolean isSquareAndNotSingular()
           
 MatrixStore<Double> reconstruct()
           
 void reset()
          Delete computed results, and resets attributes to default values
 JamaMatrix solve(MatrixStore<Double> aRHS)
          [A][X]=[B] or [this][return]=[aRHS]
 JamaMatrix solve(MatrixStore<Double> aRHS, DecompositionStore<Double> preallocated)
          Makes no use of preallocated at all.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.ojalgo.matrix.decomposition.MatrixDecomposition
compute, equals, getInverse, solve, solve
 

Constructor Detail

JamaCholesky

public JamaCholesky()
Not recommended to use this constructor directly. Consider using the static factory method CholeskyDecomposition.makeJama() instead.

Method Detail

computeWithCheck

public boolean computeWithCheck(MatrixStore<?> aStore)
Specified by:
computeWithCheck in interface Cholesky<Double>

computeWithoutPivoting

public boolean computeWithoutPivoting(MatrixStore<?> aStore)

equals

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

getD

public JamaMatrix getD()

getDeterminant

public Double getDeterminant()
Specified by:
getDeterminant in interface Cholesky<Double>

getInverse

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

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

getL

public JamaMatrix getL()
Specified by:
getL in interface Cholesky<Double>

getOldL

public JamaMatrix getOldL()

getOldU

public JamaMatrix getOldU()

getP

public JamaMatrix getP()

getPivotOrder

public int[] getPivotOrder()

getR

public JamaMatrix getR()

getRank

public int getRank()

getRowEchelonForm

public JamaMatrix getRowEchelonForm()

isAspectRatioNormal

public boolean isAspectRatioNormal()

isComputed

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

isFullSize

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

isSingular

public boolean isSingular()

isSolvable

public boolean isSolvable()
Specified by:
isSolvable in interface MatrixDecomposition<Double>
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<Double>
Returns:
true if the tests did not fail.

isSquareAndNotSingular

public boolean isSquareAndNotSingular()

reconstruct

public MatrixStore<Double> reconstruct()
Specified by:
reconstruct in interface MatrixDecomposition<Double>

reset

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

Specified by:
reset in interface MatrixDecomposition<Double>

toString

public String toString()
Overrides:
toString in class Object

compute

public final boolean compute(Access2D<?> aStore)
Specified by:
compute in interface MatrixDecomposition<Double>
Parameters:
aStore - A matrix to decompose
Returns:
true if the computation suceeded; false if not

equals

public final boolean equals(MatrixDecomposition<Double> aDecomp,
                            NumberContext aCntxt)
Specified by:
equals in interface MatrixDecomposition<Double>

getInverse

public final MatrixStore<Double> getInverse(DecompositionStore<Double> preallocated)
Makes no use of preallocated at all. Simply delegates to getInverse().

Specified by:
getInverse in interface MatrixDecomposition<Double>
Parameters:
preallocated - Preallocated memory for the results, possibly some intermediate results. You must assume this is modified, but you cannot assume it will contain the full/final/correct solution.
Returns:
The inverse
See Also:
MatrixDecomposition.getInverse(org.ojalgo.matrix.decomposition.DecompositionStore)

invert

public final JamaMatrix invert(MatrixStore<Double> aStore)

solve

public JamaMatrix solve(MatrixStore<Double> aRHS)
Description copied from interface: MatrixDecomposition
[A][X]=[B] or [this][return]=[aRHS]

Specified by:
solve in interface MatrixDecomposition<Double>

solve

public final JamaMatrix solve(MatrixStore<Double> aRHS,
                              DecompositionStore<Double> preallocated)
Makes no use of preallocated at all. Simply delegates to solve(MatrixStore).

Specified by:
solve in interface MatrixDecomposition<Double>
Parameters:
aRHS - The Right Hand Side, wont be modfied
preallocated - Preallocated memory for the results, possibly some intermediate results. You must assume this is modified, but you cannot assume it will contain the full/final/correct solution.
Returns:
The solution
See Also:
MatrixDecomposition.solve(org.ojalgo.matrix.store.MatrixStore, org.ojalgo.matrix.decomposition.DecompositionStore)