function monomial_value_test ( )

%*****************************************************************************80
%
%% monomial_value_test() tests monomial_value() on sets of data in various dimensions.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    30 May 2023
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'monomial_value_test():\n' );
  fprintf ( 1, '  monomial_value() evaluates some monomials\n' );
  fprintf ( 1, '  in dimensions 1 through 3.\n' );

  e_min = -3;
  e_max = 6;
  n = 5;
  x_min = -2.0;
  x_max = +10.0;

  for d = 1 : 3

    fprintf ( 1, '\n' );
    fprintf ( 1, '  Spatial dimension D =  %d\n', d );

    expon = randi ( [ e_min, e_max ], d, 1 );
    disp ( '  Exponents:' )
    disp ( expon )
    x = x_min + ( x_max - x_min ) * rand ( n, d );
%
%  To make checking easier, make the X values integers.
%
    x = round ( x );
    v = monomial_value ( expon, x );

    fprintf ( 1, '\n' );
    fprintf ( 1, '   V(X)         ' );
    for j = 1 : d
      fprintf ( 1, '      X(%d)', j );
    end
    fprintf ( 1, '\n' );
    fprintf ( 1, '\n' );
    for i = 1 : n
      fprintf ( 1, '%14.6g  ', v(i) );
      for j = 1 : d
        fprintf ( 1, '%10.4f', x(i,j) );
      end
      fprintf ( 1, '\n' );
    end

  end

  return
end
 
