public abstract class ConvexSolver extends GenericSolver implements UpdatableSolver
min 1/2 [X]T[Q][X] - [C]T[X]
when [AE][X] == [BE]
and [AI][X] <= [BI]
The matrix [Q] is assumed to be symmetric (it must be made that way) and positive (semi)definite:
The general recommendation is to construct optimisation problems using ExpressionsBasedModel and not worry about solver details. If you do want to instantiate a convex solver directly use the ConvexSolver.Builder class. It will return an appropriate subclass for you.
When the KKT matrix is nonsingular, there is a unique optimal primal-dual pair (x,l). If the KKT matrix is singular, but the KKT system is still solvable, any solution yields an optimal pair (x,l). If the KKT system is not solvable, the quadratic optimization problem is unbounded below or infeasible.
Modifier and Type | Class and Description |
---|---|
static class |
ConvexSolver.Builder |
static class |
ConvexSolver.ModelIntegration |
Optimisation.Constraint, Optimisation.Integration<M extends Optimisation.Model,S extends Optimisation.Solver>, Optimisation.Model, Optimisation.Objective, Optimisation.Options, Optimisation.Result, Optimisation.Solver, Optimisation.State
ACCURACY, options
Modifier | Constructor and Description |
---|---|
protected |
ConvexSolver(ConvexSolver.Builder matrices,
Optimisation.Options solverOptions) |
buildResult, countIterations, countTime, error, getState, incrementIterationsCount, isIterationAllowed, isLogDebug, isLogOff, isLogProgress, log, log, resetIterationsCount, setState
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
fixVariable
solve
protected ConvexSolver(ConvexSolver.Builder matrices, Optimisation.Options solverOptions)
public static void copy(ExpressionsBasedModel sourceModel, ConvexSolver.Builder destinationBuilder)
public static ConvexSolver.Builder getBuilder()
public static ConvexSolver.Builder getBuilder(MatrixStore<Double> Q, MatrixStore<Double> C)
public void dispose()
Optimisation.Solver
dispose
in interface Optimisation.Solver
public final Optimisation.Result solve(Optimisation.Result kickStarter)
solve
in interface Optimisation.Solver
protected boolean computeGeneral(Access2D.Collectable<Double,? super PhysicalStore<Double>> matrix)
protected boolean computeQ(Access2D.Collectable<Double,? super PhysicalStore<Double>> matrix)
protected int countEqualityConstraints()
protected int countInequalityConstraints()
protected int countVariables()
protected double evaluateFunction(Access1D<?> solution)
evaluateFunction
in class GenericSolver
protected MatrixStore<Double> extractSolution()
GenericSolver
GenericSolver.evaluateFunction(Access1D)
.extractSolution
in class GenericSolver
protected abstract Access2D.Collectable<Double,? super PhysicalStore<Double>> getIterationKKT()
protected abstract Access2D.Collectable<Double,? super PhysicalStore<Double>> getIterationRHS()
protected MatrixStore<Double> getMatrixAE()
protected RowsSupplier<Double> getMatrixAI()
protected SparseArray<Double> getMatrixAI(int row)
protected RowsSupplier<Double> getMatrixAI(int[] rows)
protected MatrixStore<Double> getMatrixBE()
protected MatrixStore<Double> getMatrixBI()
protected double getMatrixBI(int row)
protected MatrixStore<Double> getMatrixBI(int[] selector)
protected MatrixStore<Double> getMatrixC()
protected PhysicalStore<Double> getMatrixQ()
protected int getRankGeneral()
protected MatrixStore<Double> getSE()
protected MatrixStore<Double> getSolutionGeneral(Access2D.Collectable<Double,? super PhysicalStore<Double>> rhs)
protected MatrixStore<Double> getSolutionGeneral(Access2D.Collectable<Double,? super PhysicalStore<Double>> rhs, PhysicalStore<Double> preallocated)
protected MatrixStore<Double> getSolutionQ(Access2D.Collectable<Double,? super PhysicalStore<Double>> rhs)
protected MatrixStore<Double> getSolutionQ(Access2D.Collectable<Double,? super PhysicalStore<Double>> rhs, PhysicalStore<Double> preallocated)
protected PhysicalStore<Double> getSolutionX()
protected boolean hasEqualityConstraints()
protected boolean hasInequalityConstraints()
protected boolean hasObjective()
protected boolean initialise(Optimisation.Result kickStarter)
protected boolean isSolvableGeneral()
protected boolean isSolvableQ()
protected abstract boolean needsAnotherIteration()
protected abstract void performIteration()
protected boolean solveFullKKT(PhysicalStore<Double> preallocated)
protected Optimisation.Result solveLP()
protected boolean validate()
Copyright © 2019 Optimatika. All rights reserved.