function fwt_test ( )

%*****************************************************************************80
%
%% fwt_test() tests fwt().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    16 March 2011
%
%  Author:
%
%    John Burkardt
%
  n = 16;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'fwt_test():\n' );
  fprintf ( 1, '  fwt() computes a fast Walsh transform.\n' );

  for j = 1 : 2

    if ( j == 1 )
      w = rand ( 1, n );
    else
      w(1:n) = 1 : n;
    end

    x(1:n) = w(1:n);
    w = fwt ( n, w );
    y(1:n) = w(1:n) / n;
    w = fwt ( n, w );
    z(1:n) = w(1:n) / n;

    fprintf ( 1, '\n' );
    fprintf ( 1, '     I        X(I)    Y=FWT(X)/N   Z=FWT(Y)/N\n' );
    fprintf ( 1, '\n' );
    for i = 1 : n
      fprintf ( 1, '  %4d  %10f  %10f  %10f\n', i, x(i), y(i), z(i) );
    end

  end

  return
end
