Loading [MathJax]/jax/output/SVG/fonts/TeX/Size2/Regular/Main.js
d01pa returns a sequence of approximations to the integral of a function over a multidimensional simplex, together with an error estimate for the last approximation.

Syntax

C#
public static void d01pa(
	int ndim,
	double[,] vert,
	D01..::..D01PA_FUNCTN functn,
	ref int minord,
	int maxord,
	double[] finvls,
	out double esterr,
	out int ifail
)
Visual Basic
Public Shared Sub d01pa ( _
	ndim As Integer, _
	vert As Double(,), _
	functn As D01..::..D01PA_FUNCTN, _
	ByRef minord As Integer, _
	maxord As Integer, _
	finvls As Double(), _
	<OutAttribute> ByRef esterr As Double, _
	<OutAttribute> ByRef ifail As Integer _
)
Visual C++
public:
static void d01pa(
	int ndim, 
	array<double,2>^ vert, 
	D01..::..D01PA_FUNCTN^ functn, 
	int% minord, 
	int maxord, 
	array<double>^ finvls, 
	[OutAttribute] double% esterr, 
	[OutAttribute] int% ifail
)
F#
static member d01pa : 
        ndim : int * 
        vert : float[,] * 
        functn : D01..::..D01PA_FUNCTN * 
        minord : int byref * 
        maxord : int * 
        finvls : float[] * 
        esterr : float byref * 
        ifail : int byref -> unit 

Parameters

ndim
Type: System..::..Int32
On entry: , the number of dimensions of the integral.
Constraint: .
vert
Type: array<System..::..Double,2>[,](,)[,][,]
An array of size [dim1, sdvert]
Note: dim1 must satisfy the constraint:
On entry:  must be set to the th component of the th vertex for the simplex integration region, for  and . If , vert must be unchanged since the previous call of d01pa.
On exit: these values are unchanged. The rest of the array vert is used for workspace and contains information to be used if another call of d01pa is made with . In particular  contains the volume of the simplex.
functn
Type: NagLibrary..::..D01..::..D01PA_FUNCTN
functn must return the value of the integrand  at a given point.

A delegate of type D01PA_FUNCTN.

minord
Type: System..::..Int32%
On entry: must specify the highest order of the approximations currently available in the array finvls.  indicates an initial call;  indicates that  have already been computed in a previous call of d01pa.
Constraint: .
On exit: .
maxord
Type: System..::..Int32
On entry: the highest order of approximation to the integral to be computed.
Constraint: .
finvls
Type: array<System..::..Double>[]()[][]
An array of size [maxord]
On entry: if ,  must contain approximations to the integral previously computed by d01pa.
On exit: contains these values unchanged, and the newly computed values .  is an approximation to the integral of polynomial degree .
esterr
Type: System..::..Double%
On exit: an absolute error estimate for .
ifail
Type: System..::..Int32%
On exit:  unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).

Description

d01pa computes a sequence of approximations , for , to an integral
where  is an -dimensional simplex defined in terms of its  vertices.  is an approximation which will be exact (except for rounding errors) whenever the integrand is a polynomial of total degree  or less.
The type of method used has been described in Grundmann and Moller (1978), and is implemented in an extrapolated form using the theory from de Doncker (1979).

References

de Doncker E (1979) New Euler–Maclaurin Expansions and their application to quadrature over the -dimensional simplex Math. Comput. 33 1003–1018
Grundmann A and Moller H M (1978) Invariant integration formulas for the -simplex by combinatorial methods SIAM J. Numer. Anal. 15 282–290

Error Indicators and Warnings

Errors or warnings detected by the method:
Some error messages may refer to parameters that are dropped from this interface (LDVERT) In these cases, an error in another parameter has usually caused an incorrect value to be inferred.
On entry,  and .
Constraint: .
On entry,  and .
Constraint: .
On entry, .
Constraint: .
On entry, .
Constraint: .
On entry,  and .
Constraint: .
The volume of the simplex integration region is too large or too small to be represented on the machine.
Dynamic memory allocation failed.
An error occured, see message report.
Invalid Parameters
Invalid dimension for array
Negative dimension for array
Invalid Parameters

Accuracy

An absolute error estimate is output through the parameter esterr.

Parallelism and Performance

None.

Further Comments

The running time for d01pa will usually be dominated by the time used to evaluate the integrand functn. The maximum time that could be used by d01pa will be approximately given by
where  is the time needed for one call of functn.

Example

This example demonstrates the use of the method with the integral

Example program (C#): d01pae.cs

Example program results: d01pae.r

See Also