Class SimplexTable

    • Constructor Detail

      • SimplexTable

        public SimplexTable​(LPCanonicalProblem1 problem,
                            double epsilon)
        Construct a simplex table from a canonical linear programming problem.
        Parameters:
        problem - a canonical linear programming problem
        epsilon - a precision parameter: when a number |x| ≤ ε, it is considered 0
      • SimplexTable

        public SimplexTable​(LPCanonicalProblem1 problem)
        Construct a simplex table from a canonical linear programming problem.
        Parameters:
        problem - a canonical linear programming problem
      • SimplexTable

        public SimplexTable​(LPProblem problem,
                            double epsilon)
        Construct a simplex table from a general linear programming problem.
        Parameters:
        problem - a general linear programming problem
        epsilon - a precision parameter: when a number |x| ≤ ε, it is considered 0
      • SimplexTable

        public SimplexTable​(LPProblem problem)
        Construct a simplex table from a general linear programming problem.
        Parameters:
        problem - a general linear programming problem
      • SimplexTable

        public SimplexTable​(SimplexTable table)
        Copy constructor.
        Parameters:
        table - a simplex table
    • Method Detail

      • getCostRow

        public double getCostRow​(int j)
        Get the table entry at [COST, j].
        Parameters:
        j - a column index, counting from 1
        Returns:
        T[COST, j]
      • getBCol

        public double getBCol​(int i)
        Get the table entry at [i, B].
        Parameters:
        i - a row index, counting from 1
        Returns:
        T[i, B]
      • getProblemSize

        public int getProblemSize()
        Get the number of variables in the problem or the cost/objective function.
        Returns:
        the number of variables
      • swap

        public SimplexTable swap​(int r,
                                 int s)
        Perform a Jordan Exchange to swap row r with column s.
        Parameters:
        r - the index to a entering variable (row)
        s - the index to a leaving variable (column)
        Returns:
        a swapped simplex table
      • isFeasible

        public boolean isFeasible()
        Check if this table is feasible.
        Returns:
        true if the table is feasible