Class ConvexSolver.Configuration
- Enclosing class:
ConvexSolver
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate booleanprivate NumberContextprivate Supplier<Preconditioner> private Supplier<IterativeSolverTask> private Booleanprivate doubleprivate Function<Structure2D, MatrixDecomposition.Solver<Double>> private Function<Structure2D, MatrixDecomposition.Solver<Double>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncombinedScaleFactor(boolean combinedScaleFactor) Only relevant with extended precision.extendedPrecision(boolean extendedPrecision) With extended precision the usual solver is wrapped by a master algorithm, implemented inQuadrupleprecision, that iteratively refines (zoom and shift) the problem to be solved by the delegate solver.(package private) BooleanbooleanbooleanDeprecated.iterative(Supplier<IterativeSolverTask> solver, Supplier<Preconditioner> preconditioner) iterative(Supplier<IterativeSolverTask> solver, Supplier<Preconditioner> preconditioner, NumberContext accuracy) iterative(Supplier<IterativeSolverTask> solver, NumberContext accuracy) Select which iterative linear system solver to use for the Schur-complement step in IterativeASS.iterative(NumberContext accuracy) The accuracy of the iterative Schur complement solver used inIterativeASS.newIterativeSolver(int maxIterations) Returns a new iterative solver instance configured with the current accuracy, maximum iterations, and preconditioner settings.newSolverGeneral(Structure2D structure) newSolverSPD(Structure2D structure) projection(Boolean projection) Null-Space projection.doublesmallDiagonal(double factor) The [Q] matrix (of quadratic terms) is "inverted" using a matrix decomposition returned bynewSolverSPD(Structure2D).solverGeneral(Function<Structure2D, MatrixDecomposition.Solver<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(Function<Structure2D, MatrixDecomposition.Solver<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 Details
-
myCombinedScaleFactor
private boolean myCombinedScaleFactor -
myProjection
-
myExtendedPrecision
private boolean myExtendedPrecision -
myIterativeAccuracy
-
myIterativePreconditioner
-
myIterativeSolver
-
mySmallDiagonal
private double mySmallDiagonal -
mySolverGeneral
-
mySolverSPD
-
-
Constructor Details
-
Configuration
public Configuration()
-
-
Method Details
-
combinedScaleFactor
Only relevant with extended precision. With the extended precision solver the primal and dual variables are scaled (shift and zoom) to iteratively generate subproblems. In theory there are different scaling factors for the primal and dual variables, but forcing them to be the same enables simplifications resulting in significant performance gains.The default is to use the same scaling factor for both primal and dual variables. By setting this to false, you switch to a slower more complex, but theoretically more accurate and flexible algorithm.
- See Also:
-
extendedPrecision
With extended precision the usual solver is wrapped by a master algorithm, implemented inQuadrupleprecision, 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!
Setting this to true you should most likely also set the
Optimisation.Options.solutionto something matching that allows for higher precision. -
isCombinedScaleFactor
public boolean isCombinedScaleFactor() -
isExtendedPrecision
public boolean isExtendedPrecision() -
iterative
Deprecated.Since v56 It's applied for you when callingnewIterativeSolver(int) -
iterative
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. -
iterative
public ConvexSolver.Configuration iterative(Supplier<IterativeSolverTask> solver, NumberContext accuracy) Select which iterative linear system solver to use for the Schur-complement step in IterativeASS. Default isConjugateGradientSolver. You may set e.g. newQMRSolver(). -
iterative
public ConvexSolver.Configuration iterative(Supplier<IterativeSolverTask> solver, Supplier<Preconditioner> preconditioner) -
iterative
public ConvexSolver.Configuration iterative(Supplier<IterativeSolverTask> solver, Supplier<Preconditioner> preconditioner, NumberContext accuracy) -
newIterativeSolver
Returns a new iterative solver instance configured with the current accuracy, maximum iterations, and preconditioner settings. -
newSolverGeneral
-
newSolverSPD
-
projection
Null-Space projection. (Eliminating equality constraints and reducing the number of variables.)TRUE means yes, FALSE no, and NULL auto. Even if configured to TRUE there must also be both equality and inequality constraints for this to actually be used.
-
smallDiagonal
public double smallDiagonal() -
smallDiagonal
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(Function<Structure2D, MatrixDecomposition.Solver<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(Function<Structure2D, MatrixDecomposition.Solver<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. -
getProjection
Boolean getProjection()
-
newIterativeSolver(int)