org.ojalgo.matrix.jama
Class JamaQR

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

public final class JamaQR
extends Object
implements QR<Double>

JamaQR

Author:
apete

Constructor Summary
JamaQR()
           
 
Method Summary
 boolean compute(MatrixStore<Double> aStore)
           
 boolean equals(BasicMatrix aMtrx, NumberContext aCntxt)
           
 boolean equals(MatrixStore<Double> aStore, NumberContext aCntxt)
           
 JamaMatrix getInverse()
          The output must be a "right inverse" and a "generalised inverse".
 JamaMatrix getQ()
           
 JamaMatrix getR()
           
 int getRank()
           
 MatrixStore<Double> invert(MatrixStore<Double> 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 isFullRank()
          The QR decompostion always exists, even if the matrix does not have full rank, so the compute method will never fail.
 boolean isFullSize()
           
 boolean isSolvable()
           
 void reset()
           
 JamaMatrix solve(MatrixStore<Double> aRHS)
           
 Future<DecomposeAndSolve<Double>> solve(MatrixStore<Double> aBody, MatrixStore<Double> aRHS)
          Will solve [aBody][X]=[aRHS] concurrently by first calling MatrixDecomposition.compute(MatrixStore) using [aBody], and then MatrixDecomposition.solve(MatrixStore) using [aRHS].
 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, invert, solve, solve
 

Constructor Detail

JamaQR

public JamaQR()
Method Detail

equals

public boolean equals(MatrixStore<Double> aStore,
                      NumberContext aCntxt)
Specified by:
equals in interface MatrixDecomposition<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()

getQ

public JamaMatrix getQ()
Specified by:
getQ in interface QR<Double>

getR

public JamaMatrix getR()
Specified by:
getR in interface QR<Double>

getRank

public int getRank()
Specified by:
getRank in interface QR<Double>

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

isFullRank

public boolean isFullRank()
Description copied from interface: QR
The QR decompostion always exists, even if the matrix does not have full rank, so the compute method will never fail. The primary use of the QR decomposition is in the least squares solution of nonsquare systems of simultaneous linear equations. This will fail if the matrix does not have full rank.

Specified by:
isFullRank in interface QR<Double>

isFullSize

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

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

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)
Specified by:
equals in interface MatrixDecomposition<Double>

invert

public final MatrixStore<Double> 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 body
aRHS - The equation system right hand side
Returns:
The matrix decomposition and the equation system solution, [X]