The algorithm

The software is publicly available and can be found at the same site as mentioned in Section 3.2. The input of the function consists of two $ n\times p$ matrices $ U$ and $ V$, which are the generators of the semiseparable matrix $ S$ of semiseparability rank $ p$. The input vector $ b$ of length $ n$ is the right-hand side. The function returns as output the solution vector $ x$ of the system $ Sx=b$.

Similar as in the previous algorithm the complexity is given after each operation and operations involving indices and sign changes are not counted.


[fontsize=\footnotesize,numbers=left,frame=single,commandchars=\\\{\},label=\verbtitle{Levinson solver for higher order semiseparable},codes={\catcode`$=3\catcode`^=7}]

FUNCTION x=LEVSOLVERHSS(U,V,b)
  
  %--------PART 1: SOLVE THE SYSTEM----------------------------
  % Initialisation:n=size,p=semiseparability rank
  [n,p]=size(U);  
  
  % Initialising alpha and mu
  denominator=U(1,:)*V(1,:)';                        \flop{2p-1}
  alpha(1,:)=-V(1,:)./denominator;                   \flop{p}
  mu(1)=b(1)./denominator;                           \flop{1}
    
  % Initialising the p x p matrix R'*Y and the 1 x p vector R'*X
  ry=V(1,:)'*alpha;                                  \flop{p^2}
  rx=V(1,:)'*mu(1);                                  \flop{p}
  
  % The main loop in which we use always the previous solution
  for k=2:n
    % Initialising help variables which appear twice in the loop
    ury=U(k,:)*ry;                                   \flop{p(2p-1)}
    ryu=ry*U(k,:)';                                  \flop{p(2p-1)}
    
    % Calculate alpha and mu
    denominator=ury*U(k,:)'+U(k,:)*V(k,:)';          \flop{4p-2}
    mu(k)=(b(k)-U(k,:)*rx)/denominator;              \flop{2p+1}
    alpha(k,:)=(-1)*(V(k,:)+ury)/denominator;        \flop{2p}
    
    % Update the products R'*Y and R'*X
    rx=rx+mu(k)*(ryu+V(k,:)');                       \flop{3p}
    ry=ry+(ryu+V(k,:)')*alpha(k,:);                  \flop{2p^2+p}
  end
  
  %--------PART 2: CALCULATE THE SOLUTION -----------------------
  % Initialisation of x and auxiliary variable G
  x(n)=mu(n);
  G=mu(n)*U(n,:)';                                   \flop{p}
  
  % Constructing the solution vector x
  for i=n-1:-1:1
    x(i)=mu(i)+alpha(i,:)*G;                         \flop{2p}
    G=x(i)*U(i,:)'+G;                                \flop{2p}
  end  
end
The overall operation count leads to $ 6np^2+10np-n-5p^2-6p+1$ operations for part 1 of the algorithm and $ 4np-3p$ operations for constructing the solution. The overal complexity is therefore $ O(np^2)$, more precisely the method performs $ 6np^2+14np-n-5p^2-9p+1$ flops.



Raf Vandebril 2005-04-26