Package org.ojalgo.optimisation.linear
Class SimplexTableau
- 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 Primitive2D
myConstraintsBody
private Primitive1D
myConstraintsRHS
private Primitive1D
myObjective
-
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) void
calculateDualDirection(SimplexSolver.ExitInfo exit)
(package private) void
calculateIteration()
(package private) void
calculatePrimalDirection(SimplexSolver.EnterInfo enter)
(package private) Primitive2D
constraintsBody()
The area of the tableau corresponding to the constraints' body.(package private) Primitive1D
constraintsRHS()
The area of the tableau corresponding to the constraints' RHS.protected abstract void
doPivot(int row, int col)
Perform the pivot operation on the tableau – only.(package private) int
findNextPivotColumn(Access1D<java.lang.Double> auxiliaryRow, Access1D<java.lang.Double> objectiveRow)
(package private) abstract boolean
fixVariable(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[])
.java.lang.Double
get(long row, long col)
(package private) double
getCost(int j)
(package private) double
getCurrentElement(int i, SimplexSolver.EnterInfo enter)
The current (tableau) constraint body element.(package private) double
getCurrentElement(SimplexSolver.ExitInfo exit, int je)
The current (tableau) constraint body element.(package private) double
getCurrentRHS(int i)
The current (tableau) constraint RHS.(package private) abstract double
getInfeasibility()
(package private) double
getInfeasibility(int i)
(package private) double
getReducedCost(int je)
(package private) abstract double
getValue()
(package private) abstract Primitive2D
newConstraintsBody()
(package private) abstract Primitive1D
newConstraintsRHS()
(package private) abstract Primitive1D
newObjective()
(package private) SimplexTableauSolver
newSimplexTableauSolver(Optimisation.Options optimisationOptions)
(package private) static java.util.function.Function<LinearStructure,SimplexTableau>
newTableauFactory(Optimisation.Options options)
(package private) Primitive1D
objective()
The area of the tableau corresponding to the objective function.protected void
pivot(SimplexSolver.IterDescr iteration)
protected void
pivot(SimplexTableauSolver.IterationPoint iteration)
(package private) void
resetBasis(int[] newBasis)
Everything that is not in the basis is set to be in at lower bound.void
set(long row, long col, java.lang.Comparable<?> value)
(package private) void
setupClassicPhase1Objective()
(package private) Primitive1D
sliceBodyColumn(int col)
(package private) Primitive1D
sliceBodyRow(int row)
(package private) Primitive1D
sliceConstraintsRHS()
(package private) Primitive1D
sliceDualVariables()
(package private) Primitive1D
sliceTableauColumn(int col)
(package private) Primitive1D
sliceTableauRow(int row)
java.lang.String
toString()
(package private) double
value(boolean phase1)
The current, phase 1 or 2, objective function value-
Methods inherited from class org.ojalgo.optimisation.linear.SimplexStore
copyBasicSolution, copyObjective, countRemainingArtificials, extractSolution, extractValue, generateCutCandidates, getColumnState, getExcludedLower, getExcludedUnbounded, getExcludedUpper, getLowerBound, getLowerBounds, getLowerGap, getRange, getUpperBound, getUpperBounds, getUpperGap, isArtificial, isExcluded, isIncluded, isNegated, isPrintable, isRemainingArtificials, lower, newDualSimplexSolver, newPhasedSimplexSolver, newPrimalSimplexSolver, newStoreFactory, restoreObjective, shiftColumn, switchObjective, 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, axpy, dot, select, supplyTo, 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
-
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:
toString
in 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:
pivot
in classSimplexStore
-
pivot
protected final void pivot(SimplexTableauSolver.IterationPoint iteration)
-
calculateDualDirection
final void calculateDualDirection(SimplexSolver.ExitInfo exit)
- Specified by:
calculateDualDirection
in classSimplexStore
-
calculateIteration
final void calculateIteration()
- Specified by:
calculateIteration
in classSimplexStore
-
calculatePrimalDirection
final void calculatePrimalDirection(SimplexSolver.EnterInfo enter)
- Specified by:
calculatePrimalDirection
in classSimplexStore
-
constraintsBody
final Primitive2D constraintsBody()
The area of the tableau corresponding to the constraints' body.- Specified by:
constraintsBody
in classSimplexStore
- See Also:
SimplexStore.constraintsBody()
-
constraintsRHS
final Primitive1D constraintsRHS()
The area of the tableau corresponding to the constraints' RHS.- Specified by:
constraintsRHS
in 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[])
.
-
getCost
final double getCost(int j)
- Specified by:
getCost
in classSimplexStore
-
getCurrentElement
final double getCurrentElement(SimplexSolver.ExitInfo exit, int je)
Description copied from class:SimplexStore
The current (tableau) constraint body element.- Specified by:
getCurrentElement
in classSimplexStore
-
getCurrentElement
final double getCurrentElement(int i, SimplexSolver.EnterInfo enter)
Description copied from class:SimplexStore
The current (tableau) constraint body element.- Specified by:
getCurrentElement
in classSimplexStore
-
getCurrentRHS
final double getCurrentRHS(int i)
Description copied from class:SimplexStore
The current (tableau) constraint RHS.- Specified by:
getCurrentRHS
in classSimplexStore
-
getInfeasibility
abstract double getInfeasibility()
- Returns:
- The phase 1 objective function value
-
getInfeasibility
final double getInfeasibility(int i)
- Specified by:
getInfeasibility
in classSimplexStore
-
getReducedCost
final double getReducedCost(int je)
- Specified by:
getReducedCost
in 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:
objective
in classSimplexStore
- See Also:
SimplexStore.objective()
-
resetBasis
final void resetBasis(int[] newBasis)
Description copied from class:SimplexStore
Everything that is not in the basis is set to be in at lower bound.- Overrides:
resetBasis
in classSimplexStore
-
setupClassicPhase1Objective
final void setupClassicPhase1Objective()
- Specified by:
setupClassicPhase1Objective
in classSimplexStore
-
sliceBodyColumn
final Primitive1D sliceBodyColumn(int col)
-
sliceBodyRow
final Primitive1D sliceBodyRow(int row)
- Specified by:
sliceBodyRow
in classSimplexStore
-
sliceConstraintsRHS
final Primitive1D sliceConstraintsRHS()
-
sliceDualVariables
final Primitive1D sliceDualVariables()
- Specified by:
sliceDualVariables
in 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)
-
value
final double value(boolean phase1)
The current, phase 1 or 2, objective function value
-
-