Module ojalgo
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 Subinterfaces:
Cholesky<N>,Eigenvalue.Spectral<N>,LDL<N>,LDU<N>,LU<N>,QR<N>,SingularValue<N>
- All Known Implementing Classes:
DenseCholesky,DenseCholesky.C128,DenseCholesky.H256,DenseCholesky.Q128,DenseCholesky.R064,DenseCholesky.R128,DenseLDL,DenseLDL.C128,DenseLDL.H256,DenseLDL.Q128,DenseLDL.R064,DenseLDL.R128,DenseLU,DenseLU.C128,DenseLU.H256,DenseLU.Q128,DenseLU.R064,DenseLU.R128,DenseQR,DenseQR.C128,DenseQR.H256,DenseQR.Q128,DenseQR.R064,DenseQR.R128,DenseSingularValue,DenseSingularValue.C128,DenseSingularValue.H256,DenseSingularValue.Q128,DenseSingularValue.R064,DenseSingularValue.R128,HermitianEvD,HermitianEvD.C128,HermitianEvD.H256,HermitianEvD.Q128,HermitianEvD.R064,HermitianEvD.R128,RawCholesky,RawEigenvalue.Symmetric,RawLU,RawQR,RawSingularValue,SparseLU
- 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.Updatable<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 booleancompute(Access2D.Collectable<N,? super TransformableRegion<N>> matrix)default 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.default 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()booleanisSolvable()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 PhysicalStore<N>preallocate(int nbRows, int nbCols)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
-
Methods inherited from interface org.ojalgo.matrix.transformation.InvertibleFactor
btran, ftran
-
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 TransformableRegion<N>> matrix)
- Parameters:
matrix- A matrix to decompose- Returns:
- true if the decomposition suceeded AND
isSolvable(); false if not
-
getInverse
default 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
preallocatedis 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. Usepreallocate(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
default 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
preallocatedis 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:
invertin 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).
-
preallocate
default PhysicalStore<N> preallocate(int nbRows, int nbCols)
- Specified by:
preallocatein interfaceInverterTask<N extends java.lang.Comparable<N>>
-
solve
default java.util.Optional<MatrixStore<N>> solve(Access2D<?> rhs)
- Specified by:
solvein 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:
toInverseProviderin 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:
toSolutionProviderin interfaceSolverTask<N extends java.lang.Comparable<N>>
-
-