% COMPSYMUNIDEC Computes the complex symmetric unitary diagonal
%       decomposition of a tridiagonal matrix.
%
%       [S,U]=CompSymUniDec(T)
%       T is a tridiagonal coming from the unitary equivalence 
%              transformation of normal matrices
%       S is symmetric and U a unitary Diagonal with U(1,1)=1.
%       T=S*U
%       
%
%
%       Raf Vandebril
%       raf.vandebril - a - cs.kleuven.be
%       Revision Date: 1/9/2008

function [S,U]=CompSymUniDec(T)

  n=size(T,1);
  
  D=zeros(n,1);
  D(1)=1;
  for k=2:n
    D(k)=D(k-1)*T(k,k-1)/T(k-1,k);
  end
  U=diag(D);
  
  S=T*U;
  U=conj(U);
  