function p00_jac_test ( problem_num )

%*****************************************************************************80
%
%% p00_jac_test() compares the jacobian to a finite difference estimate.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    04 September 2008
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer PROBLEM_NUM, the number of problems.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'p00_jac_test():\n' );
  fprintf ( 1, '  Find the maximum relative difference between the\n' );
  fprintf ( 1, '  jacobian and a finite difference estimate.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '   Problem    Option      Diff               I         J\n' );

  for problem = 1 : problem_num

    option_num = p00_option_num ( problem );

    fprintf ( 1, '\n' );

    for option = 1 : option_num

      nvar = p00_nvar ( problem, option );

      x0 = p00_start ( problem, option, nvar );

      for i = 1 : nvar
        dx = rand ( 1, 1 );
        x0(i) = x0(i) + 0.01 * dx;
      end

      [ max_adif, max_adif_i, max_adif_j, max_rdif, max_rdif_i, max_rdif_j ] = ...
        p00_jac_check ( problem, option, nvar, x0 );

      fprintf ( 1, '  %8d  %8d  %14e  %8d  %8d\n', ...
        problem, option, max_rdif, max_rdif_i, max_rdif_j );

    end
  end

  return
end
