function testlp(ts)
% test case generator for linear programming

tts = 1;
if nargin >= 1
    tts = ts;
end

%options = optimset('LargeScale', 'off' ,'Display', 'iter');

switch tts
case 1,
    n = 5;
    m = 8;
    A = randn(m,n);
    f = rand(n,1);
    b = abs(rand(m,1));
 
case 2,

    f = [-5; -4; -6];
    A =  [1 -1  1
      3  2  4
      3  2  0
      -1 0 0
      0  -1 0
      0  0  -1];
    b = [20; 42; 30; 0; 0; 0];
    
case 3,
    f = [-1; 1];
    A =  [1 1  
          2 1
         -1 0 
          0 -1];
    b = [40; 60; 0; 0];
        
end

[m, n] = size(A);

[x,fval,exitflag,output,lambda] = linprog(f, A, b)
lambda.ineqlin

%[w,cas] = mysimplex([f;zeros(m,1)],[A eye(m)], b, [zeros(n,1); b])
[x1 l1 s1 iter mu] = myipm(f, -A, -b, zeros(n,1))

