function hammersley_inverse_test ( )

%*****************************************************************************80
%
%% hammersley_inverse_test() tests hammersley_inverse().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    18 August 2016
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'hammersley_inverse_test():\n' );
  fprintf ( 1, '  hammersley_inverse() inverts an element of a Hammersley sequence.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '    I        R=HAMMERSLEY(I,3)  HAMMERSLEY_INVERSE(R,3)\n' );
  fprintf ( 1, '\n' );

  m = 3;
  n = 16;

  for i = 0 : 10
    r = hammersley_value ( i, m, n );
    i2 = hammersley_inverse ( r, m, n );
    fprintf ( 1, '  %3d  %14.8f  %14.8f  %14.8f  %3d\n', i, r(1:m), i2 );
  end

  return
end
