Class SingularValueDecomposition<N extends java.lang.Comparable<N>>
- java.lang.Object
-
- org.ojalgo.matrix.decomposition.AbstractDecomposition<N>
-
- org.ojalgo.matrix.decomposition.GenericDecomposition<N>
-
- org.ojalgo.matrix.decomposition.SingularValueDecomposition<N>
-
- All Implemented Interfaces:
MatrixDecomposition<N>
,MatrixDecomposition.EconomySize<N>
,MatrixDecomposition.Ordered<N>
,MatrixDecomposition.RankRevealing<N>
,MatrixDecomposition.Solver<N>
,MatrixDecomposition.Values<N>
,SingularValue<N>
,Provider2D
,Provider2D.Condition
,Provider2D.Inverse<java.util.Optional<MatrixStore<N>>>
,Provider2D.Rank
,Provider2D.Solution<java.util.Optional<MatrixStore<N>>>
,InverterTask<N>
,MatrixTask<N>
,SolverTask<N>
,InvertibleFactor<N>
,Structure1D
,Structure2D
- Direct Known Subclasses:
SingularValueDecomposition.C128
,SingularValueDecomposition.H256
,SingularValueDecomposition.Q128
,SingularValueDecomposition.R064
,SingularValueDecomposition.R128
abstract class SingularValueDecomposition<N extends java.lang.Comparable<N>> extends GenericDecomposition<N> implements SingularValue<N>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
SingularValueDecomposition.C128
(package private) static class
SingularValueDecomposition.H256
(package private) static class
SingularValueDecomposition.Q128
(package private) static class
SingularValueDecomposition.R064
(package private) static class
SingularValueDecomposition.R128
-
Nested classes/interfaces inherited from interface org.ojalgo.matrix.transformation.InvertibleFactor
InvertibleFactor.IdentityFactor<N extends java.lang.Comparable<N>>
-
Nested classes/interfaces inherited from interface org.ojalgo.matrix.decomposition.MatrixDecomposition
MatrixDecomposition.Determinant<N extends java.lang.Comparable<N>>, MatrixDecomposition.EconomySize<N extends java.lang.Comparable<N>>, MatrixDecomposition.Factory<D extends MatrixDecomposition<?>>, MatrixDecomposition.Hermitian<N extends java.lang.Comparable<N>>, MatrixDecomposition.Ordered<N extends java.lang.Comparable<N>>, MatrixDecomposition.Pivoting<N extends java.lang.Comparable<N>>, MatrixDecomposition.RankRevealing<N extends java.lang.Comparable<N>>, MatrixDecomposition.Solver<N extends java.lang.Comparable<N>>, MatrixDecomposition.Values<N extends java.lang.Comparable<N>>
-
Nested classes/interfaces inherited from interface org.ojalgo.matrix.Provider2D
Provider2D.Condition, Provider2D.Determinant<N extends java.lang.Comparable<N>>, Provider2D.Eigenpairs, Provider2D.Hermitian, Provider2D.Inverse<M>, Provider2D.Rank, Provider2D.Solution<M>, Provider2D.Symmetric, Provider2D.Trace<N extends java.lang.Comparable<N>>
-
Nested classes/interfaces inherited from interface org.ojalgo.matrix.decomposition.SingularValue
SingularValue.Factory<N extends java.lang.Comparable<N>>
-
Nested classes/interfaces inherited from interface org.ojalgo.structure.Structure1D
Structure1D.BasicMapper<T>, Structure1D.IndexMapper<T>, Structure1D.IntIndex, Structure1D.LongIndex, Structure1D.LoopCallback
-
Nested classes/interfaces inherited from interface org.ojalgo.structure.Structure2D
Structure2D.IntRowColumn, Structure2D.Logical<S extends Structure2D,B extends Structure2D.Logical<S,B>>, Structure2D.LongRowColumn, Structure2D.ReducibleTo1D<R extends Structure1D>, Structure2D.Reshapable, Structure2D.RowColumnKey<R,C>, Structure2D.RowColumnMapper<R,C>
-
-
Field Summary
Fields Modifier and Type Field Description private double[]
e
private BidiagonalDecomposition<N>
myBidiagonal
private MatrixStore<N>
myD
private boolean
myFullSize
private Structure2D
myInputStructure
private MatrixStore<N>
myInverse
private Array1D<java.lang.Double>
mySingularValues
private boolean
myTransposed
private MatrixStore<N>
myU
private MatrixStore<N>
myV
private boolean
myValuesOnly
private double[]
s
private static double
TINY
≈ 1.6E-291-
Fields inherited from interface org.ojalgo.matrix.decomposition.MatrixDecomposition
TYPICAL
-
-
Constructor Summary
Constructors Modifier Constructor Description private
SingularValueDecomposition(PhysicalStore.Factory<N,? extends DecompositionStore<N>> factory)
protected
SingularValueDecomposition(PhysicalStore.Factory<N,? extends DecompositionStore<N>> factory, BidiagonalDecomposition<N> bidiagonal, boolean fullSize)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
btran(PhysicalStore<N> arg)
Backwards-transformationprotected boolean
checkSolvability()
protected boolean
compute(Access2D.Collectable<N,? super PhysicalStore<N>> matrix, boolean valuesOnly, boolean fullSize)
protected boolean
computeBidiagonal(Access2D.Collectable<N,? super PhysicalStore<N>> matrix, boolean fullSize)
boolean
computeValuesOnly(Access2D.Collectable<N,? super PhysicalStore<N>> matrix)
int
countSignificant(double threshold)
boolean
decompose(Access2D.Collectable<N,? super PhysicalStore<N>> matrix)
private static void
doCase1(double[] s, double[] e, int p, int k, RotateRight q2RotR)
private static void
doCase2(double[] s, double[] e, int p, int k, RotateRight mtrxQ1)
private static void
doCase3(double[] s, double[] e, int p, int k, RotateRight q1RotR, RotateRight q2RotR)
private static void
doCase4(double[] s, int k, NegateColumn q2NegCol, ExchangeColumns q1XchgCols, ExchangeColumns q2XchgCols)
protected boolean
doCompute(Access2D.Collectable<N,? super PhysicalStore<N>> matrix, boolean valuesOnly, boolean fullSize)
int
getColDim()
double
getCondition()
The condition number.MatrixStore<N>
getCovariance()
MatrixStore<N>
getD()
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".MatrixStore<N>
getInverse(PhysicalStore<N> preallocated)
Implementing this method is optional.private MatrixStore<N>
getInverseOldVersion(DecompositionStore<N> preallocated)
double
getKyFanNorm(int k)
Ky Fan k-norm.double
getOperatorNorm()
double
getRankThreshold()
int
getRowDim()
Array1D<java.lang.Double>
getSingularValues()
MatrixStore<N>
getSolution(Access2D.Collectable<N,? super PhysicalStore<N>> rhs)
[A][X]=[B] or [this][return]=[rhs]MatrixStore<N>
getSolution(Access2D.Collectable<N,? super PhysicalStore<N>> rhs, PhysicalStore<N> preallocated)
Implementing this method is optional.double
getTraceNorm()
MatrixStore<N>
getU()
If [A] is m-by-n and its rank is r, then: The first r columns of [U] span the column space, range or image of [A]. The last m-r columns of [U] span the left nullspace or cokernel of [A]. Calculating the QR decomposition of [A] is a faster alternative.MatrixStore<N>
getV()
If [A] is m-by-n and its rank is r, then: The first r columns of [V] span the row space or coimage of [A]. The last n-r columns of [V] span the nullspace or kernel of [A]. Calculating the QR decomposition of [A]T is a faster alternative.MatrixStore<N>
invert(Access2D<?> original)
The output must be a "right inverse" and a "generalised inverse".MatrixStore<N>
invert(Access2D<?> original, PhysicalStore<N> preallocated)
Exactly how (if at all) a specific implementation makes use ofpreallocated
is not specified by this interface.boolean
isFullRank()
boolean
isFullSize()
boolean
isOrdered()
This is a property of the algorithm/implementation, not the data.boolean
isSolvable()
Please note that producing a pseudoinverse and/or a least squares solution is ok! The return value, of this method, is not an indication of if the decomposed matrix is square, has full rank, is postive definite or whatever.protected boolean
isTransposed()
protected MatrixStore<N>
makeD()
protected Array1D<java.lang.Double>
makeSingularValues()
PhysicalStore<N>
preallocate(Structure2D template)
Will create a PhysicalStore instance suitable for use withInverterTask.invert(Access2D, PhysicalStore)
.PhysicalStore<N>
preallocate(Structure2D templateBody, Structure2D templateRHS)
Will create a PhysicalStore instance suitable for use withSolverTask.solve(Access2D, Access2D, PhysicalStore)
.void
reset()
Delete computed results, and resets attributes to default values(package private) void
setD(MatrixStore<N> someD)
(package private) void
setSingularValues(Array1D<java.lang.Double> singularValues)
MatrixStore<N>
solve(Access2D<?> body, Access2D<?> rhs)
[A][X]=[B] or [body][return]=[rhs]MatrixStore<N>
solve(Access2D<?> body, Access2D<?> rhs, PhysicalStore<N> preallocated)
Exactly how (if at all) a specific implementation makes use ofpreallocated
is not specified by this interface.(package private) static void
toDiagonal(double[] s, double[] e, RotateRight q1RotR, RotateRight q2RotR, ExchangeColumns q1XchgCols, ExchangeColumns q2XchgCols, NegateColumn q2NegCol)
-
Methods inherited from class org.ojalgo.matrix.decomposition.GenericDecomposition
aggregator, allocate, collect, copy, function, makeArray, makeDiagonal, makeEye, makeHouseholder, makeIdentity, makeRotation, makeRotation, makeZero, makeZero, scalar, wrap
-
Methods inherited from class org.ojalgo.matrix.decomposition.AbstractDecomposition
computed, countColumns, countRows, getDimensionalEpsilon, isAspectRatioNormal, isComputed
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.ojalgo.matrix.task.InverterTask
preallocate
-
Methods inherited from interface org.ojalgo.matrix.transformation.InvertibleFactor
btran
-
Methods inherited from interface org.ojalgo.matrix.decomposition.MatrixDecomposition
isComputed
-
Methods inherited from interface org.ojalgo.matrix.decomposition.MatrixDecomposition.RankRevealing
getRank
-
Methods inherited from interface org.ojalgo.matrix.decomposition.MatrixDecomposition.Solver
compute, ftran, ftran, invert, solve, toInverseProvider, toSolutionProvider
-
Methods inherited from interface org.ojalgo.matrix.decomposition.SingularValue
getSingularValues, reconstruct, reconstruct
-
Methods inherited from interface org.ojalgo.matrix.task.SolverTask
preallocate
-
Methods inherited from interface org.ojalgo.structure.Structure2D
count, countColumns, countRows, firstInColumn, firstInRow, getMaxDim, getMinDim, isEmpty, isFat, isScalar, isSquare, isTall, isVector, limitOfColumn, limitOfRow, size
-
-
-
-
Field Detail
-
TINY
private static final double TINY
≈ 1.6E-291
-
e
private double[] e
-
myBidiagonal
private final BidiagonalDecomposition<N extends java.lang.Comparable<N>> myBidiagonal
-
myD
private transient MatrixStore<N extends java.lang.Comparable<N>> myD
-
myFullSize
private final boolean myFullSize
-
myInputStructure
private final Structure2D myInputStructure
-
myInverse
private transient MatrixStore<N extends java.lang.Comparable<N>> myInverse
-
mySingularValues
private transient Array1D<java.lang.Double> mySingularValues
-
myTransposed
private boolean myTransposed
-
myU
private transient MatrixStore<N extends java.lang.Comparable<N>> myU
-
myV
private transient MatrixStore<N extends java.lang.Comparable<N>> myV
-
myValuesOnly
private boolean myValuesOnly
-
s
private double[] s
-
-
Constructor Detail
-
SingularValueDecomposition
private SingularValueDecomposition(PhysicalStore.Factory<N,? extends DecompositionStore<N>> factory)
-
SingularValueDecomposition
protected SingularValueDecomposition(PhysicalStore.Factory<N,? extends DecompositionStore<N>> factory, BidiagonalDecomposition<N> bidiagonal, boolean fullSize)
-
-
Method Detail
-
doCase1
private static void doCase1(double[] s, double[] e, int p, int k, RotateRight q2RotR)
-
doCase2
private static void doCase2(double[] s, double[] e, int p, int k, RotateRight mtrxQ1)
-
doCase3
private static void doCase3(double[] s, double[] e, int p, int k, RotateRight q1RotR, RotateRight q2RotR)
-
doCase4
private static void doCase4(double[] s, int k, NegateColumn q2NegCol, ExchangeColumns q1XchgCols, ExchangeColumns q2XchgCols)
-
toDiagonal
static void toDiagonal(double[] s, double[] e, RotateRight q1RotR, RotateRight q2RotR, ExchangeColumns q1XchgCols, ExchangeColumns q2XchgCols, NegateColumn q2NegCol)
-
btran
public final void btran(PhysicalStore<N> arg)
Description copied from interface:InvertibleFactor
Backwards-transformationSolve [x]T[A] = [b]T (equivalent to [A]T[x] = [b]) by transforming [b] into [x] in-place.
- Specified by:
btran
in interfaceInvertibleFactor<N extends java.lang.Comparable<N>>
- Parameters:
arg
- [b] transformed into [x]
-
computeValuesOnly
public boolean computeValuesOnly(Access2D.Collectable<N,? super PhysicalStore<N>> matrix)
- Specified by:
computeValuesOnly
in interfaceMatrixDecomposition.Values<N extends java.lang.Comparable<N>>
- Parameters:
matrix
- The matrix to decompose- Returns:
- The same as
MatrixDecomposition.Solver.compute(Collectable)
orMatrixDecomposition.decompose(Collectable)
if the instance does not implementMatrixDecomposition.Solver
.
-
countSignificant
public int countSignificant(double threshold)
- Specified by:
countSignificant
in interfaceMatrixDecomposition.RankRevealing<N extends java.lang.Comparable<N>>
- Parameters:
threshold
- Significance limit- Returns:
- The number of elements in the diagonal matrix that are greater than the threshold
-
decompose
public boolean decompose(Access2D.Collectable<N,? super PhysicalStore<N>> matrix)
- Specified by:
decompose
in interfaceMatrixDecomposition<N extends java.lang.Comparable<N>>
- Parameters:
matrix
- A matrix to decompose- Returns:
- true if decomposition suceeded; false if not
-
getColDim
public int getColDim()
- Specified by:
getColDim
in interfaceStructure2D
- Returns:
- The number of columns
-
getCondition
public double getCondition()
Description copied from interface:SingularValue
The condition number.- Specified by:
getCondition
in interfaceProvider2D.Condition
- Specified by:
getCondition
in interfaceSingularValue<N extends java.lang.Comparable<N>>
- Returns:
- The largest singular value divided by the smallest singular value.
-
getCovariance
public MatrixStore<N> getCovariance()
- Specified by:
getCovariance
in interfaceSingularValue<N extends java.lang.Comparable<N>>
- Returns:
- [[A]T[A]]-1 Where [A] is the original matrix.
-
getD
public MatrixStore<N> getD()
- Specified by:
getD
in interfaceSingularValue<N extends java.lang.Comparable<N>>
- Returns:
- The diagonal matrix of singular values.
-
getFrobeniusNorm
public double getFrobeniusNorm()
Description copied from interface:SingularValue
Sometimes also called the Schatten 2-norm or Hilbert-Schmidt norm.- Specified by:
getFrobeniusNorm
in interfaceSingularValue<N extends java.lang.Comparable<N>>
- Returns:
- The square root of the sum of squares of the singular values.
-
getInverse
public MatrixStore<N> getInverse()
Description copied from interface:MatrixDecomposition.Solver
The output must be a "right inverse" and a "generalised inverse".- Specified by:
getInverse
in interfaceMatrixDecomposition.Solver<N extends java.lang.Comparable<N>>
-
getInverse
public MatrixStore<N> getInverse(PhysicalStore<N> preallocated)
Description copied from interface:MatrixDecomposition.Solver
Implementing 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
MatrixDecomposition.Solver.getInverse()
.- Specified by:
getInverse
in interfaceMatrixDecomposition.Solver<N extends java.lang.Comparable<N>>
- 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. UseInverterTask.preallocate(int, int)
orInverterTask.preallocate(Structure2D)
to get a suitable instance.- Returns:
- The inverse, this is where you get the solution
-
getKyFanNorm
public 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 interfaceSingularValue<N extends java.lang.Comparable<N>>
- Parameters:
k
- The number of singular values to add up.- Returns:
- The sum of the k largest singular values.
-
getOperatorNorm
public double getOperatorNorm()
- Specified by:
getOperatorNorm
in interfaceSingularValue<N extends java.lang.Comparable<N>>
- Returns:
- 2-norm
-
getRankThreshold
public double getRankThreshold()
- Specified by:
getRankThreshold
in interfaceMatrixDecomposition.RankRevealing<N extends java.lang.Comparable<N>>
-
getRowDim
public int getRowDim()
- Specified by:
getRowDim
in interfaceStructure2D
- Returns:
- The number of rows
-
getSingularValues
public Array1D<java.lang.Double> getSingularValues()
- Specified by:
getSingularValues
in interfaceSingularValue<N extends java.lang.Comparable<N>>
- Returns:
- The singular values ordered in descending order.
-
getSolution
public MatrixStore<N> getSolution(Access2D.Collectable<N,? super PhysicalStore<N>> rhs)
Description copied from interface:MatrixDecomposition.Solver
[A][X]=[B] or [this][return]=[rhs]- Specified by:
getSolution
in interfaceMatrixDecomposition.Solver<N extends java.lang.Comparable<N>>
-
getSolution
public MatrixStore<N> getSolution(Access2D.Collectable<N,? super PhysicalStore<N>> rhs, PhysicalStore<N> preallocated)
Description copied from interface:MatrixDecomposition.Solver
Implementing 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
MatrixDecomposition.Solver.getSolution(Collectable)
.- Specified by:
getSolution
in interfaceMatrixDecomposition.Solver<N extends java.lang.Comparable<N>>
- Parameters:
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. UseSolverTask.preallocate(int, int, int)
orSolverTask.preallocate(Structure2D, Structure2D)
to get a suitable instance.- Returns:
- The solution
-
getTraceNorm
public double getTraceNorm()
- Specified by:
getTraceNorm
in interfaceSingularValue<N extends java.lang.Comparable<N>>
-
getU
public MatrixStore<N> getU()
Description copied from interface:SingularValue
If [A] is m-by-n and its rank is r, then:- The first r columns of [U] span the column space, range or image of [A].
- The last m-r columns of [U] span the left nullspace or cokernel of [A].
- Specified by:
getU
in interfaceSingularValue<N extends java.lang.Comparable<N>>
-
getV
public MatrixStore<N> getV()
Description copied from interface:SingularValue
If [A] is m-by-n and its rank is r, then:- The first r columns of [V] span the row space or coimage of [A].
- The last n-r columns of [V] span the nullspace or kernel of [A].
- Specified by:
getV
in interfaceSingularValue<N extends java.lang.Comparable<N>>
-
invert
public MatrixStore<N> invert(Access2D<?> original) throws RecoverableCondition
Description copied from interface:InverterTask
The output must be a "right inverse" and a "generalised inverse".- Specified by:
invert
in interfaceInverterTask<N extends java.lang.Comparable<N>>
- Throws:
RecoverableCondition
-
invert
public MatrixStore<N> invert(Access2D<?> original, PhysicalStore<N> preallocated) throws RecoverableCondition
Description copied from interface:InverterTask
Exactly how (if at all) 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
InverterTask.invert(Access2D)
.Use
InverterTask.preallocate(Structure2D)
to obtain a suitbalepreallocated
.- Specified by:
invert
in interfaceInverterTask<N extends java.lang.Comparable<N>>
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/ /correct solution.- Returns:
- The inverse
- Throws:
RecoverableCondition
- TODO
-
isFullRank
public boolean isFullRank()
- Specified by:
isFullRank
in interfaceMatrixDecomposition.RankRevealing<N extends java.lang.Comparable<N>>
- Returns:
- true if the rank is equal to the minimum of the row and column dimensions; false if not
-
isFullSize
public boolean isFullSize()
- Specified by:
isFullSize
in interfaceMatrixDecomposition.EconomySize<N extends java.lang.Comparable<N>>
- Returns:
- True if it will generate a full sized decomposition.
-
isOrdered
public boolean isOrdered()
Description copied from interface:MatrixDecomposition.Ordered
This is a property of the algorithm/implementation, not the data. Typically relevant forSingularValue
,Eigenvalue
or anyMatrixDecomposition.RankRevealing
decomposition.- Specified by:
isOrdered
in interfaceMatrixDecomposition.Ordered<N extends java.lang.Comparable<N>>
- Returns:
- true if the rows/columns of the returned matrix factors are guaranteed some specific order; false if there is no such guarantee.
-
isSolvable
public boolean isSolvable()
Description copied from interface:MatrixDecomposition.Solver
Please note that producing a pseudoinverse and/or a least squares solution is ok! The return value, of this method, is not an indication of if the decomposed matrix is square, has full rank, is postive definite or whatever. It's that in combination with the specific decomposition algorithm's capabilities.- Specified by:
isSolvable
in interfaceMatrixDecomposition.Solver<N extends java.lang.Comparable<N>>
- Overrides:
isSolvable
in classAbstractDecomposition<N extends java.lang.Comparable<N>>
- Returns:
- true if this matrix decomposition is in a state to be able to deliver an inverse or an equation system solution (with some degree of numerical stability).
-
preallocate
public PhysicalStore<N> preallocate(Structure2D template)
Description copied from interface:InverterTask
Will create a PhysicalStore instance suitable for use with
InverterTask.invert(Access2D, PhysicalStore)
.When inverting a matrix (mxn) the preallocated memory/matrix will typically be nxm (and of course most of the time A is square).
- Specified by:
preallocate
in interfaceInverterTask<N extends java.lang.Comparable<N>>
-
preallocate
public PhysicalStore<N> preallocate(Structure2D templateBody, Structure2D templateRHS)
Description copied from interface:SolverTask
Will create a PhysicalStore instance suitable for use with
SolverTask.solve(Access2D, Access2D, PhysicalStore)
. The dimensions of the returned instance is not specified by this interface - it is specified by the behaviour/requirements of each implementation.When solving an equation system [A][X]=[B] ([mxn][nxb]=[mxb]) the preallocated memory/matrix will typically be either mxb or nxb.
- Specified by:
preallocate
in interfaceSolverTask<N extends java.lang.Comparable<N>>
-
reset
public void reset()
Description copied from interface:MatrixDecomposition
Delete computed results, and resets attributes to default values- Specified by:
reset
in interfaceMatrixDecomposition<N extends java.lang.Comparable<N>>
- Overrides:
reset
in classAbstractDecomposition<N extends java.lang.Comparable<N>>
-
solve
public MatrixStore<N> solve(Access2D<?> body, Access2D<?> rhs) throws RecoverableCondition
Description copied from interface:SolverTask
[A][X]=[B] or [body][return]=[rhs]- Specified by:
solve
in interfaceSolverTask<N extends java.lang.Comparable<N>>
- Throws:
RecoverableCondition
-
solve
public MatrixStore<N> solve(Access2D<?> body, Access2D<?> rhs, PhysicalStore<N> preallocated) throws RecoverableCondition
Description copied from interface:SolverTask
Exactly how (if at all) 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
SolverTask.solve(Access2D, Access2D)
.Use
SolverTask.preallocate(Structure2D, Structure2D)
to obtain a suitbalepreallocated
.- Specified by:
solve
in interfaceSolverTask<N extends java.lang.Comparable<N>>
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/ /correct solution.- Returns:
- The solution
- Throws:
RecoverableCondition
-
getInverseOldVersion
private MatrixStore<N> getInverseOldVersion(DecompositionStore<N> preallocated)
-
checkSolvability
protected boolean checkSolvability()
- Overrides:
checkSolvability
in classAbstractDecomposition<N extends java.lang.Comparable<N>>
-
compute
protected boolean compute(Access2D.Collectable<N,? super PhysicalStore<N>> matrix, boolean valuesOnly, boolean fullSize)
-
computeBidiagonal
protected boolean computeBidiagonal(Access2D.Collectable<N,? super PhysicalStore<N>> matrix, boolean fullSize)
-
doCompute
protected boolean doCompute(Access2D.Collectable<N,? super PhysicalStore<N>> matrix, boolean valuesOnly, boolean fullSize)
-
isTransposed
protected boolean isTransposed()
-
makeD
protected MatrixStore<N> makeD()
-
makeSingularValues
protected Array1D<java.lang.Double> makeSingularValues()
-
setD
void setD(MatrixStore<N> someD)
-
setSingularValues
void setSingularValues(Array1D<java.lang.Double> singularValues)
-
-