test_int_nd


test_int_nd, a C code which defines a set of test problems for the approximate computation of integrals over multi-dimensional regions.

Routines are available to evaluate the integrand, return the exact value of the integral, report the name of the problem, report the integration limits, get, set or modify a base point.

The integrands is assigned an index. The integrands can be invoked by index. Most integrands may be defined for any value of the spatial dimension, which we denote here by m. Most integrands are defined on the unit m-dimensional hypercube. Some integrands include one or more parameters. These generally have default values, which can be altered by the user.

For each problem, a set of routines are available with a standard interface, for manipulating and evaluating the problem. For a problem with index "87", for instance, we might have the following set of routines. The most important is P87_F which evaluates the integrand. We probably also need P87_LIM to determine the limits of integration, and P87_EXACT to get the exact value of the integral (if known). A number of routines are available to set, get, or randomize parameters associated with the problem.

The list of integrand functions includes:

  1. f(x) = ( sum ( x(1:m) ) )^2;
  2. f(x) = ( sum ( 2 * x(1:m) - 1 ) )^4;
  3. f(x) = ( sum ( x(1:m) ) )^5;
  4. f(x) = ( sum ( 2 * x(1:m) - 1 ) )^6;
  5. f(x) = 1 / ( 1 + sum ( 2 * x(1:m) ) );
  6. f(x) = product ( 2 * abs ( 2 * x(1:m) - 1 ) );
  7. f(x) = product ( pi / 2 ) * sin ( pi * x(1:m) );
  8. f(x) = ( sin ( (pi/4) * sum ( x(1:m) ) ) )**2;
  9. f(x) = exp ( sum ( c(1:m) * x(1:m) ) );
  10. f(x) = sum ( abs ( x(1:m) - 0.5 ) );
  11. f(x) = exp ( sum ( abs ( 2 * x(1:m) - 1 ) ) );
  12. f(x) = product ( 1 <= i <= m ) ( i * cos ( i * x(i) ) );
  13. f(x) = product ( 1 <= i <= m ) t(n(i))(x(i)), t(n(i)) is a Chebyshev polynomial;
  14. f(x) = sum ( 1 <= i <= m ) (-1)^i * product ( 1 <= j <= i ) x(j);
  15. f(x) = product ( 1 <= i <= order ) x(mod(i-1,m)+1);
  16. f(x) = sum ( abs ( x(1:m) - x0(1:m) ) );
  17. f(x) = sum ( ( x(1:m) - x0(1:m) )^2 );
  18. f(x) = 1 inside an m-dimensional sphere around x0(1:m), 0 outside;
  19. f(x) = product ( sqrt ( abs ( x(1:m) - x0(1:m) ) ) );
  20. f(x) = ( sum ( x(1:m) ) )^power;
  21. f(x) = c * product ( x(1:m)^e(1:m) ) on the surface of an m-dimensional unit sphere;
  22. f(x) = c * product ( x(1:m)^e(1:m) ) in an m-dimensional ball;
  23. f(x) = c * product ( x(1:m)^e(1:m) ) in the unit m-dimensional simplex;
  24. f(x) = product ( abs ( 4 * x(1:m) - 2 ) + c(1:m) ) / ( 1 + c(1:m) ) );
  25. f(x) = exp ( c * product ( x(1:m) ) );
  26. f(x) = product ( c(1:m) * exp ( - c(1:m) * x(1:m) ) );
  27. f(x) = cos ( 2 * pi * r + sum ( c(1:m) * x(1:m) ) ),
    Genz "Oscillatory";
  28. f(x) = 1 / product ( c(1:m)**2 + (x(1:m) - x0(1:m))^2),
    Genz "Product Peak";
  29. f(x) = 1 / ( 1 + sum ( c(1:m) * x(1:m) ) )^(m+r),
    Genz "Corner Peak";
  30. f(x) = exp(-sum(c(1:m)^2 * ( x(1:m) - x0(1:m))^2 ) ),
    Genz "Gaussian";
  31. f(x) = exp ( - sum ( c(1:m) * abs ( x(1:m) - x0(1:m) ) ) ), Genz "Continuous";
  32. f(x) = exp(sum(c(1:m)*x(1:m)) for x(1:m) <= x0(1:m), 0 otherwise,
    Genz "Discontinuous";

An Important Quote:

"When good results are obtained in integrating a high-dimensional function, we should conclude first of all that an especially tractable integrand was tried and not that a generally successful method has been found. A secondary conclusion is that we might have made a very good choice in selecting an integration method to exploit whatever features of f made it tractable."
Art Owen,
Latin Supercube Sampling for Very High Dimensional Simulation,
ACM Transactions on Modeling and Computer Simulations,
Volume 8, Number 1, January 1998, pages 71-102.

Licensing:

The information on this web page is distributed under the MIT license.

Languages:

test_int_nd is available in a C version and a C++ version and a Fortran90 version and a MATLAB version and an Octave version.

Related Data and Programs:

test_int_nd_test

clenshaw_curtis_rule, a C code which sets a Clenshaw Curtis quadrature grid in multiple dimensions.

nintlib, a C code which numerically estimates integrals in multiple dimensions.

product_rule, a C code which creates a multidimensional quadrature rule as a product of one dimensional rules.

stroud_rule, a C code which defines quadrature rules for a variety of unusual areas, surfaces and volumes in 2D, 3D and N-dimensions.

testpack, a C code which defines a set of integrands used to test multidimensional quadrature.

Source Code:


Last revised on 02 July 2025.