Package org.ojalgo.optimisation.linear
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 class
Nested classes/interfaces inherited from class org.ojalgo.optimisation.linear.LinearSolver
LinearSolver.Builder, LinearSolver.Configuration, LinearSolver.ModelIntegration, LinearSolver.NewIntegration, LinearSolver.OldIntegration
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 LongToNumberMap
<Double> private final SimplexTableauSolver.IterationPoint
private final SimplexTableau
private static final NumberContext
private static final NumberContext
private static final NumberContext
private static final NumberContext
Fields inherited from class org.ojalgo.optimisation.linear.LinearSolver
INTEGRATION, NEW_INTEGRATION, OLD_INTEGRATION
Fields inherited from class org.ojalgo.optimisation.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) (package private) static SimplexTableau
buildDual
(ConvexData<Double> convex, Optimisation.Options options, boolean checkFeasibility) (package private) static SimplexTableau
buildPrimal
(ConvexData<Double> convex, Optimisation.Options options, boolean checkFeasibility) protected Optimisation.Result
private void
https://math.stackexchange.com/questions/3254444/artificial-variables-in-two-phase-simplex-method(package private) static Optimisation.Result
doSolveDual
(ConvexData<Double> convex, Optimisation.Options options, boolean zeroC) (package private) static Optimisation.Result
doSolvePrimal
(ConvexData<Double> convex, Optimisation.Options options, boolean zeroC) protected double
evaluateFunction
(Access1D<?> solution) protected Access1D
<?> protected Access1D
<?> Extract solution MatrixStore from the tableau.(package private) int
(package private) int
boolean
fixVariable
(int index, double value) final Collection
<Equation> generateCutCandidates
(double fractionality, boolean... integer) private int
private double
protected boolean
initialise
(Optimisation.Result kickStarter) private boolean
private void
logDebugTableau
(String message) protected boolean
(package private) void
private int
phase()
(package private) static void
set
(ExpressionsBasedModel model, Primitive2D constraintsBdy, int indCnstr, int basePosVars, int baseNegVars, Variable variable, double factor) (package private) static void
set
(ExpressionsBasedModel model, Primitive2D constraintsBdy, int indCnstr, int basePosVars, int baseNegVars, Structure1D.IntIndex key, double factor) (package private) static int
sizeOfDual
(ConvexData<?> convex) (package private) static int
sizeOfPrimal
(ConvexData<?> convex) solve
(Optimisation.Result kickStarter) private static Optimisation.Result
toConvexStateFromDual
(Optimisation.Result result, ConvexData<Double> convex) private static Optimisation.Result
toConvexStateFromPrimal
(Optimisation.Result result, ConvexData<Double> convex) boolean
updateRange
(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 boolean
validate()
private double
value()
Methods inherited from class org.ojalgo.optimisation.linear.LinearSolver
newBuilder, newBuilder, newGeneralBuilder, newGeneralBuilder, newSolver, newStandardBuilder, newStandardBuilder, solve, toObjectiveFunction
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, toString, wait, wait, wait
Methods inherited from interface org.ojalgo.optimisation.Optimisation.Solver
dispose, solve
Methods inherited from interface org.ojalgo.optimisation.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
-
toConvexStateFromDual
private static Optimisation.Result toConvexStateFromDual(Optimisation.Result result, ConvexData<Double> convex) -
toConvexStateFromPrimal
private static Optimisation.Result toConvexStateFromPrimal(Optimisation.Result result, ConvexData<Double> convex) -
build
static <T extends SimplexTableau> T build(ExpressionsBasedModel model, Function<LinearStructure, T> factory) -
buildDual
static SimplexTableau buildDual(ConvexData<Double> convex, Optimisation.Options options, boolean checkFeasibility) -
buildPrimal
static SimplexTableau buildPrimal(ConvexData<Double> convex, Optimisation.Options options, boolean checkFeasibility) -
doSolveDual
static Optimisation.Result doSolveDual(ConvexData<Double> convex, Optimisation.Options options, boolean zeroC) -
doSolvePrimal
static Optimisation.Result doSolvePrimal(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:UpdatableSolver
A 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
-