The input of the function consists of two matrices
and
, which
generate the higher order semiseparable matrix
. Both
and
are of dimension
, where
stands for the
semiseparability rank of
.
[fontsize=\footnotesize,numbers=left,frame=single,commandchars=\\\{\},label=\verbtitle{Yule-Walker
solver for higher order
semiseparable},codes={\catcode`$=3\catcode`^=7}]
FUNCTION Y=YWSOLVERHSS(U,V)
%--------PART 1: SOLVE THE SYSTEM----------------------------
% Initialisation:n=size,p=semiseparability rank
[n,p]=size(U);
% Initialising alpha and the p x p matrix R'*Y
alpha(1,:)=-V(1,:)./(U(1,:)*V(1,:)'); \flop{3p-1}
ry=V(1,:)'*alpha(1,:); \flop{p^2}
% The main loop in which we use always the previous solution
for k=2:n
% The product U(k,:)*ry appears twice
ury=U(k,:)*ry; \flop{p(2p-1)}
% Calculate the denominator and alpha
denominator=ury*U(k,:)'+U(k,:)*V(k,:)'; \flop{4p-2}
alpha(k,:)=(-1)*(V(k,:)+ury)/denominator; \flop{2p}
% Calculate the new p x p matrix R'*Y for the next loop
ry=ry+(ry*U(k,:)'+V(k,:)')*alpha(k,:); \flop{4p^2}
end
%--------PART 2: CALCULATE THE SOLUTION -----------------------
% Initialisation of y and F
Y(n,:)=alpha(n,:);
F=eye(p);
% Constructing the n x p matrix Y
for i=n-1:-1:1
F= F+ U(i+1,:)'* Y(i+1,:); \flop{2p^2}
Y(i,:)=alpha(i,:)*F; \flop{2p^2-p}
end
end
This leads to an operation count of
flops for part
1 in the algorithm, and
flops for computing the solution. The
overal number of operations is hence
which
gives us the desired
complexity.