function logg=mylp(A,b,x,c,N);

// assumes that A is m by n, x is feasible. max cx', Ax'<=b

logg=x;
for jj=1:N

[I,II]=findI(A,b,x);
disp("II");
disp(II);

if sum(II)==0  //interior point

xx=next(A,b,x,c,II);
logg=[logg;xx];
x=xx;

else   // boundary point

  AI=A(I,:); // normals

  disp("AI");
  disp(AI);

  lam=c*AI'*inv(AI*AI');
  disp("lam");
  disp(lam);

  cc=c-lam*AI;
  disp("cc");
  disp(cc);

  if abs(cc*cc')>10^(-6) // there is a linear space in Dir(x)
    disp("cc is not zero");
    xx=next(A,b,x,cc,II);
    logg=[logg;xx];
    x=xx;
  else  // no linear space

    op=and(lam>0); // is c in cone(AI)?
    if op done=1; return; end;


    [ig,ii]=min(lam);
    C=AI*AI';
    CC=-inv(C);
    B=CC*AI;
    d=B(ii,:);
    disp("direction is");
    disp(d);
    xx=next(A,b,x,d,II);
    logg=[logg;xx];
    x=xx;
    end;
  end;
end;


