Class SimplexTableauSolver

All Implemented Interfaces:
Optimisation, Optimisation.Solver, UpdatableSolver

final class SimplexTableauSolver extends LinearSolver
Classic simplex tableau solver:
  • Primal algorithm
  • 2-phase
  • All variables assumed >=0, and RHS required to be >=0
  • Variable bounds other than >=0 handled like constraints
  • Field Details

  • Constructor Details

  • Method Details

    • build

      static <T extends SimplexTableau> T build(ExpressionsBasedModel model, Function<LinearStructure, T> factory)
    • doSolveConvexAsDual

      static Optimisation.Result doSolveConvexAsDual(ConvexData<Double> convex, Optimisation.Options options, boolean zeroC)
    • doSolveConvexAsPrimal

      static Optimisation.Result doSolveConvexAsPrimal(ConvexData<Double> convex, Optimisation.Options options, boolean zeroC)
    • set

      static void set(ExpressionsBasedModel model, Primitive2D constraintsBdy, int indCnstr, int basePosVars, int baseNegVars, Structure1D.IntIndex key, double factor)
    • set

      static void set(ExpressionsBasedModel model, Primitive2D constraintsBdy, int indCnstr, int basePosVars, int baseNegVars, Variable variable, double factor)
    • sizeOfDual

      static int sizeOfDual(ConvexData<?> convex)
    • sizeOfPrimal

      static int sizeOfPrimal(ConvexData<?> convex)
    • fixVariable

      public boolean fixVariable(int index, double value)
      Parameters:
      index - The, solver specific, variable index
      value - The value to fix that variable to
      Returns:
      true if fixing is supported and was successful, otherwise false
    • generateCutCandidates

      public final Collection<Equation> generateCutCandidates(double fractionality, boolean... integer)
    • getEntityMap

      public LinearStructure getEntityMap()
    • solve

      public Optimisation.Result solve(Optimisation.Result kickStarter)
    • updateRange

      public boolean updateRange(int index, double lower, double upper)
      Description copied from interface: UpdatableSolver
      A generalisation of UpdatableSolver.fixVariable(int, double) where the new/updated lower and upper bounds do not need to be equal.
      Parameters:
      index - The, solver specific, variable index
      lower - New lower bound
      upper - New upper bound
      Returns:
      true if updating the range is supported and was successful, otherwise false
    • cleanUpPhase1Artificials

      private void cleanUpPhase1Artificials()
      https://math.stackexchange.com/questions/3254444/artificial-variables-in-two-phase-simplex-method
    • getRowObjective

      private int getRowObjective()
    • infeasibility

      private double infeasibility()
    • isTableauPrintable

      private boolean isTableauPrintable()
    • logDebugTableau

      private void logDebugTableau(String message)
    • phase

      private int phase()
    • value

      private double value()
    • buildResult

      protected Optimisation.Result buildResult()
    • evaluateFunction

      protected double evaluateFunction(Access1D<?> solution)
    • extractMultipliers

      protected Access1D<?> extractMultipliers()
    • extractSolution

      protected Access1D<?> extractSolution()
      Extract solution MatrixStore from the tableau. Should be able to feed this to evaluateFunction(Access1D).
    • initialise

      protected boolean initialise(Optimisation.Result kickStarter)
    • needsAnotherIteration

      protected boolean needsAnotherIteration()
    • validate

      protected boolean validate()
    • findNextPivotCol

      int findNextPivotCol()
    • findNextPivotRow

      int findNextPivotRow()
    • performIteration

      void performIteration(SimplexTableauSolver.IterationPoint pivot)