- java.lang.Object
-
- org.ojalgo.optimisation.linear.SimplexStore
-
- org.ojalgo.optimisation.linear.SimplexTableau
-
- All Implemented Interfaces:
Access1D<java.lang.Double>,Access2D<java.lang.Double>,Mutate1D,Mutate2D,Structure1D,Structure2D
- Direct Known Subclasses:
DenseTableau,SparseTableau
abstract class SimplexTableau extends SimplexStore implements Access2D<java.lang.Double>, Mutate2D
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.ojalgo.optimisation.linear.SimplexStore
SimplexStore.ColumnState
-
Nested classes/interfaces inherited from interface org.ojalgo.structure.Access2D
Access2D.Aggregatable<N extends java.lang.Comparable<N>>, Access2D.Collectable<N extends java.lang.Comparable<N>,R extends Mutate2D>, Access2D.ColumnView<N extends java.lang.Comparable<N>>, Access2D.ElementView<N extends java.lang.Comparable<N>>, Access2D.RowView<N extends java.lang.Comparable<N>>, Access2D.SelectionView<N extends java.lang.Comparable<N>>, Access2D.Sliceable<N extends java.lang.Comparable<N>>, Access2D.Visitable<N extends java.lang.Comparable<N>>
-
Nested classes/interfaces inherited from interface org.ojalgo.structure.Mutate1D
Mutate1D.Sortable
-
Nested classes/interfaces inherited from interface org.ojalgo.structure.Mutate2D
Mutate2D.Exchangeable, Mutate2D.Fillable<N extends java.lang.Comparable<N>>, Mutate2D.Mixable<N extends java.lang.Comparable<N>>, Mutate2D.Modifiable<N extends java.lang.Comparable<N>>, Mutate2D.ModifiableReceiver<N extends java.lang.Comparable<N>>, Mutate2D.Receiver<N extends java.lang.Comparable<N>>
-
Nested classes/interfaces inherited from interface org.ojalgo.structure.Structure1D
Structure1D.BasicMapper<T>, Structure1D.IndexMapper<T>, Structure1D.IntIndex, Structure1D.Logical<S extends Structure1D,B extends Structure1D.Logical<S,B>>, Structure1D.LongIndex, Structure1D.LoopCallback
-
Nested classes/interfaces inherited from interface org.ojalgo.structure.Structure2D
Structure2D.IntRowColumn, Structure2D.Logical<S extends Structure2D,B extends Structure2D.Logical<S,B>>, Structure2D.LongRowColumn, Structure2D.ReducibleTo1D<R extends Structure1D>, Structure2D.Reshapable, Structure2D.RowColumnKey<R,C>, Structure2D.RowColumnMapper<R,C>
-
-
Field Summary
Fields Modifier and Type Field Description private Primitive2DmyConstraintsBodyprivate Primitive1DmyConstraintsRHSprivate Primitive1DmyObjective(package private) static NumberContextPRECISIONUsed when pivoting to identify rows with elements that are already very close to zero (to avoid updating those rows).-
Fields inherited from class org.ojalgo.optimisation.linear.SimplexStore
edgeWeights, excluded, included, m, n, structure
-
-
Constructor Summary
Constructors Constructor Description SimplexTableau(LinearStructure linearStructure)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description (package private) voidcalculateDualDirection(SimplexSolver.ExitInfo exit)(package private) voidcalculateIteration(SimplexSolver.IterDescr iteration, double shift)(package private) voidcalculatePrimalDirection(SimplexSolver.EnterInfo enter)(package private) Primitive2DconstraintsBody()The area of the tableau corresponding to the constraints' body.(package private) Primitive1DconstraintsRHS()The 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) intfindNextPivotColumn(Access1D<java.lang.Double> auxiliaryRow, Access1D<java.lang.Double> objectiveRow)(package private) abstract booleanfixVariable(int index, double value)(package private) java.util.Collection<Equation>generateCutCandidates(boolean[] integer, NumberContext accuracy, double fractionality)Simplified version ofSimplexStore.generateCutCandidates(boolean[], NumberContext, double, double[])for specific use withSimplexTableauSolver.java.lang.Doubleget(long row, long col)(package private) doublegetCost(int j)(package private) doublegetCurrentElement(int i, SimplexSolver.EnterInfo enter)The current (tableau) constraint body element.(package private) doublegetCurrentElement(SimplexSolver.ExitInfo exit, int je)The current (tableau) constraint body element.(package private) doublegetCurrentRHS(int i)The current (tableau) constraint RHS.(package private) abstract doublegetInfeasibility()(package private) doublegetInfeasibility(int i)(package private) abstract doublegetValue()(package private) abstract Primitive2DnewConstraintsBody()(package private) abstract Primitive1DnewConstraintsRHS()(package private) abstract Primitive1DnewObjective()(package private) SimplexTableauSolvernewSimplexTableauSolver(Optimisation.Options optimisationOptions)(package private) static java.util.function.Function<LinearStructure,SimplexTableau>newTableauFactory(Optimisation.Options options)(package private) Primitive1Dobjective()The area of the tableau corresponding to the objective function.protected voidpivot(SimplexSolver.IterDescr iteration)protected voidpivot(SimplexTableauSolver.IterationPoint iteration)(package private) voidprepareToIterate()(package private) voidresetBasis(int[] newBasis)Everything that is not in the basis is set to be in at lower bound.voidset(long row, long col, java.lang.Comparable<?> value)(package private) voidsetupClassicPhase1Objective()(package private) Primitive1DsliceBodyColumn(int col)(package private) Primitive1DsliceBodyRow(int row)(package private) Primitive1DsliceConstraintsRHS()(package private) Primitive1DsliceDualVariables()(package private) Primitive1DsliceTableauColumn(int col)(package private) Primitive1DsliceTableauRow(int row)java.lang.StringtoString()(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) doublevalue(boolean phase1)The current, phase 1 or 2, objective function value-
Methods inherited from class org.ojalgo.optimisation.linear.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, upper
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.ojalgo.structure.Access1D
asCollectable1D, asKeyed1D, asList, axpy, dot, select, supplyTo, toList, toRawCopy1D
-
Methods inherited from interface org.ojalgo.structure.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, toRawCopy2D
-
Methods inherited from interface org.ojalgo.structure.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, set
-
Methods inherited from interface org.ojalgo.structure.Structure2D
count, countColumns, countRows, firstInColumn, firstInRow, getColDim, getMaxDim, getMinDim, getRowDim, isEmpty, isFat, isScalar, isSquare, isTall, isVector, limitOfColumn, limitOfRow, size
-
-
-
-
Field Detail
-
PRECISION
static final NumberContext PRECISION
Used when pivoting to identify rows with elements that are already very close to zero (to avoid updating those rows).
-
myConstraintsBody
private transient Primitive2D myConstraintsBody
-
myConstraintsRHS
private transient Primitive1D myConstraintsRHS
-
myObjective
private transient Primitive1D myObjective
-
-
Constructor Detail
-
SimplexTableau
SimplexTableau(LinearStructure linearStructure)
-
-
Method Detail
-
newTableauFactory
static java.util.function.Function<LinearStructure,SimplexTableau> newTableauFactory(Optimisation.Options options)
-
get
public final java.lang.Double get(long row, long col)
-
set
public final void set(long row, long col, java.lang.Comparable<?> value)
-
toString
public java.lang.String 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
protected final void pivot(SimplexSolver.IterDescr iteration)
- Overrides:
pivotin classSimplexStore
-
pivot
protected final void pivot(SimplexTableauSolver.IterationPoint iteration)
-
calculateDualDirection
final void calculateDualDirection(SimplexSolver.ExitInfo exit)
- Specified by:
calculateDualDirectionin classSimplexStore
-
calculateIteration
void calculateIteration(SimplexSolver.IterDescr iteration, double shift)
- Specified by:
calculateIterationin classSimplexStore
-
calculatePrimalDirection
final void calculatePrimalDirection(SimplexSolver.EnterInfo enter)
- Specified by:
calculatePrimalDirectionin classSimplexStore
-
constraintsBody
final Primitive2D constraintsBody()
The area of the tableau corresponding to the constraints' body.- Specified by:
constraintsBodyin classSimplexStore- See Also:
SimplexStore.constraintsBody()
-
constraintsRHS
final Primitive1D constraintsRHS()
The area of the tableau corresponding to the constraints' RHS.- Specified by:
constraintsRHSin classSimplexStore- See Also:
SimplexStore.constraintsRHS()
-
findNextPivotColumn
final int findNextPivotColumn(Access1D<java.lang.Double> auxiliaryRow, Access1D<java.lang.Double> objectiveRow)
-
fixVariable
abstract boolean fixVariable(int index, double value)
-
generateCutCandidates
final java.util.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
final double getCurrentElement(SimplexSolver.ExitInfo exit, int je)
Description copied from class:SimplexStoreThe current (tableau) constraint body element.- Specified by:
getCurrentElementin classSimplexStore
-
getCurrentElement
final double getCurrentElement(int i, SimplexSolver.EnterInfo enter)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
abstract Primitive2D newConstraintsBody()
-
newConstraintsRHS
abstract Primitive1D newConstraintsRHS()
-
newObjective
abstract Primitive1D newObjective()
-
newSimplexTableauSolver
final SimplexTableauSolver newSimplexTableauSolver(Optimisation.Options optimisationOptions)
-
objective
final Primitive1D objective()
The area of the tableau corresponding to the objective function.- Specified by:
objectivein classSimplexStore- See Also:
SimplexStore.objective()
-
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
final Primitive1D sliceBodyColumn(int col)
-
sliceBodyRow
final Primitive1D sliceBodyRow(int row)
- Specified by:
sliceBodyRowin classSimplexStore
-
sliceConstraintsRHS
final Primitive1D sliceConstraintsRHS()
-
sliceDualVariables
final Primitive1D sliceDualVariables()
- Specified by:
sliceDualVariablesin classSimplexStore- Returns:
- An array of the dual variable values (of the original problem, never phase 1).
-
sliceTableauColumn
final Primitive1D sliceTableauColumn(int col)
-
sliceTableauRow
final Primitive1D sliceTableauRow(int row)
-
updateDualEdgeWeights
void updateDualEdgeWeights(SimplexSolver.IterDescr iteration)
Description copied from class:SimplexStoreUpdate edge weights for basic (included) variables.- Specified by:
updateDualEdgeWeightsin classSimplexStore
-
updatePrimalEdgeWeights
void updatePrimalEdgeWeights(SimplexSolver.IterDescr iteration)
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
-
-