Ain=[1 1 -3  0 0 0
     0 -1 1 1 0  1
     0 -1 2 0 1  3]
A0=Ain;
bin=Ain(:,end);
row=2;col=3;
basis=[3 4 ];
disp(['original basis is: ',num2str(basis)])
keyboard
disp(['pivot on row,col: ',num2str([row col])]);
A=piv(Ain,row,col)
basis=[ 2 4 ];
disp(['new basis is: ',num2str(basis)])
Ain=A;
bin=Ain(:,end);
keyboard
row=3;col=2;
disp(['pivot on row,col: ',num2str([row col])]);
A=piv(Ain,row,col)
basis=[  2 1];
disp(['new basis is: ',num2str(basis)])
Ain=A;
bin=Ain(:,end);
disp('problem is unbounded')
