Given the generators
and the diagonal
of the symmetric
positive definite semiseparable matrix
, the following algorithm
computes the solution
such that
. Two extra vectors are
needed for the algorithm. In the vector
we will store the
separate values of the parameter
, and in the vector
, the
consecutive factors
.
%---- First Part: Generate the two vectors ----- % Initialization, the system for i=1 is solved a(1)=-v(1)/(d(1)+u(1)*v(1)); f(1)=1; % Calculate the inner product for the next loop ip=a(1)*v(1); % The main loop for i=2:n t=u(i)*ip+v(i); % Store the new calculated alpha a(i)=-t/(u(i)*t+d(i)); % Store the new factor f f(i)=1+u(i)*a(i); % Calculation of the inner product for the next loop ip=f(i)*ip+v(i)*a(i); end %---- Second Part: Construct the solution------- % The vectors f and a are given, % construct now the solution with these vectors. % Initialization before the loop y(n)=a(n); factor=f(n); % Construct the solution vector from bottom to top for i=n-1:-1:1 y(i)=factor*a(i); factor=factor*f(i); end
So the overall cost is
operations6 for solving the Yule-Walker-like system of equations for positive definite symmetric semiseparable plus diagonal matrices.