public final class JamaSingularValue extends Object implements SingularValue<Double>
InverterTask.Factory<N extends Number>
SolverTask.Factory<N extends Number>
BIG, COMPLEX, PRIMITIVE
BIG, COMPLEX, PRIMITIVE
Constructor and Description |
---|
JamaSingularValue()
Not recommended to use this constructor directly.
|
Modifier and Type | Method and Description |
---|---|
boolean |
compute(Access2D<?> aStore) |
boolean |
compute(Access2D<?> matrix,
boolean singularValuesOnly,
boolean fullSize) |
boolean |
equals(MatrixDecomposition<Double> other,
NumberContext context) |
boolean |
equals(MatrixStore<Double> aStore,
NumberContext context) |
double |
getCondition()
The condition number.
|
JamaMatrix |
getD() |
double |
getFrobeniusNorm()
Sometimes also called the Schatten 2-norm or Hilbert-Schmidt norm.
|
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. |
double |
getKyFanNorm(int k)
Ky Fan k-norm.
|
double |
getOperatorNorm() |
JamaMatrix |
getQ1()
If [A] is m-by-n and its rank is r, then:
The first r columns of [Q1] span the column space, range or image of [A].
The last m-r columns of [Q1] span the left nullspace or cokernel of [A].
Calculating the QR decomposition of [A] is a faster alternative.
|
JamaMatrix |
getQ2()
If [A] is m-by-n and its rank is r, then:
The first r columns of [Q2] span the row space or coimage of [A].
The last n-r columns of [Q2] span the nullspace or kernel of [A].
Calculating the QR decomposition of [A]T is a faster alternative.
|
int |
getRank()
Effective numerical matrix rank.
|
Array1D<Double> |
getSingularValues() |
double |
getTraceNorm() |
MatrixStore<Double> |
invert(MatrixStore<Double> original)
The output must be a "right inverse" and a "generalised inverse".
|
MatrixStore<Double> |
invert(MatrixStore<Double> original,
DecompositionStore<Double> preallocated)
Implementiong this method is optional.
|
boolean |
isAspectRatioNormal() |
boolean |
isComputed() |
boolean |
isFullSize() |
boolean |
isOrdered() |
boolean |
isSolvable() |
DecompositionStore<Double> |
preallocate(Access2D<Double> template)
Implementiong this method is optional.
|
DecompositionStore<Double> |
preallocate(Access2D<Double> templateBody,
Access2D<Double> templateRHS)
Implementiong this method is optional.
|
MatrixStore<Double> |
reconstruct() |
void |
reset()
Delete computed results, and resets attributes to default values
|
JamaMatrix |
solve(Access2D<Double> rhs)
Internally this implementation uses the pseudoinverse that is recreated
with every call.
|
MatrixStore<Double> |
solve(Access2D<Double> body,
Access2D<Double> rhs)
[A][X]=[B] or [this][return]=[aRHS]
|
MatrixStore<Double> |
solve(Access2D<Double> body,
Access2D<Double> rhs,
DecompositionStore<Double> preallocated)
Implementiong this method is optional.
|
JamaMatrix |
solve(Access2D<Double> rhs,
DecompositionStore<Double> preallocated)
Makes no use of
preallocated at all. |
String |
toString() |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
compute, equals, getInverse, preallocate, solve
invert, invert, preallocate
solve, solve
public JamaSingularValue()
public boolean compute(Access2D<?> matrix, boolean singularValuesOnly, boolean fullSize)
compute
in interface SingularValue<Double>
matrix
- A matrix to decomposesingularValuesOnly
- No need to calculate eigenvectorsfullSize
- TODOpublic boolean equals(MatrixStore<Double> aStore, NumberContext context)
equals
in interface MatrixDecomposition<Double>
public double getCondition()
SingularValue
getCondition
in interface SingularValue<Double>
public JamaMatrix getD()
getD
in interface SingularValue<Double>
public double getFrobeniusNorm()
SingularValue
getFrobeniusNorm
in interface SingularValue<Double>
public JamaMatrix getInverse()
MatrixDecomposition
getInverse
in interface MatrixDecomposition<Double>
BasicMatrix.invert()
public double getKyFanNorm(int k)
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).
getKyFanNorm
in interface SingularValue<Double>
k
- The number of singular values to add up.public double getOperatorNorm()
getOperatorNorm
in interface SingularValue<Double>
public JamaMatrix getQ1()
SingularValue
getQ1
in interface SingularValue<Double>
public JamaMatrix getQ2()
SingularValue
getQ2
in interface SingularValue<Double>
public int getRank()
SingularValue
getRank
in interface SingularValue<Double>
public Array1D<Double> getSingularValues()
getSingularValues
in interface SingularValue<Double>
public double getTraceNorm()
getTraceNorm
in interface SingularValue<Double>
public boolean isAspectRatioNormal()
public boolean isComputed()
isComputed
in interface MatrixDecomposition<Double>
MatrixDecomposition.compute(Access2D)
,
MatrixDecomposition.isSolvable()
public boolean isFullSize()
isFullSize
in interface MatrixDecomposition<Double>
public boolean isOrdered()
isOrdered
in interface SingularValue<Double>
public boolean isSolvable()
isSolvable
in interface MatrixDecomposition<Double>
MatrixDecomposition.solve(Access2D)
,
MatrixDecomposition.isComputed()
public MatrixStore<Double> reconstruct()
reconstruct
in interface MatrixDecomposition<Double>
public void reset()
MatrixDecomposition
reset
in interface MatrixDecomposition<Double>
public JamaMatrix solve(Access2D<Double> rhs)
solve
in interface MatrixDecomposition<Double>
public final boolean compute(Access2D<?> aStore)
compute
in interface MatrixDecomposition<Double>
aStore
- A matrix to decomposepublic final boolean equals(MatrixDecomposition<Double> other, NumberContext context)
equals
in interface MatrixDecomposition<Double>
public final MatrixStore<Double> getInverse(DecompositionStore<Double> preallocated)
preallocated
at all. Simply delegates to getInverse()
.getInverse
in interface MatrixDecomposition<Double>
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.MatrixDecomposition.getInverse(org.ojalgo.matrix.decomposition.DecompositionStore)
public final MatrixStore<Double> invert(MatrixStore<Double> original)
InverterTask
invert
in interface InverterTask<Double>
BasicMatrix.invert()
public final MatrixStore<Double> invert(MatrixStore<Double> original, DecompositionStore<Double> preallocated)
InverterTask
Implementiong this method is optional.
Exactly how a specific implementation makes use of preallocated
is not specified by this interface.
It must be documented for each implementation.
Should produce the same results as calling #getInverse()
.
invert
in interface InverterTask<Double>
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.public final DecompositionStore<Double> preallocate(Access2D<Double> template)
InverterTask
Implementiong this method is optional.
Will create a DecompositionStore instance suitable for use with#solve(Access2D, DecompositionStore)
. When solving an equation system [A][X]=[B] ([mxn][nxb]=[mxb]) the
preallocated memory/matrix will typically be either mxb or nxb (if A is square then there is no doubt).preallocate
in interface InverterTask<Double>
public final DecompositionStore<Double> preallocate(Access2D<Double> templateBody, Access2D<Double> templateRHS)
MatrixDecomposition
Implementiong this method is optional.
Will create a DecompositionStore instance suitable for use withMatrixDecomposition.solve(Access2D, DecompositionStore)
. When solving an equation system [A][X]=[B] ([mxn][nxb]=[mxb]) the
preallocated memory/matrix will typically be either mxb or nxb (if A is square then there is no doubt).preallocate
in interface MatrixDecomposition<Double>
preallocate
in interface SolverTask<Double>
public final MatrixStore<Double> solve(Access2D<Double> body, Access2D<Double> rhs)
SolverTask
solve
in interface SolverTask<Double>
public final MatrixStore<Double> solve(Access2D<Double> body, Access2D<Double> rhs, DecompositionStore<Double> preallocated)
SolverTask
Implementiong this method is optional.
Exactly how a specific implementation makes use of preallocated
is not specified by this interface.
It must be documented for each implementation.
Should produce the same results as calling #solve(Access2D)
.
solve
in interface SolverTask<Double>
rhs
- The Right Hand Side, wont be modfiedpreallocated
- 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.public final JamaMatrix solve(Access2D<Double> rhs, DecompositionStore<Double> preallocated)
preallocated
at all. Simply delegates to solve(Access2D)
.solve
in interface MatrixDecomposition<Double>
rhs
- The Right Hand Side, wont be modfiedpreallocated
- 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.MatrixDecomposition.solve(Access2D,
org.ojalgo.matrix.decomposition.DecompositionStore)