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.ModelIntegrationNested 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 NumberContextprivate static final NumberContextprivate static final NumberContextprivate final IndexSelectorprivate intprivate int[]private int[]private MatrixStore<Double> private final R064Storeprivate booleanprivate final R064Storeprivate static final NumberContextprivate static final NumberContextFields inherited from class org.ojalgo.optimisation.convex.BasePrimitiveSolver
MATRIX_FACTORYFields inherited from class org.ojalgo.optimisation.convex.ConvexSolver
INTEGRATIONFields inherited from class org.ojalgo.optimisation.GenericSolver
options -
Constructor Summary
ConstructorsConstructorDescriptionActiveSetSolver(ConvexData<Double> convexData, Optimisation.Options optimisationOptions) -
Method Summary
Modifier and TypeMethodDescription(package private) booleanprotected final intprotected final int(package private) intThe number of rows inConstrainedSolver.getIterationA()andConstrainedSolver.getIterationB()without having to actually create them.protected voidexclude(int indexToExclude) protected MatrixStore<Double> (package private) intprotected final int[]protected final int[](package private) MatrixStore<Double> getInvQC()(package private) MatrixStore<Double> (package private) MatrixStore<Double> (package private) MatrixStore<Double> (package private) R064Storeprotected final intprotected final int(package private) PhysicalStore<Double> (package private) MatrixStore<Double> getSlackI(int[] rows) (package private) voidhandleIterationResults(boolean solved, R064Store iterX, int[] included, int[] excluded) private voidhandleIterationSolution(R064Store iterX, int[] excluded) protected voidinclude(int indexToInclude) protected booleaninitialise(Optimisation.Result kickStarter) protected booleanprotected boolean(package private) void(package private) voidsetConstraintToInclude(int constraintToInclude) private voidshrink()protected intFind the minimum (largest negative) lagrange multiplier - for the active inequalities - to potentially deactivate.protected intFind minimum (largest negative) slack - for the inactive inequalities - to potentially activate.private intprivate intprotected final StringMethods inherited from class org.ojalgo.optimisation.convex.ConstrainedSolver
buildResult, getIterationKKT, getIterationL, getIterationQ, getIterationRHS, getSlackE, getSolutionLMethods 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, updateMethods inherited from class org.ojalgo.optimisation.convex.ConvexSolver
copy, newBuilder, newBuilder, newBuilder, newSolverMethods 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, validateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.ojalgo.optimisation.Optimisation.Solver
solveMethods 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:
extractSolutionin classBasePrimitiveSolver
-
getExcluded
protected final int[] getExcluded() -
getIncluded
protected final int[] getIncluded() -
getLastExcluded
protected final int getLastExcluded() -
getLastIncluded
protected final int getLastIncluded() -
include
protected void include(int indexToInclude) -
initialise
- Overrides:
initialisein classConstrainedSolver- Returns:
- true/false if the main algorithm may start or not
-
isIteratingPossible
protected boolean isIteratingPossible()- Overrides:
isIteratingPossiblein classBasePrimitiveSolver
-
needsAnotherIteration
protected boolean needsAnotherIteration()- Specified by:
needsAnotherIterationin 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:ConstrainedSolverThe number of rows inConstrainedSolver.getIterationA()andConstrainedSolver.getIterationB()without having to actually create them.- Specified by:
countIterationConstraintsin classConstrainedSolver
-
getConstraintToInclude
int getConstraintToInclude() -
getInvQC
MatrixStore<Double> getInvQC() -
getIterationA
MatrixStore<Double> getIterationA()- Specified by:
getIterationAin classConstrainedSolver
-
getIterationB
MatrixStore<Double> getIterationB()- Specified by:
getIterationBin classConstrainedSolver
-
getIterationC
MatrixStore<Double> getIterationC()- Specified by:
getIterationCin classConstrainedSolver
-
getIterationX
R064Store getIterationX() -
getSlackI
PhysicalStore<Double> getSlackI() -
getSlackI
-
handleIterationResults
-
resetActivator
void resetActivator() -
setConstraintToInclude
void setConstraintToInclude(int constraintToInclude)
-