function p00_exhaust_test ( nf )

%*****************************************************************************80
%
%% p00_exhaust_test() seeks a minimizer by exhaustion.
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    16 March 2026
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer nf: the number of function evaluations.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'p00_exhaust_test()\n' );
  fprintf ( 1, '  Minimize using exhaustion.\n' );
  fprintf ( 1, '  Compare function values at equally spaced values.\n' );
%
%  Get the number of tests.
%
  test_num = p00_test_num ( );

  for test = 1 : test_num

    title = p00_title ( test );

    fprintf ( 1, '\n' );
    fprintf ( 1, '  test %d\n', test );
    fprintf ( 1, '  "%s"\n', title );

    [ a, b ] = p00_interval ( test );
    x = linspace ( a, b, nf );
    f = p00_f ( test, x );

    [ fmin, imin ] = min ( f );
    xmin = x(imin);

    fprintf ( 1, '  Function evaluations: %d\n', nf );
    fprintf ( 1, '  f(%g) = %g\n', xmin, fmin );

  end

  return
end

