Module ojalgo
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 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 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.Updatable<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.LoopCallbackNested 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 booleancompute(Access2D.Collectable<N, ? super TransformableRegion<N>> matrix) default MatrixStore<N> The output must be a "right inverse" and a "generalised inverse".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]getSolution(Access2D.Collectable<N, ? super PhysicalStore<N>> rhs, PhysicalStore<N> preallocated) Implementing this method is optional.default Optional<MatrixStore<N>> invert()booleanPlease 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 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, preallocateMethods inherited from interface org.ojalgo.matrix.transformation.InvertibleFactor
btran, ftranMethods inherited from interface org.ojalgo.matrix.decomposition.MatrixDecomposition
decompose, isComputed, reconstruct, resetMethods inherited from interface org.ojalgo.matrix.task.SolverTask
preallocate, preallocate, solve, solveMethods 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
-
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
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:
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
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:
UnsupportedOperationException- When/if this feature is not implemented
-
invert
- Specified by:
invertin 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).
-
preallocate
- Specified by:
preallocatein interfaceInverterTask<N extends Comparable<N>>
-
solve
- Specified by:
solvein interfaceProvider2D.Solution<N extends Comparable<N>>
-
toInverseProvider
default Provider2D.Inverse<Optional<MatrixStore<N>>> toInverseProvider(ElementsSupplier<N> original, Supplier<MatrixStore<N>> alternativeOriginalSupplier) - Specified by:
toInverseProviderin interfaceInverterTask<N extends Comparable<N>>
-
toSolutionProvider
default Provider2D.Solution<Optional<MatrixStore<N>>> toSolutionProvider(ElementsSupplier<N> body, Supplier<MatrixStore<N>> alternativeBodySupplier, Access2D<?> rhs) - Specified by:
toSolutionProviderin interfaceSolverTask<N extends Comparable<N>>
-