function hypercube_surface_distance_test ( )

%*****************************************************************************80
%
%% hypercube_surface_distance_test() tests hypercube_surface_distance().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    17 January 2021
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../hypercube_surface_distance' );

  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'hypercube_surface_distance_test():\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  Test hypercube_surface_distance()\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '    D       Mu      Var\n' );
  fprintf ( 1, '\n' );
  n = 10000;
  for d = [ 2, 3, 4, 5, 6 ]
    [ dmu, dvar ] = hypercube_surface_distance_stats ( n, d );
    fprintf ( 1, '  %2d  %8.4f  %8.4f\n', d, dmu, dvar );
  end

  n = 10000;
  d = 5;
  hypercube_surface_distance_histogram ( n, d );
  filename = sprintf ( 'hypercube_surface_distance_d%d_histogram.png', d );
  print ( '-dpng', filename );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Graphics saved in "%s"\n', filename );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'hypercube_surface_distance_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  fprintf ( 1, '\n' );
  timestamp ( );

  rmpath ( '../hypercube_surface_distance' );

  return
end
function timestamp ( )

%*****************************************************************************80
%
%% timestamp() prints the current YMDHMS date as a timestamp.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 February 2003
%
%  Author:
%
%    John Burkardt
%
  t = now;
  c = datevec ( t );
  s = datestr ( c, 0 );
  fprintf ( 1, '%s\n', s );

  return
end

