Package org.ojalgo.matrix.decomposition
Interface MatrixDecomposition.Solver<N extends Comparable<N>>
- All Superinterfaces:
InverterTask<N>
,InvertibleFactor<N>
,MatrixDecomposition<N>
,MatrixTask<N>
,Provider2D
,Provider2D.Inverse<Optional<MatrixStore<N>>>
,Provider2D.Solution<Optional<MatrixStore<N>>>
,SolverTask<N>
,Structure1D
,Structure2D
- All Known Implementing Classes:
CholeskyDecomposition
,CholeskyDecomposition.C128
,CholeskyDecomposition.H256
,CholeskyDecomposition.Q128
,CholeskyDecomposition.R064
,CholeskyDecomposition.R128
,HermitianEvD
,HermitianEvD.C128
,HermitianEvD.H256
,HermitianEvD.Q128
,HermitianEvD.R064
,HermitianEvD.R128
,LDLDecomposition
,LDLDecomposition.C128
,LDLDecomposition.H256
,LDLDecomposition.Q128
,LDLDecomposition.R064
,LDLDecomposition.R128
,LUDecomposition
,LUDecomposition.C128
,LUDecomposition.H256
,LUDecomposition.Q128
,LUDecomposition.R064
,LUDecomposition.R128
,QRDecomposition
,QRDecomposition.C128
,QRDecomposition.H256
,QRDecomposition.Q128
,QRDecomposition.R064
,QRDecomposition.R128
,RawCholesky
,RawEigenvalue.Symmetric
,RawLU
,RawQR
,RawSingularValue
,SingularValueDecomposition
,SingularValueDecomposition.C128
,SingularValueDecomposition.H256
,SingularValueDecomposition.Q128
,SingularValueDecomposition.R064
,SingularValueDecomposition.R128
- Enclosing interface:
MatrixDecomposition<N extends Comparable<N>>
public static interface MatrixDecomposition.Solver<N extends Comparable<N>>
extends MatrixDecomposition<N>, SolverTask<N>, InverterTask<N>, Provider2D.Inverse<Optional<MatrixStore<N>>>, Provider2D.Solution<Optional<MatrixStore<N>>>, InvertibleFactor<N>
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.ojalgo.matrix.task.InverterTask
InverterTask.Factory<N extends Comparable<N>>
Nested classes/interfaces inherited from interface org.ojalgo.matrix.transformation.InvertibleFactor
InvertibleFactor.IdentityFactor<N extends Comparable<N>>
Nested classes/interfaces inherited from interface org.ojalgo.matrix.decomposition.MatrixDecomposition
MatrixDecomposition.Determinant<N extends Comparable<N>>, MatrixDecomposition.EconomySize<N extends Comparable<N>>, MatrixDecomposition.Factory<D extends MatrixDecomposition<?>>, MatrixDecomposition.Hermitian<N extends Comparable<N>>, MatrixDecomposition.Ordered<N extends Comparable<N>>, MatrixDecomposition.Pivoting<N extends Comparable<N>>, MatrixDecomposition.RankRevealing<N extends Comparable<N>>, MatrixDecomposition.Solver<N extends Comparable<N>>, MatrixDecomposition.Values<N extends Comparable<N>>
Nested classes/interfaces inherited from interface org.ojalgo.matrix.Provider2D
Provider2D.Condition, Provider2D.Determinant<N extends Comparable<N>>, Provider2D.Eigenpairs, Provider2D.Hermitian, Provider2D.Inverse<M>, Provider2D.Rank, Provider2D.Solution<M>, Provider2D.Symmetric, Provider2D.Trace<N extends Comparable<N>>
Nested classes/interfaces inherited from interface org.ojalgo.matrix.task.SolverTask
SolverTask.Factory<N extends 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 inherited from interface org.ojalgo.matrix.decomposition.MatrixDecomposition
TYPICAL
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
compute
(Access2D.Collectable<N, ? super PhysicalStore<N>> matrix) default void
ftran
(PhysicalStore<N> arg) Forward-transformationdefault void
ftran
(Access2D.Collectable<N, ? super PhysicalStore<N>> rhs, PhysicalStore<N> solution) The output must be a "right inverse" and a "generalised inverse".getInverse
(PhysicalStore<N> preallocated) Implementing this method is optional.getSolution
(Access2D.Collectable<N, ? super PhysicalStore<N>> rhs) [A][X]=[B] or [this][return]=[rhs]getSolution
(Access2D.Collectable<N, ? super PhysicalStore<N>> rhs, PhysicalStore<N> preallocated) Implementing this method is optional.default Optional
<MatrixStore<N>> invert()
boolean
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.default Optional
<MatrixStore<N>> default Provider2D.Inverse
<Optional<MatrixStore<N>>> toInverseProvider
(ElementsSupplier<N> original, Supplier<MatrixStore<N>> alternativeOriginalSupplier) default Provider2D.Solution
<Optional<MatrixStore<N>>> toSolutionProvider
(ElementsSupplier<N> body, Supplier<MatrixStore<N>> alternativeBodySupplier, Access2D<?> rhs) Methods inherited from interface org.ojalgo.matrix.task.InverterTask
invert, invert, preallocate, preallocate
Methods inherited from interface org.ojalgo.matrix.transformation.InvertibleFactor
btran, btran
Methods inherited from interface org.ojalgo.matrix.decomposition.MatrixDecomposition
decompose, isComputed, reconstruct, reset
Methods inherited from interface org.ojalgo.matrix.task.SolverTask
preallocate, preallocate, solve, solve
Methods inherited from interface org.ojalgo.structure.Structure2D
count, countColumns, countRows, firstInColumn, firstInRow, getColDim, getMaxDim, getMinDim, getRowDim, isEmpty, isFat, isScalar, isSquare, isTall, isVector, limitOfColumn, limitOfRow, size
-
Method Details
-
compute
- Parameters:
matrix
- A matrix to decompose- Returns:
- true if the decomposition suceeded AND
isSolvable()
; false if not
-
ftran
- Specified by:
ftran
in interfaceInvertibleFactor<N extends Comparable<N>>
-
ftran
Description copied from interface:InvertibleFactor
Forward-transformationSolve [A][x] = [b] by transforming [b] into [x] in-place.
- Specified by:
ftran
in interfaceInvertibleFactor<N extends Comparable<N>>
- Parameters:
arg
- [b] transformed into [x]
-
getInverse
MatrixStore<N> getInverse()The output must be a "right inverse" and a "generalised inverse". -
getInverse
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
getInverse()
.- 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
- Throws:
UnsupportedOperationException
- When/if this feature is not implemented
-
getSolution
[A][X]=[B] or [this][return]=[rhs] -
getSolution
MatrixStore<N> getSolution(Access2D.Collectable<N, ? super PhysicalStore<N>> rhs, PhysicalStore<N> preallocated) 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
getSolution(Collectable)
.- 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
- Throws:
UnsupportedOperationException
- When/if this feature is not implemented
-
invert
- Specified by:
invert
in interfaceProvider2D.Inverse<N extends Comparable<N>>
-
isSolvable
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. It's that in combination with the specific decomposition algorithm's capabilities.- 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).
-
solve
- Specified by:
solve
in interfaceProvider2D.Solution<N extends Comparable<N>>
-
toInverseProvider
default Provider2D.Inverse<Optional<MatrixStore<N>>> toInverseProvider(ElementsSupplier<N> original, Supplier<MatrixStore<N>> alternativeOriginalSupplier) - Specified by:
toInverseProvider
in interfaceInverterTask<N extends Comparable<N>>
-
toSolutionProvider
default Provider2D.Solution<Optional<MatrixStore<N>>> toSolutionProvider(ElementsSupplier<N> body, Supplier<MatrixStore<N>> alternativeBodySupplier, Access2D<?> rhs) - Specified by:
toSolutionProvider
in interfaceSolverTask<N extends Comparable<N>>
-