function z = pathbd(M,q,l,u)
% syntax z = pathbd(M,q,l,u)

if nargin < 4
  u = Big*ones(size(q));
  if nargin < 3
    l = zeros(size(q));
    if nargin < 2
      error('must have two input arguments for pathbd (M,q,...)');
    end
  end
end
q = q(:); n = length(q);
l = l(:); u = u(:);
Big = 1e20;
[mm,mn] = size(M);
if (mm ~= mn | mm ~= n) 
  error('dimensions of M and q must match');
end

u = min(Big*ones(n,1),u);
l = max(-Big*ones(n,1),l);
z = max(l,min(u,ones(n,1)));

nnzJ = nnz(M);
  
[status,ttime]  = lcppath(n, nnzJ, z, l, u, M, q);
if (status ~= 1) 
  status,
  error('Path fails to solve problem');
end
return;


