SMOLPACK
Multidimensional Quadrature Using Sparse Grids
SMOLPACK is a C library of routines, using double precision
arithmetic, which can estimate
the integral of a function over a hypercube using a sparse grid.
An interactive test program is also provided. The user can
specify the input to this program as part of the commandline,
or wait to enter the data interactively.
-
Usage:
-
smolpack_interactive fnum dim k seed bs
-
fnum
-
the test function f(x) to be integrated.
1 <= fnum <= 7
-
dim
-
the spatial dimension,
1 <= dim < 40
-
k
-
the number of stages. Generally a "small" number like 4 or 8;
1 <= k
-
seed
-
a seed for the random number generator. Should not be zero!
-
bs
-
the "basic sequence", that is, the one dimensional quadrature rule
that is used to build the multidimensional quadrature rule. The
two choices are:
-
bs = 1: delayed Clenshaw Curtis, uses few function evaluations;
-
bs = 2: standard Clenshaw Curtis;
Output from the program includes the exact and approximate integral
values, the error, and, if requested, the number of quadrature
points (function evaluations) and the number of
quadrature weights that needed to be computed. Note that, because
of symmetry in the quadrature rule, the number of quadrature weights
computed will generally be much lower than the number of quadrature
points.
Test Functions
SMOLPACK_INTERACTIVE allows the user to choose a test
function to be integrated. The first six test functions come
from the standard test suite of Genz. In the description,
M denotes the spatial dimension, R is a randomly
chosen parameter, C is a randomly chosen scaling
vector, and X0 is a randomly chosen displacement vector.
-
f(x) = cos ( 2 * pi * r + sum ( c(1:m) * x(1:m) ) ),
Genz "Oscillatory";
-
f(x) = 1 / product ( c(1:m)^2 + (x(1:m) - x0(1:m))^2),
Genz "Product Peak";
-
f(x) = 1 / ( 1 + sum ( c(1:m) * x(1:m) ) )^(d+1),
Genz "Corner Peak";
-
f(x) = exp(-sum(c(1:m)^2 * ( x(1:m) - x0(1:m))^2 ) ),
Genz "Gaussian";
-
f(x) = exp ( - sum ( c(1:m) * abs ( x(1:m) - x0(1:m) ) ) ),
Genz "Continuous";
-
f(x) = exp(sum(c(1:m)*x(1:m)) for x(1:2) <= x0(1:2), 0 otherwise,
Genz "Discontinuous";
-
f(x) = exp(sum( x(1:m));
Author:
Knut Petras
Related Programs:
CC_DISPLAY
is a library of MATLAB routines which
can compute and display Clenshaw Curtis grids in two dimensions,
as well as sparse grids formed from sums of Clenshaw Curtis grids.
CLENSHAW_CURTIS
is a MATLAB library which can set up a
Clenshaw Curtis quadrature grid in multiple dimensions.
QUADRATURE_RULES
is a dataset directory of files that define quadrature rules;
a number of examples of sparse grid quadrature rules are included.
SPARSE_GRID_CC
is a dataset directory of files containing the abscissas of sparse
grids based on a Clenshaw Curtis rule.
SPARSE_GRID_DISPLAY
is a library of MATLAB routines which
can display a 2D or 3D sparse grid.
SPARSE_GRID_F1
is a dataset directory of files containing the abscissas of sparse
grids based on a Fejer Type 1 rule.
SPARSE_GRID_F2
is a dataset directory of files containing the abscissas of sparse
grids based on a Fejer Type 2 rule.
SPARSE_GRID_GP
is a dataset directory of files containing the abscissas of sparse
grids based on a Gauss Patterson rule.
SPARSE_GRID_NCC
is a dataset directory of files containing the abscissas of sparse
grids based on a Newton Cotes closed rule.
SPARSE_GRID_NCO
is a dataset directory of files containing the abscissas of sparse
grids based on a Newton Cotes open rule.
SPARSE_GRID_NCOH
is a dataset directory of files containing the abscissas of sparse
grids based on a Newton Cotes open half rule.
SPINTERP
is an executable MATLAB program which uses sparse grids to carry
out multilinear hierarchical interpolation.
TESTPACK
is a C library of routines which defines the Genz test integrand
functions.
TEST_NINT
is a FORTRAN90 library of routines which defines a number of
test integrand functions for multidimensional integration.
Reference:
-
Alan Genz,
A Package for Testing Multiple Integration Subroutines,
in Numerical Integration:
Recent Developments, Software and Applications,
edited by Patrick Keast, Graeme Fairweather,
Reidel, 1987, pages 337-340,
ISBN: 9027725144,
LC: QA299.3.N38
-
Erich Novak, Klaus Ritter,
High dimensional integration of smooth functions over cubes,
Numerische Mathematik,
Volume 75, Number 1, November 1996, pages 79-97.
-
Erich Novak, Klaus Ritter,
Simple Cubature Formulas with High Polynomial Exactness,
Constructive Approximation,
Volume 15, Number 4, December 1999, pages 499-522.
-
Knut Petras,
Fast Calculation of Coefficients in the Smolyak Algorithm,
Numerical Algorithms,
Volume 26, Number 2, February 2001, pages 93-109.
-
Knut Petras,
Smolyak Cubature of Given Polynomial Degree with Few Nodes
for Increasing Dimension,
Numerische Mathematik,
Volume 93, Number 4, February 2003, pages 729-753.
-
Sergey Smolyak,
Quadrature and Interpolation Formulas for Tensor Products of
Certain Classes of Functions,
Doklady Akademii Nauk SSSR,
Volume 4, 1963, pages 240-243.
Source Code:
-
ccsmolyak.c,
sparse integration using standard Clenshaw Curtis rules.
-
smolyak.c,
sparse integration using delayed Clenshaw Curtis rule.
-
smolpack.h,
the include file.
-
smolpack.csh,
commands to compile the source code;
Examples and Tests:
-
smolpack_interactive.c, an interactive test program.
-
smolpack_interactive.csh,
commands to compile, link and load the interactive test program;
-
problem1.csh,
a shell script that calls the test program for function 1.
-
problem1.out,
output from the test program related to test function 1;
-
problem2.csh,
a shell script that calls the test program for function 2.
-
problem2.out,
output from the test program related to test function 2;
-
problem3.csh,
a shell script that calls the test program for function 3.
-
problem3.out,
output from the test program related to test function 3;
-
problem4.csh,
a shell script that calls the test program for function 4.
-
problem4.out,
output from the test program related to test function 4;
-
problem5.csh,
a shell script that calls the test program for function 5.
-
problem5.out,
output from the test program related to test function 5;
-
problem6.csh,
a shell script that calls the test program for function 6.
-
problem6.out,
output from the test program related to test function 6;
-
problem7.csh,
a shell script that calls the test program for function 7.
-
problem7.out,
output from the test program related to test function 7;
You can go up one level to
the C source codes.
Last revised on 30 April 2007.