Class SimplexTableauSolver
java.lang.Object
org.ojalgo.optimisation.GenericSolver
org.ojalgo.optimisation.linear.LinearSolver
org.ojalgo.optimisation.linear.SimplexTableauSolver
- All Implemented Interfaces:
Optimisation, Optimisation.Solver, UpdatableSolver
Classic simplex tableau solver:
- Primal algorithm
- 2-phase
- All variables assumed >=0, and RHS required to be >=0
- Variable bounds other than >=0 handled like constraints
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final classNested classes/interfaces inherited from class LinearSolver
LinearSolver.Builder, LinearSolver.Configuration, LinearSolver.ModelIntegration, LinearSolver.NewIntegration, LinearSolver.OldIntegrationNested classes/interfaces inherited from interface Optimisation
Optimisation.Constraint, Optimisation.ConstraintType, Optimisation.Integration<M,S>, 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 LongToNumberMap<Double> private final SimplexTableauSolver.IterationPointprivate final SimplexTableauprivate static final NumberContextprivate static final NumberContextprivate static final NumberContextprivate static final NumberContextFields inherited from class LinearSolver
INTEGRATION, NEWER_DUAL_SOLVER, OLDER_PRIMAL_SOLVERFields inherited from class GenericSolver
options -
Constructor Summary
ConstructorsConstructorDescriptionSimplexTableauSolver(SimplexTableau tableau, Optimisation.Options solverOptions) -
Method Summary
Modifier and TypeMethodDescription(package private) static <T extends SimplexTableau>
Tbuild(ExpressionsBasedModel model, Function<LinearStructure, T> factory) protected Optimisation.Resultprivate voidhttps://math.stackexchange.com/questions/3254444/artificial-variables-in-two-phase-simplex-method(package private) static Optimisation.ResultdoSolveConvexAsDual(ConvexData<Double> convex, Optimisation.Options options, boolean zeroC) (package private) static Optimisation.ResultdoSolveConvexAsPrimal(ConvexData<Double> convex, Optimisation.Options options, boolean zeroC) protected doubleevaluateFunction(Access1D<?> solution) protected Access1D<?> protected Access1D<?> Extract solution MatrixStore from the tableau.(package private) int(package private) intbooleanfixVariable(int index, double value) final Collection<Equation> generateCutCandidates(double fractionality, boolean... integer) private intprivate doubleprotected booleaninitialise(Optimisation.Result kickStarter) private booleanprivate voidlogDebugTableau(String message) protected boolean(package private) voidprivate intphase()(package private) static voidset(ExpressionsBasedModel model, Primitive2D constraintsBdy, int indCnstr, int basePosVars, int baseNegVars, Variable variable, double factor) (package private) static voidset(ExpressionsBasedModel model, Primitive2D constraintsBdy, int indCnstr, int basePosVars, int baseNegVars, Structure1D.IntIndex key, double factor) (package private) static intsizeOfDual(ConvexData<?> convex) (package private) static intsizeOfPrimal(ConvexData<?> convex) solve(Optimisation.Result kickStarter) booleanupdateRange(int index, double lower, double upper) A generalisation ofUpdatableSolver.fixVariable(int, double)where the new/updated lower and upper bounds do not need to be equal.protected booleanvalidate()private doublevalue()Methods inherited from class LinearSolver
newBuilder, newBuilder, newGeneralBuilder, newGeneralBuilder, newSolver, newStandardBuilder, newStandardBuilder, solve, toObjectiveFunctionMethods inherited from class GenericSolver
countIterations, countTime, error, getClassSimpleName, getDuration, getState, incrementIterationsCount, isIterationAllowed, isLogDebug, isLogOff, isLogProgress, log, log, log, log, logProgress, printf, resetIterationsCount, setState, setValidator, validate, validateMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Optimisation.Solver
dispose, solveMethods inherited from interface UpdatableSolver
integers, isMapped
-
Field Details
-
ACC
-
DEGENERATE
-
PHASE1
-
PIVOT
-
RATIO
-
WEIGHT
-
myFixedVariables
-
myPoint
-
myTableau
-
-
Constructor Details
-
SimplexTableauSolver
SimplexTableauSolver(SimplexTableau tableau, Optimisation.Options solverOptions)
-
-
Method Details
-
build
static <T extends SimplexTableau> T build(ExpressionsBasedModel model, Function<LinearStructure, T> factory) -
doSolveConvexAsDual
static Optimisation.Result doSolveConvexAsDual(ConvexData<Double> convex, Optimisation.Options options, boolean zeroC) -
doSolveConvexAsPrimal
static Optimisation.Result doSolveConvexAsPrimal(ConvexData<Double> convex, Optimisation.Options options, boolean zeroC) -
set
static void set(ExpressionsBasedModel model, Primitive2D constraintsBdy, int indCnstr, int basePosVars, int baseNegVars, Structure1D.IntIndex key, double factor) -
set
static void set(ExpressionsBasedModel model, Primitive2D constraintsBdy, int indCnstr, int basePosVars, int baseNegVars, Variable variable, double factor) -
sizeOfDual
-
sizeOfPrimal
-
fixVariable
public boolean fixVariable(int index, double value) - Parameters:
index- The, solver specific, variable indexvalue- The value to fix that variable to- Returns:
- true if fixing is supported and was successful, otherwise false
-
generateCutCandidates
-
getEntityMap
-
solve
-
updateRange
public boolean updateRange(int index, double lower, double upper) Description copied from interface:UpdatableSolverA generalisation ofUpdatableSolver.fixVariable(int, double)where the new/updated lower and upper bounds do not need to be equal.- Parameters:
index- The, solver specific, variable indexlower- New lower boundupper- New upper bound- Returns:
- true if updating the range is supported and was successful, otherwise false
-
cleanUpPhase1Artificials
private void cleanUpPhase1Artificials()https://math.stackexchange.com/questions/3254444/artificial-variables-in-two-phase-simplex-method -
getRowObjective
private int getRowObjective() -
infeasibility
private double infeasibility() -
isTableauPrintable
private boolean isTableauPrintable() -
logDebugTableau
-
phase
private int phase() -
value
private double value() -
buildResult
-
evaluateFunction
-
extractMultipliers
-
extractSolution
Extract solution MatrixStore from the tableau. Should be able to feed this toevaluateFunction(Access1D). -
initialise
-
needsAnotherIteration
protected boolean needsAnotherIteration() -
validate
protected boolean validate() -
findNextPivotCol
int findNextPivotCol() -
findNextPivotRow
int findNextPivotRow() -
performIteration
-