%  MULLS   performs an O(n) matrix vector multiplication
%    
%    B=MULLS(G,d,X) is the vector B=LS*X where LS is the lower triangular
%    semiseparable matrix represented with the Givens-vector
%    representation G,d
%
%
%    Software of the MaSe - Group
%    mase-at-cs.kuleuven.ac.be
%    Revision Date: 04/05/2004
%
%


function b=MULLS(G,d,x)
    
  n=length(d);
  if n~=0
    
    % performs the multiplication
    % with the lower triangular semiseparable
    % part
    b(1)=x(1)*d(1);
    for i=1:n-1
      wv=b(i);
      b(i)=G(1,i)*wv;
      b(i+1)=G(2,i)*wv+x(i+1)*d(i+1);    
    end
    b=b';
  else
    b=[];
  end
  
  