sandia_rules, a C++ code which generates a variety of quadrature rules of various orders.
This library is used, in turn, by several other libraries, including sparse_grid_mixed(), sparse_grid_mixed_growth(), and sgmga(). This means that a program that calls any one of those libraries must have access to a compiled copy of sandia_rules() as well.
Name | Usual domain | Weight function |
---|---|---|
Gauss-Legendre | [-1,+1] | 1 |
Clenshaw-Curtis | [-1,+1] | 1 |
Fejer Type 2 | [-1,+1] | 1 |
Gauss-Chebyshev 1 | [-1,+1] | 1/sqrt(1-x2) |
Gauss-Chebyshev 2 | [-1,+1] | sqrt(1-x2) |
Gauss-Gegenbauer | [-1,+1] | (1-x2)alpha |
Gauss-Jacobi | [-1,+1] | (1-x)alpha (1+x)beta |
Gauss-Laguerre | [0,+oo) | e-x |
Generalized Gauss-Laguerre | [0,+oo) | xalpha e-x |
Gauss-Hermite | (-oo,+oo) | e-x*x |
Generalized Gauss-Hermite | (-oo,+oo) | |x|alpha e-x*x |
Hermite Genz-Keister | (-oo,+oo) | e-x*x |
Newton-Cotes-Closed | [-1,+1] | 1 |
Newton-Cotes-Open | [-1,+1] | 1 |
Newton-Cotes-Open-Half | [-1,+1] | 1 |
For example, a Gauss-Gegenbauer quadrature rule is used to approximate:
Integral ( -1 <= x <= +1 ) f(x) (1-x^2)^alpha dxwhere alpha is a real parameter chosen by the user.
The approximation to the integral is formed by computing a weighted sum of function values at specific points:
Sum ( 1 <= i <= n ) w(i) * f(x(i))The quantities x are the abscissas of the quadrature rule, the values w are the weights of the quadrature rule, and the number of terms n in the sum is the order of the quadrature rule.
As a matter of convenience, most of the quadrature rules are available through three related functions:
Some of these quadrature rules expect a parameter ALPHA, and perhaps also a parameter BETA, in order to fully define the rule. Therefore, the argument lists of these functions vary. They always include the input quantity ORDER, but may have one or two additional inputs. In order to offer a uniform interface, there is also a family of functions with a standard set of input arguments, ORDER, NP, and P. Here NP is parameter counter, and P is the parameter value vector P. Using this interface, it is possible to call all the quadrature functions with the same argument list. The uniform interface functions can be identified by the suffix _NP that appears in their names. Generally, these functions "unpack" the parameter vector where needed, and then call the corresponding basic function. Of course, for many rules NP is zero and P may be a null pointer.
There is yet a third possible interface, in which no ALPHA or BETA parameters appear in the function call; this interface is primarily intended for a particular software environment. The interfaces are made available in a separate library called sandia_rules2.
The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.
sandia_rules is available in a C version and a C++ version and a Fortran90 version and a MATLAB version.
chebyshev1_rule, a C++ program which can compute and print a Gauss-Chebyshev type 1 quadrature rule.
chebyshev2_rule, a C++ program which can compute and print a Gauss-Chebyshev type 2 quadrature rule.
gegenbauer_rule, a C++ program which can compute and print a Gauss-Gegenbauer quadrature rule.
gen_hermite_rule, a C++ program which can compute and print a generalized Gauss-Hermite quadrature rule.
gen_laguerre_rule, a C++ program which can compute and print a generalized Gauss-Laguerre quadrature rule.
hermite_rule, a C++ program which can compute and print a Gauss-Hermite quadrature rule.
jacobi_rule, a C++ program which can compute and print a Gauss-Jacobi quadrature rule.
laguerre_rule, a C++ program which can compute and print a Gauss-Laguerre quadrature rule.
legendre_rule, a C++ program which can compute and print a Gauss-Legendre quadrature rule.
quadrature_rules, a dataset directory which contains sets of files that define quadrature rules over various 1D intervals or multidimensional hypercubes.
quadrature_rules_legendre, a dataset directory which contains triples of files defining standard Gauss-Legendre quadrature rules.
sandia_rules2, a C++ library which contains a very small selection of functions which serve as an interface between SANDIA_SGMG or SANDIA_SGMGA and sandia_rules.
sgmga, a C++ library which creates sparse grids based on a mixture of 1D quadrature rules, allowing anisotropic weights for each dimension.
sparse_grid_mixed, a C++ library which creates a sparse grid dataset based on a mixed set of 1D factor rules.