org.ojalgo.matrix.decomposition
Class SingularValueDecomposition<N extends Number & Comparable<N>>

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

public abstract class SingularValueDecomposition<N extends Number & Comparable<N>>
extends Object
implements SingularValue<N>


Field Summary
static boolean DEBUG
           
 
Method Summary
 boolean equals(MatrixDecomposition<N> aDecomp, NumberContext aCntxt)
           
 boolean equals(Object someObj)
           
 double getCondition()
          The condition number.
 double getFrobeniusNorm()
          Sometimes also called the Schatten 2-norm or Hilbert-Schmidt norm.
 MatrixStore<N> getInverse()
          The output must be a "right inverse" and a "generalised inverse".
 double getKyFanNorm(int k)
           Ky Fan k-norm.
 double getOperatorNorm()
           
 int getRank()
          Effective numerical matrix rank.
 double getTraceNorm()
           
 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()
           
static SingularValue<BigDecimal> makeAltBig()
           
static SingularValue<ComplexNumber> makeAltComplex()
           
static SingularValue<Double> makeAltPrimitive()
           
static SingularValue<BigDecimal> makeBig()
           
static SingularValue<ComplexNumber> makeComplex()
           
static SingularValue<Double> makeJama()
           
static SingularValue<Double> makePrimitive()
           
 void reset()
           
 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.SingularValue
getD, getQ1, getQ2, getSingularValues, isOrdered, isSorted
 
Methods inherited from interface org.ojalgo.matrix.decomposition.MatrixDecomposition
compute, equals, equals, invert, isComputed, isFullSize, isSolvable, solve, solve
 

Field Detail

DEBUG

public static boolean DEBUG
Method Detail

makeAltBig

public static final SingularValue<BigDecimal> makeAltBig()

makeAltComplex

public static final SingularValue<ComplexNumber> makeAltComplex()

makeAltPrimitive

public static final SingularValue<Double> makeAltPrimitive()

makeBig

public static final SingularValue<BigDecimal> makeBig()

makeComplex

public static final SingularValue<ComplexNumber> makeComplex()

makeJama

public static final SingularValue<Double> makeJama()

makePrimitive

public static final SingularValue<Double> makePrimitive()

getCondition

public final double getCondition()
Description copied from interface: SingularValue
The condition number.

Specified by:
getCondition in interface SingularValue<N extends Number & Comparable<N>>
Returns:
The largest singular value divided by the smallest singular value.

getFrobeniusNorm

public final double getFrobeniusNorm()
Description copied from interface: SingularValue
Sometimes also called the Schatten 2-norm or Hilbert-Schmidt norm.

Specified by:
getFrobeniusNorm in interface SingularValue<N extends Number & Comparable<N>>
Returns:
The square root of the sum of squares of the singular values.

getInverse

public final 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 & Comparable<N>>
See Also:
BasicMatrix.invert()

getKyFanNorm

public final double getKyFanNorm(int k)
Description copied from interface: SingularValue

Ky Fan k-norm.

The first Ky Fan k-norm is the operator norm (the largest singular value), and the last is called the trace norm (the sum of all singular values).

Specified by:
getKyFanNorm in interface SingularValue<N extends Number & Comparable<N>>
Parameters:
k - The number of singular values to add up.
Returns:
The sum of the k largest singular values.

getOperatorNorm

public final double getOperatorNorm()
Specified by:
getOperatorNorm in interface SingularValue<N extends Number & Comparable<N>>

getRank

public final int getRank()
Description copied from interface: SingularValue
Effective numerical matrix rank.

Specified by:
getRank in interface SingularValue<N extends Number & Comparable<N>>
Returns:
The number of nonnegligible singular values.

getTraceNorm

public final double getTraceNorm()
Specified by:
getTraceNorm in interface SingularValue<N extends Number & Comparable<N>>

reset

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

equals

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

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]