%POLYPLOT  function polyplot(A,b,x1int,x2int,linstp,linlen)
%
%          Polyplot plots the feasible region given by the two-dimensional
%          polyhedron { x | Ax =< b }.
%
%          x1int     is a two-dimensional vector [x1min x1max]' denoting the
%                    minimal and maximal x1-coordinates of the plot.
%          x2int     is a two-dimensional vector [x2min x2max]' denoting the
%                    minimal and maximal x2-coordinates of the plot. (Default
%                    ix x1int)
%          linstp    steplength between lines denoting the infeasible side of
%                    the inequality. (Default is (x2max-x2min)/60)
%          linlen    length of the shaded lines denoting the infeasible side
%                    of the inequality. (Default is (x2max-x2min)/30)

function [dummy] = polyplot(A,b,x1int,x2int,linstp,linlen)

if nargin < 3
   fprintf(' \n')
   fprintf(' Too few input arguments to polyplot. At least three required.\n' )
   fprintf(' \n')
else

   [m,n] = size(A);

   if nargin < 4
      x2int = x1int;
   end
   
   if nargin < 5
      linstp = (x2int(2)-x2int(1))/60;
   end

   if nargin < 6
      linlen = (x2int(2)-x2int(1))/30;
   end

%   clg;
   hold on;

   for irow = 1:m,
      ineqplot(A(irow,:),b(irow),x1int,x2int,linstp,linlen);
   end

%   axis( [ x1int(1) x1int(2) x2int(1) x2int(2) ] );
%   axis('square')
   
end
