Class SimplexStore

java.lang.Object
org.ojalgo.optimisation.linear.SimplexStore
Direct Known Subclasses:
RevisedStore, SimplexTableau

abstract class SimplexStore extends Object
  • Field Details

    • myLowerBounds

      private final double[] myLowerBounds
    • myPartition

      private final EnumPartition<SimplexStore.ColumnState> myPartition
    • myRemainingArtificials

      private int myRemainingArtificials
    • myToStringList

      private final List<String> myToStringList
    • myUpperBounds

      private final double[] myUpperBounds
    • edgeWeights

      final double[] edgeWeights
      Either the primal or dual devex edge weights, depending on the algorithm used. Sized so that it can hold either.
    • excluded

      final int[] excluded
      excluded == not in the basis
    • included

      final int[] included
      included == in the basis
    • m

      final int m
      The number of constraints (upper, lower and equality)
    • n

      final int n
      The number of variables totally (all kinds)
    • structure

      final LinearStructure structure
  • Constructor Details

  • Method Details

    • newStoreFactory

      static Function<LinearStructure, SimplexStore> newStoreFactory(Optimisation.Options options)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • basis

      private final SimplexStore basis(int index)
    • newSolver

      private <S extends SimplexSolver> S newSolver(BiFunction<Optimisation.Options, SimplexStore, S> constructor, Optimisation.Options options, int... basis)
    • pivot

      protected void pivot(SimplexSolver.IterDescr iteration)
    • shiftColumn

      protected void shiftColumn(int col, double shift)
    • calculateDualDirection

      abstract void calculateDualDirection(SimplexSolver.ExitInfo exit)
    • calculateIteration

      abstract void calculateIteration(SimplexSolver.IterDescr iteration, double shift)
    • calculatePrimalDirection

      abstract void calculatePrimalDirection(SimplexSolver.EnterInfo enter)
    • constraintsBody

      abstract Mutate2D constraintsBody()
      The simplex' constraints body (including the parts corresponding to slack and artificial variables).
    • constraintsRHS

      abstract Mutate1D constraintsRHS()
      The simplex' constraints RHS.
    • copyBasicSolution

      abstract void copyBasicSolution(double[] solution)
    • 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)
      When SimplexSolver is used as node solver for IntegerSolver this method generates cut candidates.
    • getColumnState

      final SimplexStore.ColumnState getColumnState(int index)
    • getCost

      abstract double getCost(int i)
    • getCurrentElement

      abstract double getCurrentElement(SimplexSolver.ExitInfo exit, int je)
      The current (tableau) constraint body element.
    • getCurrentElement

      abstract double getCurrentElement(int i, SimplexSolver.EnterInfo enter)
      The current (tableau) constraint body element.
    • getCurrentRHS

      abstract double getCurrentRHS(int i)
      The current (tableau) constraint RHS.
    • 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

      final SimplexStore lower(int index)
    • newDualSimplexSolver

      final DualSimplexSolver newDualSimplexSolver(Optimisation.Options options, int... basis)
    • newPhasedSimplexSolver

      final PhasedSimplexSolver newPhasedSimplexSolver(Optimisation.Options options, int... basis)
    • newPrimalSimplexSolver

      final PrimalSimplexSolver newPrimalSimplexSolver(Optimisation.Options options, int... basis)
    • objective

      abstract Mutate1D objective()
      The objective function.
    • phase1

      abstract <T extends Mutate1D & Access1D<Double>> T phase1()
      The phase-1 objective function.
    • prepareToIterate

      abstract void prepareToIterate()
    • removePhase1

      abstract void removePhase1()
    • resetBasis

      void resetBasis(int[] newBasis)
      Everything that is not in the basis is set to be in at lower bound.
    • resetEdgeWeights

      void resetEdgeWeights()
    • setupClassicPhase1Objective

      abstract void setupClassicPhase1Objective()
    • sliceBodyRow

      abstract Primitive1D sliceBodyRow(int row)
    • sliceDualVariables

      abstract Primitive1D sliceDualVariables()
    • unbounded

      final SimplexStore unbounded(int index)
    • update

      final void update(int exit, int exclEnter)
    • updateBasis

      final void updateBasis(int exit, SimplexStore.ColumnState exitToBound, int enter)
    • updateDualEdgeWeights

      abstract void updateDualEdgeWeights(SimplexSolver.IterDescr iteration)
      Update edge weights for basic (included) variables.
    • updatePrimalEdgeWeights

      abstract void updatePrimalEdgeWeights(SimplexSolver.IterDescr iteration)
      Update edge weights for non-basic (excluded) variables.
    • updateRange

      boolean updateRange(int index, double lower, double upper)
    • upper

      final SimplexStore upper(int index)