function test_interp_nd_test02 ( m, n )

%*****************************************************************************80
%
%% test_interp_nd_test02() samples each function in M dimensions, at N points.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    26 August 2012
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer M, the spatial dimension.
%
%    integer N, the number of evaluation points.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'TEST_INTERP_ND_TEST02\n' );
  fprintf ( 1, '  P00_F evaluates the function.\n' );
  fprintf ( 1, '  Here, we use spatial dimension M = %d\n', m );
  fprintf ( 1, '  The number of points is N = %d\n', n );

  x = rand ( m, n );

  prob_num = p00_prob_num ( );

  for prob = 1 : prob_num

    fprintf ( 1, '\n' );
    fprintf ( 1, '  Problem %d\n', prob );

    c = p00_c ( prob, m );
    r8vec_print ( m, c, '  C parameters:' );

    w = p00_w ( prob, m );
    r8vec_print ( m, w, '  W parameters:' );

    fprintf ( 1, '\n' );
    fprintf ( 1, '      F(X)              X(1)      X(2) ...\n' );
    fprintf ( 1, '\n' );

    f = p00_f ( prob, m, c, w, n, x );

    for j = 1 : n
      fprintf ( 1, '  %14g  ', f(j) );
      for i = 1 : m
        fprintf ( 1, '  %8.4f', x(i,j) );
      end
      fprintf ( 1, '\n' );
    end

  end

  return
end
