Package org.ojalgo.optimisation.linear
Class SparseTableau
- java.lang.Object
-
- org.ojalgo.optimisation.linear.SimplexStore
-
- org.ojalgo.optimisation.linear.SimplexTableau
-
- org.ojalgo.optimisation.linear.SparseTableau
-
- All Implemented Interfaces:
Access1D<java.lang.Double>
,Access2D<java.lang.Double>
,Mutate1D
,Mutate2D
,Structure1D
,Structure2D
final class SparseTableau extends SimplexTableau
-
-
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 static Array1D.Factory<java.lang.Double>
ARRAY1D_FACTORY
private static DenseArray.Factory<java.lang.Double>
DENSE_FACTORY
private DenseArray<java.lang.Double>
myAuxiliaryObjective
private double
myAuxiliaryValue
private SparseArray<java.lang.Double>[]
myBody
private Array1D<java.lang.Double>
myObjective
private Array1D<java.lang.Double>
myRHS
private SparseArray.SparseFactory<java.lang.Double>
mySparseFactory
private double
myValue
-
Constructor Summary
Constructors Constructor Description SparseTableau(int mm, int nn)
SparseTableau(LinearStructure linearStructure)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
copyBasicSolution(double[] solution)
(package private) void
copyObjective()
protected void
doPivot(int row, int col)
Perform the pivot operation on the tableau – only.private void
doPivot(int row, int col, SparseArray<java.lang.Double> body, double rhs)
double
doubleValue(int row, int col)
Extracts one element of this matrix as a double.(package private) double
extractValue()
(package private) boolean
fixVariable(int index, double value)
int
getColDim()
(package private) double
getInfeasibility()
int
getRowDim()
(package private) double
getValue()
(package private) Primitive2D
newConstraintsBody()
(package private) Primitive1D
newConstraintsRHS()
(package private) Primitive1D
newObjective()
(package private) void
restoreObjective()
private static double
scale(SparseArray<java.lang.Double> body, double rhs, int col)
void
set(int row, int col, double value)
protected void
shiftColumn(int col, double shift)
(package private) void
switchObjective()
-
Methods inherited from class org.ojalgo.optimisation.linear.SimplexTableau
calculateDualDirection, calculateIteration, calculatePrimalDirection, constraintsBody, constraintsRHS, findNextPivotColumn, generateCutCandidates, get, getCost, getCurrentElement, getCurrentElement, getCurrentRHS, getInfeasibility, getReducedCost, newSimplexTableauSolver, newTableauFactory, objective, pivot, pivot, resetBasis, set, setupClassicPhase1Objective, sliceBodyColumn, sliceBodyRow, sliceConstraintsRHS, sliceDualVariables, sliceTableauColumn, sliceTableauRow, toString, value
-
Methods inherited from class org.ojalgo.optimisation.linear.SimplexStore
countRemainingArtificials, extractSolution, generateCutCandidates, getColumnState, getExcludedLower, getExcludedUnbounded, getExcludedUpper, getLowerBound, getLowerBounds, getLowerGap, getRange, getUpperBound, getUpperBounds, getUpperGap, isArtificial, isExcluded, isIncluded, isNegated, isPrintable, isRemainingArtificials, lower, newDualSimplexSolver, newPhasedSimplexSolver, newPrimalSimplexSolver, newStoreFactory, 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, 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
-
Methods inherited from interface org.ojalgo.structure.Structure2D
count, countColumns, countRows, firstInColumn, firstInRow, getMaxDim, getMinDim, isEmpty, isFat, isScalar, isSquare, isTall, isVector, limitOfColumn, limitOfRow, size
-
-
-
-
Field Detail
-
ARRAY1D_FACTORY
private static final Array1D.Factory<java.lang.Double> ARRAY1D_FACTORY
-
DENSE_FACTORY
private static final DenseArray.Factory<java.lang.Double> DENSE_FACTORY
-
myAuxiliaryObjective
private DenseArray<java.lang.Double> myAuxiliaryObjective
-
myAuxiliaryValue
private double myAuxiliaryValue
-
myBody
private final SparseArray<java.lang.Double>[] myBody
-
myObjective
private final Array1D<java.lang.Double> myObjective
-
myRHS
private final Array1D<java.lang.Double> myRHS
-
mySparseFactory
private final SparseArray.SparseFactory<java.lang.Double> mySparseFactory
-
myValue
private double myValue
-
-
Constructor Detail
-
SparseTableau
SparseTableau(int mm, int nn)
-
SparseTableau
SparseTableau(LinearStructure linearStructure)
-
-
Method Detail
-
scale
private static double scale(SparseArray<java.lang.Double> body, double rhs, int col)
-
doubleValue
public double doubleValue(int row, int col)
Description copied from interface:Access2D
Extracts one element of this matrix as a double.- Parameters:
row
- A row index.col
- A column index.- Returns:
- One matrix element
-
getColDim
public int getColDim()
- Returns:
- The number of columns
-
getRowDim
public int getRowDim()
- Returns:
- The number of rows
-
set
public void set(int row, int col, double value)
-
doPivot
private void doPivot(int row, int col, SparseArray<java.lang.Double> body, double rhs)
-
doPivot
protected void doPivot(int row, int col)
Description copied from class:SimplexTableau
Perform the pivot operation on the tableau – only. Various auxiliary bookkeeping should NOT be done here.- Specified by:
doPivot
in classSimplexTableau
-
shiftColumn
protected void shiftColumn(int col, double shift)
- Overrides:
shiftColumn
in classSimplexStore
-
copyBasicSolution
void copyBasicSolution(double[] solution)
- Specified by:
copyBasicSolution
in classSimplexStore
-
copyObjective
void copyObjective()
- Specified by:
copyObjective
in classSimplexStore
-
extractValue
double extractValue()
- Specified by:
extractValue
in classSimplexStore
-
fixVariable
boolean fixVariable(int index, double value)
- Specified by:
fixVariable
in classSimplexTableau
-
getInfeasibility
double getInfeasibility()
- Specified by:
getInfeasibility
in classSimplexTableau
- Returns:
- The phase 1 objective function value
-
getValue
double getValue()
- Specified by:
getValue
in classSimplexTableau
- Returns:
- The (phase 2) objective function value
-
newConstraintsBody
Primitive2D newConstraintsBody()
- Specified by:
newConstraintsBody
in classSimplexTableau
-
newConstraintsRHS
Primitive1D newConstraintsRHS()
- Specified by:
newConstraintsRHS
in classSimplexTableau
-
newObjective
Primitive1D newObjective()
- Specified by:
newObjective
in classSimplexTableau
-
restoreObjective
void restoreObjective()
- Specified by:
restoreObjective
in classSimplexStore
-
switchObjective
void switchObjective()
- Specified by:
switchObjective
in classSimplexStore
-
-