Simplex:

--------------------------------------------------------------------------
   Uses the simplex method to minimize the cost when solving the problem
   au = b and the cost is cu. Constraints should be stacked in the
   following order:  hard, soft equality, soft inequailty.
--------------------------------------------------------------------------
   Form:
   [u, f, rc] = Simplex( c, a, b, maxValue, maxIter, slack, relax,
   nhardcon, nsofteq )
--------------------------------------------------------------------------

   ------
   Inputs
   ------
   c             (1,n)    Cost vector
   a             (m,n)    Constraint matrix
   b             (m,1)    Right-hand-side
   maxValue      (1,1)    Maximum constraint on u
   maxIter       (1,1)    Maximum number of iterations
   slack         (1,1)    Optional.   Set to 1 for a*u <= b    
                                      Set to 0 for a*u  = b    (default)
   relax         (1,1)    Optional.   Set to 1 to relax infeasible cnst
                                      Set to 0 for hard constraints (dflt)
   nhardcon      (1,1)    Number of hard constraints (used if relax = 1)
   nsofteq       (1,1)    Number of soft equality constraints (if relax=1)

   -------
   Outputs
   -------
   u             (n,1)    Solution
   f             (1,1)    Feasible solution = 1, No feasible solution = 0
   rc            (:,l)    vector denoting which constraints were relaxed
--------------------------------------------------------------------------

Children:

Common: Math/Mag
Common: Math/Simplex2