% This will test some properties of the skew-symmetric matrix and its
% reduction.
disp('The complex symmetric reduction applied on skew symmetric matrices')

% Initialize some variables
n=10; % Always needs to be even for skew-symmetric
I=sqrt(-1);


% Generate the test matrix
A=GenNormal(n,'skewsym');


% Apply the complex symmetric transformation
[Qtransform,C,U,B,V]=CplxSym(A,'U');
disp('   Block anti-diagonal?') 
disp('   Norms of upper left and lower right block')
norm(C(1:n/2,1:n/2))
norm(C(n/2+1:n,n/2+1:n))
disp('   Check complex symmetry: norm of C - transpose(C) (Expect NO)')
norm(C-C.')
disp('   Check skew symmetry: norm of C + transpose(C) (Expect YES)')
norm(C+C.')
pause
clc


% Check property of CC^*
disp('    Check block-diagonal structure of the matrix CC^* ')
CC=C*C'
disp('    Norm of lower left and upper right block ')
norm(CC(n/2+1:n,1:n/2))
norm(CC(1:n/2,n/2+1:n))
pause
clc


% Check the special eigenvalue structure
[Qc,Dc]=eig(C);

disp('  The eigenvectors have special structure, real and purely imaginary')
Qc
pause
clc
