function [A, b, x0] = getprob (prob_number, pdir)
%-------------------------------------------------------
% Reads a test problem into Matlab matrices [A, b, x0]
% Input: problem_number  --- an integer, must be given 
%        pdir (optional) --- a char string for the path
%             where the data files reside (if not given,
%             then the current directory is assumed).
%-------------------------------------------------------
  if ~exist('pdir')
     pdir = './';
  else
     if pdir(length(pdir))~= '/'
        pdir = [pdir '/'];
     end
  end

  i = prob_number;
  eval(['load ' pdir 'p' int2str(i) '.dat']);
  eval(['p=p' int2str(i) ';']);
  eval(['clear p' int2str(i)]);

  m = p(1); n = p(2); j = 2;
  A = sparse(m,n);

  A(:) = p(j+1:j+m*n); j = j + m*n;
  b    = p(j+1:j+m);   j = j + m;
  x0   = p(j+1:j+n);
