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
-
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
FieldsModifier and TypeFieldDescriptionprivate static final NumberContext
private static final NumberContext
private static final NumberContext
private final IndexSelector
private int
private int[]
private int[]
private MatrixStore
<Double> private final R064Store
private boolean
private final R064Store
private static final NumberContext
private static final NumberContext
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
ConstructorsConstructorDescriptionActiveSetSolver
(ConvexData<Double> convexData, Optimisation.Options optimisationOptions) -
Method Summary
Modifier and TypeMethodDescription(package private) boolean
protected final int
protected final int
(package private) int
The number of rows inConstrainedSolver.getIterationA()
andConstrainedSolver.getIterationB()
without having to actually create them.protected void
exclude
(int indexToExclude) protected MatrixStore
<Double> (package private) int
protected final int[]
protected int
getExcluded
(int indexAmongExcluded) protected final int[]
protected final int
getIncluded
(int indexAmongIncluded) (package private) MatrixStore
<Double> getInvQC()
(package private) MatrixStore
<Double> (package private) MatrixStore
<Double> (package private) MatrixStore
<Double> (package private) R064Store
protected final int
protected final int
(package private) PhysicalStore
<Double> (package private) MatrixStore
<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
protected boolean
(package private) void
(package private) void
setConstraintToInclude
(int constraintToInclude) private void
shrink()
protected int
Find the minimum (largest negative) lagrange multiplier - for the active inequalities - to potentially deactivate.protected int
Find minimum (largest negative) slack - for the inactive inequalities - to potentially activate.private int
private int
protected final String
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 Details
-
ACC
-
FEASIBILITY
-
LAGRANGE
-
SLACK
-
SOLUTION
-
myActivator
-
myConstraintToInclude
private int myConstraintToInclude -
myExcluded
private transient int[] myExcluded -
myIncluded
private transient int[] myIncluded -
myInvQC
-
myIterationX
-
myShrinkSwitch
private boolean myShrinkSwitch -
mySlackI
-
-
Constructor Details
-
ActiveSetSolver
ActiveSetSolver(ConvexData<Double> convexData, Optimisation.Options optimisationOptions)
-
-
Method Details
-
handleIterationSolution
-
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
- 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
- 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
-
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<Double> getInvQC() -
getIterationA
MatrixStore<Double> getIterationA()- Specified by:
getIterationA
in classConstrainedSolver
-
getIterationB
MatrixStore<Double> getIterationB()- Specified by:
getIterationB
in classConstrainedSolver
-
getIterationC
MatrixStore<Double> getIterationC()- Specified by:
getIterationC
in classConstrainedSolver
-
getIterationX
R064Store getIterationX() -
getSlackI
PhysicalStore<Double> getSlackI() -
getSlackI
-
handleIterationResults
-
resetActivator
void resetActivator() -
setConstraintToInclude
void setConstraintToInclude(int constraintToInclude)
-