% 線形計画法
% 下界と上界を指定

% minimize f'x
% subject to Ax <= b
%            Cx  = d
%            xlb <= x <= xub
% x = linprog(f, A, b, C, d, xlb, xub)

% minimize    -x_1    -x_2
% subject to 3 x_1 +   x_2 <= 15
%            2 x_1 + 3 x_2 <= 24
%              x_1 >= 0, x_2 >= 0

f = [ -1; -1 ];
A = [ 3,  1;
      2,  3 ];
b = [ 15; 24 ];
xlb = [ 0; 0 ];
x = linprog(f, A, b, [], [], xlb, []);
x
