function [q,e]=QDLineSymmetric(a,b)
% QDLINESYMMETRIC qd-line from a s.p.d tridiagonal matrix 
%   [q,e]=QDLineSymmetric(a,b) computes the elemente q(i) and e(i) from
%   the qd-line from the symmetric positive definite tridiagonal
%   matrix given by A=(b(i-1),a(i),b(i))

n=length(a);
e(n)=0;                         % convenient for performing QDStep later
q(1)=a(1);
for i=1:n-1
  e(i)=b(i)^2/q(i); q(i+1)=a(i+1)-e(i);
end