function cosine_transform_test01 ( )

%*****************************************************************************80
%
%% cosine_transform_test01() carries out a DCT and its inverse.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    27 August 2015
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'COSINE_TRANSFORM_TEST01:\n' );
  fprintf ( 1, '  COSINE_TRANSFORM_DATA does a cosine transform of data\n' );
  fprintf ( 1, '  defined by a vector.\n' );
  fprintf ( 1, '\n' ); 
  fprintf ( 1, '  Apply the transform, then its inverse.\n' );
  fprintf ( 1, '  Let R be a random N vector.\n' );
  fprintf ( 1, '  Let S be the transform of D.\n' );
  fprintf ( 1, '  Let T be the transform of E.\n' );
  fprintf ( 1, '  Then R and T will be equal.\n' );

  n = 10;

  r = rand ( n, 1 );
  s = cosine_transform_data ( n, r );
  t = cosine_transform_inverse ( n, s );

  fprintf ( 1, '\n' );
  fprintf ( 1, '     I      R(I)        S(I)        T(I)\n' );
  fprintf ( 1, '\n' );

  for i = 1 : n
    fprintf ( 1, '  %4d  %10f  %10f  %10f\n', i, r(i), s(i), t(i) );
  end

  return
end
