function xx,fm=myprgmh(m,n,A,b,c)B0=A(:,1:m);cb=c(:,1:m);xx=1:n;sgm=c-cb*B0-1*A;h=-1;sta=ones(m,1);for i=m+1:nif sgm(i)0h=1;endendwhile h0msg,mk=max(sgm);for i=1:msta(i)=b(i)/A(i,mk);endmst,mr=min(sta);zy=A(mr,mk);for i=1:mif i=mrfor j=1:nA(i,j)=A(i,j)/zy; endb(i)=b(i)/zy;endendfor i=1:mif i=mrfor j=1:nA(i,j)=A(i,j)-A(i,mk)*A(mr,j); endb(i)=b(i)-A(i,mk)*b(mr);endendB1=A(:,1:m);cb(mr)=c(mk);xx(mr)=mk;sgm=c-cb*B1*A;for i=m+1:nif sgm(i)0h=1;endend endfm=c*xx;