Package org.ojalgo.optimisation.convex
Class ActiveSetSolver
- java.lang.Object
-
- org.ojalgo.optimisation.GenericSolver
-
- org.ojalgo.optimisation.convex.ConvexSolver
-
- org.ojalgo.optimisation.convex.BasePrimitiveSolver
-
- org.ojalgo.optimisation.convex.ConstrainedSolver
-
- org.ojalgo.optimisation.convex.ActiveSetSolver
-
- All Implemented Interfaces:
Optimisation
,Optimisation.Solver
,UpdatableSolver
- Direct Known Subclasses:
DirectASS
,IterativeASS
abstract class ActiveSetSolver extends ConstrainedSolver
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.ojalgo.optimisation.convex.ConvexSolver
ConvexSolver.Builder, ConvexSolver.Configuration, ConvexSolver.ModelIntegration
-
Nested classes/interfaces inherited from interface org.ojalgo.optimisation.Optimisation
Optimisation.Constraint, Optimisation.ConstraintType, Optimisation.Integration<M extends Optimisation.Model,S extends Optimisation.Solver>, Optimisation.Model, Optimisation.Objective, Optimisation.Options, Optimisation.ProblemStructure, Optimisation.Result, Optimisation.Sense, Optimisation.Solver, Optimisation.State
-
-
Field Summary
Fields Modifier and Type Field Description private static NumberContext
ACC
private static NumberContext
FEASIBILITY
private static NumberContext
LAGRANGE
private IndexSelector
myActivator
private int
myConstraintToInclude
private int[]
myExcluded
private int[]
myIncluded
private MatrixStore<java.lang.Double>
myInvQC
private R064Store
myIterationX
private boolean
myShrinkSwitch
private R064Store
mySlackI
private static NumberContext
SLACK
private static NumberContext
SOLUTION
-
Fields inherited from class org.ojalgo.optimisation.convex.BasePrimitiveSolver
MATRIX_FACTORY
-
Fields inherited from class org.ojalgo.optimisation.convex.ConvexSolver
INTEGRATION
-
Fields inherited from class org.ojalgo.optimisation.GenericSolver
options
-
-
Constructor Summary
Constructors Constructor Description ActiveSetSolver(ConvexData<java.lang.Double> convexData, Optimisation.Options optimisationOptions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) boolean
checkFeasibility()
protected int
countExcluded()
protected int
countIncluded()
(package private) int
countIterationConstraints()
The number of rows inConstrainedSolver.getIterationA()
andConstrainedSolver.getIterationB()
without having to actually create them.protected void
exclude(int indexToExclude)
protected MatrixStore<java.lang.Double>
extractSolution()
(package private) int
getConstraintToInclude()
protected int[]
getExcluded()
protected int
getExcluded(int indexAmongExcluded)
protected int[]
getIncluded()
protected int
getIncluded(int indexAmongIncluded)
(package private) MatrixStore<java.lang.Double>
getInvQC()
(package private) MatrixStore<java.lang.Double>
getIterationA()
(package private) MatrixStore<java.lang.Double>
getIterationB()
(package private) MatrixStore<java.lang.Double>
getIterationC()
(package private) R064Store
getIterationX()
protected int
getLastExcluded()
protected int
getLastIncluded()
(package private) PhysicalStore<java.lang.Double>
getSlackI()
(package private) MatrixStore<java.lang.Double>
getSlackI(int[] rows)
(package private) void
handleIterationResults(boolean solved, R064Store iterX, int[] included, int[] excluded)
private void
handleIterationSolution(R064Store iterX, int[] excluded)
protected void
include(int indexToInclude)
protected boolean
initialise(Optimisation.Result kickStarter)
protected boolean
isIteratingPossible()
protected boolean
needsAnotherIteration()
(package private) void
resetActivator()
(package private) void
setConstraintToInclude(int constraintToInclude)
private void
shrink()
protected int
suggestConstraintToExclude()
Find the minimum (largest negative) lagrange multiplier - for the active inequalities - to potentially deactivate.protected int
suggestConstraintToInclude()
Find minimum (largest negative) slack - for the inactive inequalities - to potentially activate.private int
suggestUsingLagrangeMagnitude()
private int
suggestUsingVectorProjection()
protected java.lang.String
toActivatorString()
-
Methods inherited from class org.ojalgo.optimisation.convex.ConstrainedSolver
buildResult, getIterationKKT, getIterationL, getIterationQ, getIterationRHS, getSlackE, getSolutionL
-
Methods inherited from class org.ojalgo.optimisation.convex.BasePrimitiveSolver
builder, computeGeneral, countEqualityConstraints, countInequalityConstraints, countVariables, dispose, evaluateFunction, getEntityMap, getMatrixAE, getMatrixAE, getMatrixAE, getMatrixAI, getMatrixAI, getMatrixAI, getMatrixBE, getMatrixBI, getMatrixBI, getMatrixBI, getMatrixC, getMatrixQ, getRankGeneral, getSolutionGeneral, getSolutionGeneral, getSolutionQ, getSolutionQ, getSolutionX, hasEqualityConstraints, hasInequalityConstraints, isPatchedQ, isSolvableGeneral, isSolvableQ, isZeroQ, newSolver, of, performIteration, solve, solveFullKKT, solveLP, toObjectiveFunction, toString
-
Methods inherited from class org.ojalgo.optimisation.convex.ConvexSolver
copy, newBuilder, newBuilder, newBuilder, newSolver
-
Methods inherited from class org.ojalgo.optimisation.GenericSolver
countIterations, countTime, error, getClassSimpleName, getDuration, getState, incrementIterationsCount, isIterationAllowed, isLogDebug, isLogOff, isLogProgress, log, log, log, log, logProgress, resetIterationsCount, setState, setValidator, validate, validate
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.ojalgo.optimisation.Optimisation.Solver
solve
-
Methods inherited from interface org.ojalgo.optimisation.UpdatableSolver
fixVariable, generateCutCandidates, integers, isMapped, updateRange
-
-
-
-
Field Detail
-
ACC
private static final NumberContext ACC
-
FEASIBILITY
private static final NumberContext FEASIBILITY
-
LAGRANGE
private static final NumberContext LAGRANGE
-
SLACK
private static final NumberContext SLACK
-
SOLUTION
private static final NumberContext SOLUTION
-
myActivator
private final IndexSelector myActivator
-
myConstraintToInclude
private int myConstraintToInclude
-
myExcluded
private transient int[] myExcluded
-
myIncluded
private transient int[] myIncluded
-
myInvQC
private MatrixStore<java.lang.Double> myInvQC
-
myIterationX
private final R064Store myIterationX
-
myShrinkSwitch
private boolean myShrinkSwitch
-
mySlackI
private final R064Store mySlackI
-
-
Constructor Detail
-
ActiveSetSolver
ActiveSetSolver(ConvexData<java.lang.Double> convexData, Optimisation.Options optimisationOptions)
-
-
Method Detail
-
handleIterationSolution
private void handleIterationSolution(R064Store iterX, int[] excluded)
-
shrink
private void shrink()
-
suggestUsingLagrangeMagnitude
private int suggestUsingLagrangeMagnitude()
-
suggestUsingVectorProjection
private int suggestUsingVectorProjection()
-
countExcluded
protected final int countExcluded()
-
countIncluded
protected final int countIncluded()
-
exclude
protected void exclude(int indexToExclude)
-
extractSolution
protected MatrixStore<java.lang.Double> extractSolution()
- Overrides:
extractSolution
in classBasePrimitiveSolver
-
getExcluded
protected final int[] getExcluded()
-
getExcluded
protected int getExcluded(int indexAmongExcluded)
-
getIncluded
protected final int[] getIncluded()
-
getIncluded
protected final int getIncluded(int indexAmongIncluded)
-
getLastExcluded
protected final int getLastExcluded()
-
getLastIncluded
protected final int getLastIncluded()
-
include
protected void include(int indexToInclude)
-
initialise
protected boolean initialise(Optimisation.Result kickStarter)
- Overrides:
initialise
in classConstrainedSolver
- Returns:
- true/false if the main algorithm may start or not
-
isIteratingPossible
protected boolean isIteratingPossible()
- Overrides:
isIteratingPossible
in classBasePrimitiveSolver
-
needsAnotherIteration
protected boolean needsAnotherIteration()
- Specified by:
needsAnotherIteration
in classBasePrimitiveSolver
-
suggestConstraintToExclude
protected int suggestConstraintToExclude()
Find the minimum (largest negative) lagrange multiplier - for the active inequalities - to potentially deactivate.
-
suggestConstraintToInclude
protected int suggestConstraintToInclude()
Find minimum (largest negative) slack - for the inactive inequalities - to potentially activate. Negative slack means the constraint is violated. Need to make sure it is enforced by activating it.
-
toActivatorString
protected final java.lang.String toActivatorString()
-
checkFeasibility
boolean checkFeasibility()
-
countIterationConstraints
int countIterationConstraints()
Description copied from class:ConstrainedSolver
The number of rows inConstrainedSolver.getIterationA()
andConstrainedSolver.getIterationB()
without having to actually create them.- Specified by:
countIterationConstraints
in classConstrainedSolver
-
getConstraintToInclude
int getConstraintToInclude()
-
getInvQC
MatrixStore<java.lang.Double> getInvQC()
-
getIterationA
MatrixStore<java.lang.Double> getIterationA()
- Specified by:
getIterationA
in classConstrainedSolver
-
getIterationB
MatrixStore<java.lang.Double> getIterationB()
- Specified by:
getIterationB
in classConstrainedSolver
-
getIterationC
MatrixStore<java.lang.Double> getIterationC()
- Specified by:
getIterationC
in classConstrainedSolver
-
getIterationX
R064Store getIterationX()
-
getSlackI
PhysicalStore<java.lang.Double> getSlackI()
-
getSlackI
MatrixStore<java.lang.Double> getSlackI(int[] rows)
-
handleIterationResults
void handleIterationResults(boolean solved, R064Store iterX, int[] included, int[] excluded)
-
resetActivator
void resetActivator()
-
setConstraintToInclude
void setConstraintToInclude(int constraintToInclude)
-
-