Package org.ojalgo.optimisation.convex
Class ConvexSolver.Configuration
- java.lang.Object
-
- org.ojalgo.optimisation.convex.ConvexSolver.Configuration
-
- Enclosing class:
- ConvexSolver
public static final class ConvexSolver.Configuration extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
myExtendedPrecision
private NumberContext
myIterative
private double
mySmallDiagonal
private java.util.function.Function<Structure2D,MatrixDecomposition.Solver<java.lang.Double>>
mySolverGeneral
private java.util.function.Function<Structure2D,MatrixDecomposition.Solver<java.lang.Double>>
mySolverSPD
-
Constructor Summary
Constructors Constructor Description Configuration()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConvexSolver.Configuration
extendedPrecision(boolean extendedPrecision)
With extended precision the usual solver is wrapped by a master algorithm, implemented inQuadruple
precision, that iteratively refines (zoom and shift) the problem to be solved by the delegate solver.boolean
isExtendedPrecision()
NumberContext
iterative()
ConvexSolver.Configuration
iterative(NumberContext accuracy)
The accuracy of the iterative Schur complement solver used inIterativeASS
.MatrixDecomposition.Solver<java.lang.Double>
newSolverGeneral(Structure2D structure)
MatrixDecomposition.Solver<java.lang.Double>
newSolverSPD(Structure2D structure)
double
smallDiagonal()
ConvexSolver.Configuration
smallDiagonal(double factor)
The [Q] matrix (of quadratic terms) is "inverted" using a matrix decomposition returned bynewSolverSPD(Structure2D)
.ConvexSolver.Configuration
solverGeneral(java.util.function.Function<Structure2D,MatrixDecomposition.Solver<java.lang.Double>> factory)
This matrix decomposition should be able to "invert" the full KKT systsem body matrix (which is symmetric) and/or its Schur complement with regards to the [Q] matrix (of quadratic terms).ConvexSolver.Configuration
solverSPD(java.util.function.Function<Structure2D,MatrixDecomposition.Solver<java.lang.Double>> factory)
The [Q] matrix (of quadratic terms) is supposed to be symmetric positive definite (or at least semidefinite), but in reality there are usually many deficiencies.
-
-
-
Field Detail
-
myExtendedPrecision
private boolean myExtendedPrecision
-
myIterative
private NumberContext myIterative
-
mySmallDiagonal
private double mySmallDiagonal
-
mySolverGeneral
private java.util.function.Function<Structure2D,MatrixDecomposition.Solver<java.lang.Double>> mySolverGeneral
-
mySolverSPD
private java.util.function.Function<Structure2D,MatrixDecomposition.Solver<java.lang.Double>> mySolverSPD
-
-
Method Detail
-
extendedPrecision
public ConvexSolver.Configuration extendedPrecision(boolean extendedPrecision)
With extended precision the usual solver is wrapped by a master algorithm, implemented inQuadruple
precision, that iteratively refines (zoom and shift) the problem to be solved by the delegate solver. This enables to handle constraints with very high accuracy.The iterative refinement solver cannot handle general inequality constraints, only simple variable bounds (modelled as inequality constraints).
This is an experimental feature!
-
isExtendedPrecision
public boolean isExtendedPrecision()
-
iterative
public NumberContext iterative()
-
iterative
public ConvexSolver.Configuration iterative(NumberContext accuracy)
The accuracy of the iterative Schur complement solver used inIterativeASS
. This is the step that calculates the Lagrange multipliers (dual variables). The iterative solver used is aConjugateGradientSolver
.
-
newSolverGeneral
public MatrixDecomposition.Solver<java.lang.Double> newSolverGeneral(Structure2D structure)
-
newSolverSPD
public MatrixDecomposition.Solver<java.lang.Double> newSolverSPD(Structure2D structure)
-
smallDiagonal
public double smallDiagonal()
-
smallDiagonal
public ConvexSolver.Configuration smallDiagonal(double factor)
The [Q] matrix (of quadratic terms) is "inverted" using a matrix decomposition returned bynewSolverSPD(Structure2D)
. If, after decomposition,MatrixDecomposition.Solver.isSolvable()
returns false a small constant is added to the diagonal.The small constant will be the largest absolute element times this small diagonal factor.
This is only meant to handle minor, unexpected, deficiencies.
-
solverGeneral
public ConvexSolver.Configuration solverGeneral(java.util.function.Function<Structure2D,MatrixDecomposition.Solver<java.lang.Double>> factory)
This matrix decomposition should be able to "invert" the full KKT systsem body matrix (which is symmetric) and/or its Schur complement with regards to the [Q] matrix (of quadratic terms).
-
solverSPD
public ConvexSolver.Configuration solverSPD(java.util.function.Function<Structure2D,MatrixDecomposition.Solver<java.lang.Double>> factory)
The [Q] matrix (of quadratic terms) is supposed to be symmetric positive definite (or at least semidefinite), but in reality there are usually many deficiencies. This matrix decomposition should handle "inverting" the [Q] matrix.
-
-