org.ojalgo.matrix.jama
Class JamaCholesky
java.lang.Object
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
JamaCholesky
public JamaCholesky()
computeWithCheck
public boolean computeWithCheck(MatrixStore<Double> aStore)
- Specified by:
computeWithCheck in interface Cholesky<Double>
computeWithoutPivoting
public boolean computeWithoutPivoting(MatrixStore<Double> 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()
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(MatrixStore),
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()
reset
public void reset()
- Specified by:
reset in interface MatrixDecomposition<Double>
toString
public String toString()
- Overrides:
toString in class Object
compute
public final boolean compute(MatrixStore<Double> 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(BasicMatrix aMtrx,
NumberContext aCntxt)
equals
public boolean equals(MatrixDecomposition<Double> aDecomp,
NumberContext aCntxt)
- Specified by:
equals in interface MatrixDecomposition<Double>
invert
public final JamaMatrix invert(MatrixStore<Double> 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<Double>
solve
public JamaMatrix solve(MatrixStore<Double> aRHS)
- Specified by:
solve in interface MatrixDecomposition<Double>
solve
public final Future<DecomposeAndSolve<Double>> solve(MatrixStore<Double> aBody,
MatrixStore<Double> 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<Double>
- Parameters:
aBody - The equation system bodyaRHS - The equation system right hand side
- Returns:
- The matrix decomposition and the equation system solution, [X]