function maple_area_test ( )

%*****************************************************************************80
%
%% maple_area_test() tests maple_area().
%
%  Discussion:
%
%    For a discussion of quasirandom sampling, Brian Hayes published a 
%    picture of a maple leaf and considered how its area could be
%    estimated using a regular grid of points, random sampling, or
%    quasirandom sampling.
%
%    For various reasons, it will be interesting to have a copy of this
%    maple leaf image accessible.  The MAPLE_BOUNDARY library used various
%    MATLAB procedures to turn the maple leaf image into a polygonal
%    curve definining the boundary, and wrote the corresponding pixels to 
%    a file.
%
%    Once that data is read back in, the MAPLE_AREA functions can make
%    various approaches to estimating the area.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    08 February 2019
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Brian Hayes,
%    Quasirandom Ramblings,
%    American Scientist,
%    Volume 99, Number 4, July-August 2011, pages 282-287.
%
  addpath ( '../maple_area' );

  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'maple_area_test():\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  maple_area() estimates the area of the maple leaf from its image.\n' );
%
%  Set image size in pixels.
%
  p_m = 387;
  p_n = 391;
%
%  Read the boundary information from a file.
%
  filename = 'maple_boundary.txt';
  b = load ( filename );

  [ b_m, b_n ] = size ( b );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Polygonal boundary involves %d vertices.\n', b_m );
%
%  Estimate area using an evenly spaced grid.
%
  maple_area_estimate_grid_test ( b, p_m, p_n );
%
%  Estimate area using a Monte Carlo sample.
%
  maple_area_estimate_mc_test ( b, p_m, p_n );
%
%  Estimate area using a Quasi Monte Carlo sample.
%
  maple_area_estimate_qmc_test ( b, p_m, p_n );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'maple_area_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  fprintf ( 1, '\n' );
  timestamp ( );

  rmpath ( '../maple_area' );

  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

