function [A,bv] = LP_setup_transport(A,M,N)
% this has been modified to work on the transport problem
%
% [A,bv] = LP_setup_transport(A,M,N)
%
% M = number of suppliers
% N = number of demanders
% 
% This file was written by Mary Pugh, mpugh@math.toronto.edu, in
% March 2002.  Please do not use this without her consent and 
% without attributing her.

[m,n] = size(A);
% number of input variables
m = m-1;
for i=1:m
  a = input('what is your basic variable?  ','s');
  nn = length(a);
  b = a(2:nn);
  for j=1:M*10+N;
    if int2str(j) == b
      bv(i) = j;
    end
  end
end

disp(' ')
disp(' ')

[m,n] = size(A);
s = '  bv   ';
for i=1:M
  for j=1:N
    a = int2str(i);
    b = strcat('   x',a);
    a = int2str(j);
    b = strcat(b,a);
    b = strcat(b,'        ');
    s = strcat(s,b);
  end
end
s = strcat('      ',s);
disp(s)

for i=1:m-1
  b = strcat('   x',int2str(bv(i)));
  c = sprintf('%4.4g  ',A(i,:));
  disp(strcat(b,c)) 
end
b = '   obj';
c = sprintf('%4.4g  ',A(m,:));
disp(strcat(b,c)) 
disp(' ')
disp(' ')

