function [ s1, s2 ] = closest_pair_divcon_test01 ( n )

%*****************************************************************************80
%
%% closest_pair_divcon_test01() tests closest_pair_divcon().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    13 August 2024
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer n: the number of points.
%
%  Output:
%
%    real s1, s2: execution time in seconds for brute() and divcon().
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'closest_pair_divcon_test01():\n' );
  fprintf ( 1, '  closest_pair_divcon() on a set of N points in 2D.\n' );

  x = rand ( n, 1 );
  y = rand ( n, 1 );
  z = complex ( x, y );

  tic ( );
  [ d, i, j ] = brute ( z );
  s1 = toc ( );

  tic ( );
  [ d, i, j ] = divcon ( z );
  s2 = toc ( );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  n = %d\n', n );
  fprintf ( 1, '  brute() time = %g seconds\n', s1 );
  fprintf ( 1, '  divcon time  = %g seconds\n', s2 );
  fprintf ( 1, '  z(%d) = %g + %gi\n', i, real ( z(i) ), imag ( z(i) ) );
  fprintf ( 1, '  z(%d) = %g + %gi\n', j, real ( z(j) ), imag ( z(j) ) );
  fprintf ( 1, '  ||z(%d)-z(%d)|| = %g\n', i, j, d );

  return
end

