% MULHGRSS   multiply a vector with a higher order generator representable semiseparable matrix
%       
%       x=MULUV(U,V,b) This function multiplies the generator
%       representable matrix S, with generators U and V with the vector b
%  
%       U and V are two n x p matrices with n the size of the matrix and
%       p the semiseparability rank.
%
%       b should be an arbitrary column vector of corresponding dimension.
%       the output vector x contains the solution
%       
%
%
%       Software of the MaSe - Group
%       mase-at-cs.kuleuven.ac.be
%       Revision Date: 08/04/2005



function b=MULHGRSS(U,V,x)
  
  % initialization 
  n=length(x);
  
  % Now the part corresponding to the multiplication of the upper
  % triangular part.
    
  factor=x(n)*U(n,:);
  b(n)=0;
  
  for i=n-1:-1:1
    b(i)=factor*V(i,:)';
    factor=factor+x(i)*U(i,:);
  end
  
  % Now the part corresponding to the multiplication of the lower
  % triangular part of the matrix
  
  factor=0;
  
  for i=1:n
    factor=factor+x(i)*V(i,:);
    b(i)=b(i)+factor*U(i,:)';
  end
  
  b=b';
  
  
  
  