- 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 NumberContextACCprivate static NumberContextFEASIBILITYprivate static NumberContextLAGRANGEprivate IndexSelectormyActivatorprivate intmyConstraintToIncludeprivate int[]myExcludedprivate int[]myIncludedprivate MatrixStore<java.lang.Double>myInvQCprivate R064StoremyIterationXprivate booleanmyShrinkSwitchprivate R064StoremySlackIprivate static NumberContextSLACKprivate static NumberContextSOLUTION-
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) booleancheckFeasibility()protected intcountExcluded()protected intcountIncluded()(package private) intcountIterationConstraints()The number of rows inConstrainedSolver.getIterationA()andConstrainedSolver.getIterationB()without having to actually create them.protected voidexclude(int indexToExclude)protected MatrixStore<java.lang.Double>extractSolution()(package private) intgetConstraintToInclude()protected int[]getExcluded()protected int[]getIncluded()(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) R064StoregetIterationX()protected intgetLastExcluded()protected intgetLastIncluded()(package private) PhysicalStore<java.lang.Double>getSlackI()(package private) MatrixStore<java.lang.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 booleanisIteratingPossible()protected booleanneedsAnotherIteration()(package private) voidresetActivator()(package private) voidsetConstraintToInclude(int constraintToInclude)private voidshrink()protected intsuggestConstraintToExclude()Find the minimum (largest negative) lagrange multiplier - for the active inequalities - to potentially deactivate.protected intsuggestConstraintToInclude()Find minimum (largest negative) slack - for the inactive inequalities - to potentially activate.private intsuggestUsingLagrangeMagnitude()private intsuggestUsingVectorProjection()protected java.lang.StringtoActivatorString()-
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, update
-
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:
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
protected boolean initialise(Optimisation.Result kickStarter)
- 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
protected final java.lang.String 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<java.lang.Double> getInvQC()
-
getIterationA
MatrixStore<java.lang.Double> getIterationA()
- Specified by:
getIterationAin classConstrainedSolver
-
getIterationB
MatrixStore<java.lang.Double> getIterationB()
- Specified by:
getIterationBin classConstrainedSolver
-
getIterationC
MatrixStore<java.lang.Double> getIterationC()
- Specified by:
getIterationCin 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)
-
-