function value = monomial_value ( expon, x )

%*****************************************************************************80
%
%% monomial_value() evaluates a monomial.
%
%  Discussion:
%
%    This routine evaluates a monomial of the form
%
%      product ( 1 <= dim <= dim_num ) x(dim)^expon(dim)
%
%    where the exponents are nonnegative integers.  Note that
%    if the combination 0^0 is encountered, it should be treated
%    as 1.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    15 May 2023
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer EXPON(D): the exponents.
%
%    real X(N,D): the point coordinates.
%
%  Output:
%
%    real VALUE(N): the value of the monomial.
%
  [ n, d ] = size ( x );

  value = ones ( n, 1 );

  for j = 1 : d
    if ( 0 ~= expon(j) )
      value(1:n) = value(1:n) .* x(1:n,j) .^ expon(j);
    end
  end

  return
end
