Package org.ojalgo.matrix.decomposition
Interface MatrixDecomposition.Solver<N extends java.lang.Comparable<N>>
-
- All Superinterfaces:
InverterTask<N>
,InvertibleFactor<N>
,MatrixDecomposition<N>
,MatrixTask<N>
,Provider2D
,Provider2D.Inverse<java.util.Optional<MatrixStore<N>>>
,Provider2D.Solution<java.util.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 java.lang.Comparable<N>>
public static interface MatrixDecomposition.Solver<N extends java.lang.Comparable<N>> extends MatrixDecomposition<N>, SolverTask<N>, InverterTask<N>, Provider2D.Inverse<java.util.Optional<MatrixStore<N>>>, Provider2D.Solution<java.util.Optional<MatrixStore<N>>>, InvertibleFactor<N>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.ojalgo.matrix.task.InverterTask
InverterTask.Factory<N extends java.lang.Comparable<N>>
-
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.task.SolverTask
SolverTask.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 inherited from interface org.ojalgo.matrix.decomposition.MatrixDecomposition
TYPICAL
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default 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)
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.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.default java.util.Optional<MatrixStore<N>>
invert()
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.default java.util.Optional<MatrixStore<N>>
solve(Access2D<?> rhs)
default Provider2D.Inverse<java.util.Optional<MatrixStore<N>>>
toInverseProvider(ElementsSupplier<N> original, java.util.function.Supplier<MatrixStore<N>> alternativeOriginalSupplier)
default Provider2D.Solution<java.util.Optional<MatrixStore<N>>>
toSolutionProvider(ElementsSupplier<N> body, java.util.function.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 Detail
-
compute
default boolean compute(Access2D.Collectable<N,? super PhysicalStore<N>> matrix)
- Parameters:
matrix
- A matrix to decompose- Returns:
- true if the decomposition suceeded AND
isSolvable()
; false if not
-
ftran
default void ftran(Access2D.Collectable<N,? super PhysicalStore<N>> rhs, PhysicalStore<N> solution)
- Specified by:
ftran
in interfaceInvertibleFactor<N extends java.lang.Comparable<N>>
-
ftran
default void ftran(PhysicalStore<N> arg)
Description copied from interface:InvertibleFactor
Forward-transformationSolve [A][x] = [b] by transforming [b] into [x] in-place.
- Specified by:
ftran
in interfaceInvertibleFactor<N extends java.lang.Comparable<N>>
- Parameters:
arg
- [b] transformed into [x]
-
getInverse
MatrixStore<N> getInverse()
The output must be a "right inverse" and a "generalised inverse".
-
getInverse
MatrixStore<N> getInverse(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
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:
java.lang.UnsupportedOperationException
- When/if this feature is not implemented
-
getSolution
MatrixStore<N> getSolution(Access2D.Collectable<N,? super PhysicalStore<N>> rhs)
[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:
java.lang.UnsupportedOperationException
- When/if this feature is not implemented
-
invert
default java.util.Optional<MatrixStore<N>> invert()
- Specified by:
invert
in interfaceProvider2D.Inverse<N extends java.lang.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
default java.util.Optional<MatrixStore<N>> solve(Access2D<?> rhs)
- Specified by:
solve
in interfaceProvider2D.Solution<N extends java.lang.Comparable<N>>
-
toInverseProvider
default Provider2D.Inverse<java.util.Optional<MatrixStore<N>>> toInverseProvider(ElementsSupplier<N> original, java.util.function.Supplier<MatrixStore<N>> alternativeOriginalSupplier)
- Specified by:
toInverseProvider
in interfaceInverterTask<N extends java.lang.Comparable<N>>
-
toSolutionProvider
default Provider2D.Solution<java.util.Optional<MatrixStore<N>>> toSolutionProvider(ElementsSupplier<N> body, java.util.function.Supplier<MatrixStore<N>> alternativeBodySupplier, Access2D<?> rhs)
- Specified by:
toSolutionProvider
in interfaceSolverTask<N extends java.lang.Comparable<N>>
-
-