%
% Program test_proj_sympws.m reads the projection supermatrix and prints
% the matrix.
%
% Version 1.0, 2006-08-06
%
fid = fopen('out_D4_6h.m','w');
in_test = fopen('sympws_proj_D4_6h','r');
no_wave_vectors = fread(in_test,1,'int8');
for II = 1:no_wave_vectors
  matrix_order = fread(in_test,1,'int16');
  for I = 1:matrix_order
    for J = 1:matrix_order
      for K = 1:2
        tmatric(K) = fread(in_test,1,'float64');
      end
      tm(J,I) = tmatric(1) + i*tmatric(2);
    end
  end   
  rmat = zeros(matrix_order);
  for J = 1:matrix_order
    for K = 1:matrix_order
      if abs(tm(J,K)) > 0.000001
        rmat(J,K) = 1;
      end
    end
  end
  rmat = rmat';
  fprintf(fid, '\n\n');
  fprintf(fid, 'Matrix order = %3d\n\n', matrix_order);
  fprintf(fid, '%1d %1d %1d %1d %1d %1d %1d %1d %1d %1d %1d %1d %1d %1d %1d %1d %1d %1d %1d %1d %1d %1d %1d %1d %1d %1d %1d %1d %1d %1d %1d %1d\n', rmat(1:matrix_order,1:matrix_order)); 
end
fclose(fid);
fclose(in_test);
fprintf('test_proj_sympws has finished executing');