function xx=next(A,b,x,d,II);

eps=10^(-6);
[m,n]=size(A);
lvec=[];

for i=1:m
 if II(i)==0
   ss=sign(A(i,:)*d');
   // disp("sign is ",ss);
   if ss>0
     lam=(b(i)-A(i,:)*x')/(A(i,:)*d');
     lvec=[lam lvec];
  end;
 end;
end;
// disp(lvec);
xx=x+min(lvec)*d;

return;





