function closest_pair_brute_test ( )

%*****************************************************************************80
%
%% closest_pair_brute_test() tests closest_pair_brute().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    02 April 2024
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../closest_pair_brute' );

  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'closest_pair_brute_test()\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  Test closest_pair_brute().\n' );
%
%  Solve a sequence of problems of increasing size N.
%
  nvec = [ 100, 200, 400, 800, 1600, 3200 ];
  for i = 1 : 6
    n = nvec(i);
    svec(i) = closest_pair_brute_test01 ( n );
  end

  clf ( );
  plot ( nvec, svec, '-o', 'linewidth', 2 );
  grid ( 'on' );
  xlabel ( 'Number of data points' );
  ylabel ( 'Execution time (seconds)' );
  title ( 'Time complexity for closest pairs problem' );
  filename = 'closest_pairs_brute.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'closest_pair_brute_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  fprintf ( 1, '\n' );
  timestamp ( );

  rmpath ( '../closest_pair_brute' );

  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

