%
% Numerical Mathematics and Computing, Fifth Edition
% Ward Cheney & David Kincaid
% Brooks/Cole Publ. Co.
% (c) 2003
%
% file:  lin_prog4
%
% Minimize the objective function subject to the given constraints:
%
% obj := e;
% consts := {2*y1 + 3*y2 - 5*y3 - e <= 4,
%              y1 -   y2        - e <= 2,
%              y1 + 2*y2 - 3*y3 - e <= 7,
%           -2*y1 - 3*y2 + 5*y3 - e <= -4,
%             -y1 +   y2        - e <= -2,
%             -y1 - 2*y2 + 3*y3 - e <= -7};
%simplex[minimize](obj, consts, NONNEGATIVE);
%
  f = [ 0; 0; 0; 1.0 ];

  A = [ 2,  3, -5, -1; ...
        1, -1,  0, -1; ...
        1,  2, -3, -1; ...
       -2, -3,  5, -1; ...
       -1,  1,  0, -1; ...
       -1, -2,  3, -1 ];

  b = [ 4; 2; 7; -4; -2; -7 ];
  Aeq = [];
  beq = [];
  lb = [ 0.0; 0.0; 0.0; 0.0 ];
  ub = [ Inf; Inf; Inf; Inf ];
  x = linprog ( f, A, b, Aeq, beq, lb, ub )
