Class SimplexStore
java.lang.Object
org.ojalgo.optimisation.linear.SimplexStore
- Direct Known Subclasses:
RevisedStore, SimplexTableau
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescription(package private) final double[]Either the primal or dual devex edge weights, depending on the algorithm used.(package private) final int[]excluded == not in the basis(package private) final int[]included == in the basis(package private) final intThe number of constraints (upper, lower and equality)private final double[]private final EnumPartition<SimplexStore.ColumnState> private intprivate final double[](package private) final intThe number of variables totally (all kinds)(package private) final LinearStructure -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate final SimplexStorebasis(int index) (package private) abstract void(package private) abstract voidcalculateIteration(SimplexSolver.IterDescr iteration, double shift) (package private) abstract void(package private) abstract Mutate2DThe simplex' constraints body (including the parts corresponding to slack and artificial variables).(package private) abstract Mutate1DThe simplex' constraints RHS.(package private) abstract voidcopyBasicSolution(double[] solution) (package private) final intThe number of artificial variables in the basis.(package private) final double[](package private) abstract double(package private) final Collection<Equation> generateCutCandidates(boolean[] integer, NumberContext accuracy, double fractionality, double[] shift) WhenSimplexSolveris used as node solver forIntegerSolverthis method generates cut candidates.(package private) final SimplexStore.ColumnStategetColumnState(int index) (package private) abstract doublegetCost(int i) (package private) abstract doublegetCurrentElement(int i, SimplexSolver.EnterInfo enter) The current (tableau) constraint body element.(package private) abstract doublegetCurrentElement(SimplexSolver.ExitInfo exit, int je) The current (tableau) constraint body element.(package private) abstract doublegetCurrentRHS(int i) The current (tableau) constraint RHS.(package private) abstract doublegetInfeasibility(int i) (package private) final doublegetLowerBound(int index) (package private) final double[](package private) final doublegetLowerGap(int i) The "distance" from the current basic value to the lower bound.(package private) final doublegetRange(int index) (package private) abstract doublegetReducedCost(int je) (package private) final doublegetUpperBound(int index) (package private) final double[](package private) final doublegetUpperGap(int i) The "distance" from the current basic value to the upper bound.(package private) final booleanisArtificial(int col) (package private) final booleanisExcluded(int index) (package private) final booleanisIncluded(int index) (package private) final booleanisNegated(int j) (package private) final booleanThe problem is small enough to be explicitly printed/logged – log the entire tableau at each iteration when debugging.(package private) final booleanAre there any artificial variables in the basis?(package private) final SimplexStorelower(int index) (package private) final DualSimplexSolvernewDualSimplexSolver(Optimisation.Options options, int... basis) (package private) final PhasedSimplexSolvernewPhasedSimplexSolver(Optimisation.Options options, int... basis) (package private) final PrimalSimplexSolvernewPrimalSimplexSolver(Optimisation.Options options, int... basis) private <S extends SimplexSolver>
SnewSolver(BiFunction<Optimisation.Options, SimplexStore, S> constructor, Optimisation.Options options, int... basis) (package private) static Function<LinearStructure, SimplexStore> newStoreFactory(Optimisation.Options options) (package private) abstract Mutate1DThe objective function.phase1()The phase-1 objective function.protected voidpivot(SimplexSolver.IterDescr iteration) (package private) abstract void(package private) abstract void(package private) voidresetBasis(int[] newBasis) Everything that is not in the basis is set to be in at lower bound.(package private) void(package private) abstract voidprotected voidshiftColumn(int col, double shift) (package private) abstract Primitive1DsliceBodyRow(int row) (package private) abstract Primitive1DtoString()(package private) final SimplexStoreunbounded(int index) (package private) final voidupdate(int exit, int exclEnter) (package private) final voidupdateBasis(int exit, SimplexStore.ColumnState exitToBound, int enter) (package private) abstract voidupdateDualEdgeWeights(SimplexSolver.IterDescr iteration) Update edge weights for basic (included) variables.(package private) abstract voidupdatePrimalEdgeWeights(SimplexSolver.IterDescr iteration) Update edge weights for non-basic (excluded) variables.(package private) booleanupdateRange(int index, double lower, double upper) (package private) final SimplexStoreupper(int index)
-
Field Details
-
myLowerBounds
private final double[] myLowerBounds -
myPartition
-
myRemainingArtificials
private int myRemainingArtificials -
myToStringList
-
myUpperBounds
private final double[] myUpperBounds -
edgeWeights
final double[] edgeWeightsEither the primal or dual devex edge weights, depending on the algorithm used. Sized so that it can hold either. -
excluded
final int[] excludedexcluded == not in the basis -
included
final int[] includedincluded == in the basis -
m
final int mThe number of constraints (upper, lower and equality) -
n
final int nThe number of variables totally (all kinds) -
structure
-
-
Constructor Details
-
SimplexStore
SimplexStore(LinearStructure linearStructure)
-
-
Method Details
-
newStoreFactory
-
toString
-
basis
-
newSolver
private <S extends SimplexSolver> S newSolver(BiFunction<Optimisation.Options, SimplexStore, S> constructor, Optimisation.Options options, int... basis) -
pivot
-
shiftColumn
protected void shiftColumn(int col, double shift) -
calculateDualDirection
-
calculateIteration
-
calculatePrimalDirection
-
constraintsBody
The simplex' constraints body (including the parts corresponding to slack and artificial variables). -
constraintsRHS
The simplex' constraints RHS. -
copyBasicSolution
abstract void copyBasicSolution(double[] solution) -
countRemainingArtificials
final int countRemainingArtificials()The number of artificial variables in the basis. -
extractSolution
final double[] extractSolution() -
extractValue
abstract double extractValue() -
generateCutCandidates
final Collection<Equation> generateCutCandidates(boolean[] integer, NumberContext accuracy, double fractionality, double[] shift) WhenSimplexSolveris used as node solver forIntegerSolverthis method generates cut candidates. -
getColumnState
-
getCost
abstract double getCost(int i) -
getCurrentElement
The current (tableau) constraint body element. -
getCurrentElement
The current (tableau) constraint body element. -
getCurrentRHS
abstract double getCurrentRHS(int i) The current (tableau) constraint RHS. -
getInfeasibility
abstract double getInfeasibility(int i) -
getLowerBound
final double getLowerBound(int index) -
getLowerBounds
final double[] getLowerBounds() -
getLowerGap
final double getLowerGap(int i) The "distance" from the current basic value to the lower bound. -
getRange
final double getRange(int index) -
getReducedCost
abstract double getReducedCost(int je) -
getUpperBound
final double getUpperBound(int index) -
getUpperBounds
final double[] getUpperBounds() -
getUpperGap
final double getUpperGap(int i) The "distance" from the current basic value to the upper bound. -
isArtificial
final boolean isArtificial(int col) -
isExcluded
final boolean isExcluded(int index) -
isIncluded
final boolean isIncluded(int index) -
isNegated
final boolean isNegated(int j) -
isPrintable
final boolean isPrintable()The problem is small enough to be explicitly printed/logged – log the entire tableau at each iteration when debugging. -
isRemainingArtificials
final boolean isRemainingArtificials()Are there any artificial variables in the basis? -
lower
-
newDualSimplexSolver
-
newPhasedSimplexSolver
-
newPrimalSimplexSolver
-
objective
The objective function. -
phase1
-
prepareToIterate
abstract void prepareToIterate() -
removePhase1
abstract void removePhase1() -
resetBasis
void resetBasis(int[] newBasis) Everything that is not in the basis is set to be in at lower bound. -
resetEdgeWeights
void resetEdgeWeights() -
setupClassicPhase1Objective
abstract void setupClassicPhase1Objective() -
sliceBodyRow
-
sliceDualVariables
-
unbounded
-
update
final void update(int exit, int exclEnter) -
updateBasis
-
updateDualEdgeWeights
Update edge weights for basic (included) variables. -
updatePrimalEdgeWeights
Update edge weights for non-basic (excluded) variables. -
updateRange
boolean updateRange(int index, double lower, double upper) -
upper
-