Package org.ojalgo.optimisation.linear
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 int[]
excluded == not in the basis(package private) final int[]
included == in the basis(package private) final int
The number of constraints (upper, lower and equality)private int[]
private int[]
private int[]
private final double[]
private final EnumPartition
<SimplexStore.ColumnState> private int
private final double[]
(package private) final int
The number of variables totally (all kinds)(package private) final LinearStructure
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate final SimplexStore
basis
(int index) (package private) abstract void
(package private) abstract void
(package private) abstract void
(package private) abstract Mutate2D
The simplex' constraints body (including the parts corresponding to slack and artificial variables).(package private) abstract Mutate1D
The simplex' constraints RHS.(package private) abstract void
copyBasicSolution
(double[] solution) (package private) abstract void
(package private) final int
The 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) (package private) final SimplexStore.ColumnState
getColumnState
(int index) (package private) abstract double
getCost
(int i) (package private) abstract double
getCurrentElement
(int i, SimplexSolver.EnterInfo enter) The current (tableau) constraint body element.(package private) abstract double
getCurrentElement
(SimplexSolver.ExitInfo exit, int je) The current (tableau) constraint body element.(package private) abstract double
getCurrentRHS
(int i) The current (tableau) constraint RHS.(package private) final int[]
Indices of columns/variables at their lower bounds.(package private) final int[]
Indices of unbounded columns/variables.(package private) final int[]
Indices of columns/variables at their upper bounds.(package private) abstract double
getInfeasibility
(int i) (package private) final double
getLowerBound
(int index) (package private) final double[]
(package private) final double
getLowerGap
(int i) The "distance" from the current basic value to the lower bound.(package private) final double
getRange
(int index) (package private) abstract double
getReducedCost
(int je) (package private) final double
getUpperBound
(int index) (package private) final double[]
(package private) final double
getUpperGap
(int i) The "distance" from the current basic value to the upper bound.(package private) final boolean
isArtificial
(int col) (package private) final boolean
isExcluded
(int index) (package private) final boolean
isIncluded
(int index) (package private) final boolean
isNegated
(int j) (package private) final boolean
The problem is small enough to be explicitly printed/logged – log the entire tableau at each iteration when debugging.(package private) final boolean
Are there any artificial variables in the basis?(package private) final SimplexStore
lower
(int index) (package private) final DualSimplexSolver
newDualSimplexSolver
(Optimisation.Options options, int... basis) (package private) final PhasedSimplexSolver
newPhasedSimplexSolver
(Optimisation.Options options, int... basis) (package private) final PrimalSimplexSolver
newPrimalSimplexSolver
(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 Mutate1D
The simplex' objective function.protected void
pivot
(SimplexSolver.IterDescr iteration) (package private) void
resetBasis
(int[] newBasis) Everything that is not in the basis is set to be in at lower bound.(package private) abstract void
(package private) abstract void
protected void
shiftColumn
(int col, double shift) (package private) abstract Primitive1D
sliceBodyRow
(int row) (package private) abstract Primitive1D
(package private) abstract void
toString()
(package private) final SimplexStore
unbounded
(int index) (package private) final void
update
(int exit, int exclEnter) (package private) final void
updateBasis
(int exit, SimplexStore.ColumnState exitToBound, int enter) (package private) boolean
updateRange
(int index, double lower, double upper) (package private) final SimplexStore
upper
(int index)
-
Field Details
-
myExcludedLower
private transient int[] myExcludedLower -
myExcludedUnbounded
private transient int[] myExcludedUnbounded -
myExcludedUpper
private transient int[] myExcludedUpper -
myLowerBounds
private final double[] myLowerBounds -
myPartition
-
myRemainingArtificials
private int myRemainingArtificials -
myToStringList
-
myUpperBounds
private final double[] myUpperBounds -
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
abstract void 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) -
copyObjective
abstract void copyObjective() -
switchObjective
abstract void switchObjective() -
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) -
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. -
getExcludedLower
final int[] getExcludedLower()Indices of columns/variables at their lower bounds. -
getExcludedUnbounded
final int[] getExcludedUnbounded()Indices of unbounded columns/variables. -
getExcludedUpper
final int[] getExcludedUpper()Indices of columns/variables at their upper bounds. -
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 simplex' objective function. -
resetBasis
void resetBasis(int[] newBasis) Everything that is not in the basis is set to be in at lower bound. -
restoreObjective
abstract void restoreObjective() -
sliceBodyRow
-
sliceDualVariables
-
unbounded
-
update
final void update(int exit, int exclEnter) -
updateBasis
-
updateRange
boolean updateRange(int index, double lower, double upper) -
upper
-
setupClassicPhase1Objective
abstract void setupClassicPhase1Objective()
-