Class SimplexTableau
java.lang.Object
org.ojalgo.optimisation.linear.SimplexStore
org.ojalgo.optimisation.linear.SimplexTableau
- All Implemented Interfaces:
Access1D<Double>, Access2D<Double>, Mutate1D, Mutate2D, Structure1D, Structure2D
- Direct Known Subclasses:
DenseTableau, SparseTableau
-
Nested Class Summary
Nested classes/interfaces inherited from class SimplexStore
SimplexStore.ColumnStateNested classes/interfaces inherited from interface Access2D
Access2D.Aggregatable<N>, Access2D.Collectable<N,R>, Access2D.ColumnView<N>, Access2D.ElementView<N>, Access2D.RowView<N>, Access2D.SelectionView<N>, Access2D.Sliceable<N>, Access2D.Visitable<N> Nested classes/interfaces inherited from interface Mutate1D
Mutate1D.SortableNested classes/interfaces inherited from interface Mutate2D
Mutate2D.Exchangeable, Mutate2D.Fillable<N>, Mutate2D.Mixable<N>, Mutate2D.Modifiable<N>, Mutate2D.ModifiableReceiver<N>, Mutate2D.Receiver<N>Nested classes/interfaces inherited from interface Structure1D
Structure1D.BasicMapper<T>, Structure1D.IndexMapper<T>, Structure1D.IntIndex, Structure1D.Logical<S,B>, Structure1D.LongIndex, Structure1D.LoopCallback Nested classes/interfaces inherited from interface Structure2D
Structure2D.IntRowColumn, Structure2D.Logical<S,B>, Structure2D.LongRowColumn, Structure2D.ReducibleTo1D<R>, Structure2D.Reshapable, Structure2D.RowColumnKey<R, C>, Structure2D.RowColumnMapper<R, C> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Primitive2Dprivate Primitive1Dprivate Primitive1D(package private) static final NumberContextUsed when pivoting to identify rows with elements that are already very close to zero (to avoid updating those rows).Fields inherited from class SimplexStore
edgeWeights, excluded, included, m, n, structure -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) final void(package private) voidcalculateIteration(SimplexSolver.IterDescr iteration, double shift) (package private) final void(package private) final Primitive2DThe area of the tableau corresponding to the constraints' body.(package private) final Primitive1DThe area of the tableau corresponding to the constraints' RHS.protected abstract voiddoPivot(int row, int col) Perform the pivot operation on the tableau – only.(package private) final intfindNextPivotColumn(Access1D<Double> auxiliaryRow, Access1D<Double> objectiveRow) (package private) abstract booleanfixVariable(int index, double value) (package private) final Collection<Equation> generateCutCandidates(boolean[] integer, NumberContext accuracy, double fractionality) Simplified version ofSimplexStore.generateCutCandidates(boolean[], NumberContext, double, double[])for specific use withSimplexTableauSolver.final Doubleget(long row, long col) (package private) final doublegetCost(int j) (package private) final doublegetCurrentElement(int i, SimplexSolver.EnterInfo enter) The current (tableau) constraint body element.(package private) final doublegetCurrentElement(SimplexSolver.ExitInfo exit, int je) The current (tableau) constraint body element.(package private) final doublegetCurrentRHS(int i) The current (tableau) constraint RHS.(package private) abstract double(package private) final doublegetInfeasibility(int i) (package private) abstract doublegetValue()(package private) abstract Primitive2D(package private) abstract Primitive1D(package private) abstract Primitive1D(package private) final SimplexTableauSolvernewSimplexTableauSolver(Optimisation.Options optimisationOptions) (package private) static Function<LinearStructure, SimplexTableau> newTableauFactory(Optimisation.Options options) (package private) final Primitive1DThe area of the tableau corresponding to the objective function.protected final voidpivot(SimplexSolver.IterDescr iteration) protected final voidpivot(SimplexTableauSolver.IterationPoint iteration) (package private) void(package private) final voidresetBasis(int[] newBasis) Everything that is not in the basis is set to be in at lower bound.final voidset(long row, long col, Comparable<?> value) (package private) final void(package private) final Primitive1DsliceBodyColumn(int col) (package private) final Primitive1DsliceBodyRow(int row) (package private) final Primitive1D(package private) final Primitive1D(package private) final Primitive1DsliceTableauColumn(int col) (package private) final Primitive1DsliceTableauRow(int row) toString()(package private) voidupdateDualEdgeWeights(SimplexSolver.IterDescr iteration) Update edge weights for basic (included) variables.(package private) voidupdatePrimalEdgeWeights(SimplexSolver.IterDescr iteration) Update edge weights for non-basic (excluded) variables.(package private) final doublevalue(boolean phase1) The current, phase 1 or 2, objective function valueMethods inherited from class SimplexStore
copyBasicSolution, countRemainingArtificials, extractSolution, extractValue, generateCutCandidates, getColumnState, getLowerBound, getLowerBounds, getLowerGap, getRange, getReducedCost, getUpperBound, getUpperBounds, getUpperGap, isArtificial, isExcluded, isIncluded, isNegated, isPrintable, isRemainingArtificials, lower, newDualSimplexSolver, newPhasedSimplexSolver, newPrimalSimplexSolver, newStoreFactory, phase1, removePhase1, resetEdgeWeights, shiftColumn, unbounded, update, updateBasis, updateRange, upperMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Access1D
asCollectable1D, asKeyed1D, asList, axpy, dot, select, supplyTo, toList, toRawCopy1DMethods inherited from interface Access2D
asCollectable2D, asKeyed2D, byteValue, byteValue, byteValue, byteValue, columns, columns, columns, doubleValue, doubleValue, doubleValue, doubleValue, elements, floatValue, floatValue, floatValue, floatValue, get, intValue, intValue, intValue, intValue, longValue, longValue, longValue, longValue, nonzeros, rows, rows, rows, select, select, shortValue, shortValue, shortValue, shortValue, toRawCopy2DMethods inherited from interface Mutate2D
set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, setMethods inherited from interface Structure2D
count, countColumns, countRows, firstInColumn, firstInRow, getColDim, getMaxDim, getMinDim, getRowDim, isEmpty, isFat, isScalar, isSquare, isTall, isVector, limitOfColumn, limitOfRow, size
-
Field Details
-
PRECISION
Used when pivoting to identify rows with elements that are already very close to zero (to avoid updating those rows). -
myConstraintsBody
-
myConstraintsRHS
-
myObjective
-
-
Constructor Details
-
SimplexTableau
SimplexTableau(LinearStructure linearStructure)
-
-
Method Details
-
newTableauFactory
-
get
-
set
-
toString
- Overrides:
toStringin classSimplexStore
-
doPivot
protected abstract void doPivot(int row, int col) Perform the pivot operation on the tableau – only. Various auxiliary bookkeeping should NOT be done here. -
pivot
- Overrides:
pivotin classSimplexStore
-
pivot
-
calculateDualDirection
- Specified by:
calculateDualDirectionin classSimplexStore
-
calculateIteration
- Specified by:
calculateIterationin classSimplexStore
-
calculatePrimalDirection
- Specified by:
calculatePrimalDirectionin classSimplexStore
-
constraintsBody
The area of the tableau corresponding to the constraints' body.- Specified by:
constraintsBodyin classSimplexStore- See Also:
-
constraintsRHS
The area of the tableau corresponding to the constraints' RHS.- Specified by:
constraintsRHSin classSimplexStore- See Also:
-
findNextPivotColumn
-
fixVariable
abstract boolean fixVariable(int index, double value) -
generateCutCandidates
final Collection<Equation> generateCutCandidates(boolean[] integer, NumberContext accuracy, double fractionality) Simplified version ofSimplexStore.generateCutCandidates(boolean[], NumberContext, double, double[])for specific use withSimplexTableauSolver.SimplexSolverandSimplexTableauSolvercan both useSimplexTableau, but they use them differently. -
getCost
final double getCost(int j) - Specified by:
getCostin classSimplexStore
-
getCurrentElement
Description copied from class:SimplexStoreThe current (tableau) constraint body element.- Specified by:
getCurrentElementin classSimplexStore
-
getCurrentElement
Description copied from class:SimplexStoreThe current (tableau) constraint body element.- Specified by:
getCurrentElementin classSimplexStore
-
getCurrentRHS
final double getCurrentRHS(int i) Description copied from class:SimplexStoreThe current (tableau) constraint RHS.- Specified by:
getCurrentRHSin classSimplexStore
-
getInfeasibility
abstract double getInfeasibility()- Returns:
- The phase 1 objective function value
-
getInfeasibility
final double getInfeasibility(int i) - Specified by:
getInfeasibilityin classSimplexStore
-
getValue
abstract double getValue()- Returns:
- The (phase 2) objective function value
-
newConstraintsBody
-
newConstraintsRHS
-
newObjective
-
newSimplexTableauSolver
-
objective
The area of the tableau corresponding to the objective function.- Specified by:
objectivein classSimplexStore- See Also:
-
prepareToIterate
void prepareToIterate()- Specified by:
prepareToIteratein classSimplexStore
-
resetBasis
final void resetBasis(int[] newBasis) Description copied from class:SimplexStoreEverything that is not in the basis is set to be in at lower bound.- Overrides:
resetBasisin classSimplexStore
-
setupClassicPhase1Objective
final void setupClassicPhase1Objective()- Specified by:
setupClassicPhase1Objectivein classSimplexStore
-
sliceBodyColumn
-
sliceBodyRow
- Specified by:
sliceBodyRowin classSimplexStore
-
sliceConstraintsRHS
-
sliceDualVariables
- Specified by:
sliceDualVariablesin classSimplexStore- Returns:
- An array of the dual variable values (of the original problem, never phase 1).
-
sliceTableauColumn
-
sliceTableauRow
-
updateDualEdgeWeights
Description copied from class:SimplexStoreUpdate edge weights for basic (included) variables.- Specified by:
updateDualEdgeWeightsin classSimplexStore
-
updatePrimalEdgeWeights
Description copied from class:SimplexStoreUpdate edge weights for non-basic (excluded) variables.- Specified by:
updatePrimalEdgeWeightsin classSimplexStore
-
value
final double value(boolean phase1) The current, phase 1 or 2, objective function value
-