% COMPCONJUNIDEC Computes the complex skewsymmetric unitary diagonal
%       decomposition of a tridiagonal matrix.
%
%       [S,U]=CompConjUniDec(T)
%       T is a tridiagonal coming from the unitary equivalence 
%              transformation of normal matrices
%       S is tridiagonal having super and subdiagonal conjugate
%       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]=CompConjUniDec(T)

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