d01fc Method
関数リスト一覧   NagLibrary Namespaceへ  ライブラリイントロダクション  本ヘルプドキュメントのchm形式版

d01fc attempts to evaluate a multi-dimensional integral (up to 15 dimensions), with constant and finite limits, to a specified relative accuracy, using an adaptive subdivision strategy.

Syntax

C#
public static void d01fc(
	int ndim,
	double[] a,
	double[] b,
	ref int minpts,
	int maxpts,
	D01..::.D01FC_FUNCTN functn,
	double eps,
	out double acc,
	out double finval,
	out int ifail
)
Visual Basic (Declaration)
Public Shared Sub d01fc ( _
	ndim As Integer, _
	a As Double(), _
	b As Double(), _
	ByRef minpts As Integer, _
	maxpts As Integer, _
	functn As D01..::.D01FC_FUNCTN, _
	eps As Double, _
	<OutAttribute> ByRef acc As Double, _
	<OutAttribute> ByRef finval As Double, _
	<OutAttribute> ByRef ifail As Integer _
)
Visual C++
public:
static void d01fc(
	int ndim, 
	array<double>^ a, 
	array<double>^ b, 
	int% minpts, 
	int maxpts, 
	D01..::.D01FC_FUNCTN^ functn, 
	double eps, 
	[OutAttribute] double% acc, 
	[OutAttribute] double% finval, 
	[OutAttribute] int% ifail
)
F#
static member d01fc : 
        ndim:int * 
        a:float[] * 
        b:float[] * 
        minpts:int byref * 
        maxpts:int * 
        functn:D01..::.D01FC_FUNCTN * 
        eps:float * 
        acc:float byref * 
        finval:float byref * 
        ifail:int byref -> unit 

Parameters

ndim
Type: System..::.Int32
On entry: n, the number of dimensions of the integral.
Constraint: 2ndim15.
a
Type: array< System..::.Double >[]()[]
An array of size [ndim]
On entry: the lower limits of integration, ai, for i=1,2,,n.
b
Type: array< System..::.Double >[]()[]
An array of size [ndim]
On entry: the upper limits of integration, bi, for i=1,2,,n.
minpts
Type: System..::.Int32 %
On entry: must be set to the minimum number of integrand evaluations to be allowed.
On exit: contains the actual number of integrand evaluations used by d01fc.
maxpts
Type: System..::.Int32
On entry: the maximum number of integrand evaluations to be allowed.
Constraints:
  • maxptsminpts;
  • maxptsα, where α=2ndim+2×ndim2+2×ndim+1.
functn
Type: NagLibrary..::.D01..::.D01FC_FUNCTN
functn must return the value of the integrand f at a given point.

A delegate of type D01FC_FUNCTN.

eps
Type: System..::.Double
On entry: the relative error acceptable to you. When the solution is zero or very small relative accuracy may not be achievable but you may still set eps to a reasonable value and check for the error exit ifail=2.
Constraint: eps>0.0.
acc
Type: System..::.Double %
On exit: the estimated relative error in finval.
finval
Type: System..::.Double %
On exit: the best estimate obtained for the integral.
ifail
Type: System..::.Int32 %
On exit: ifail=0 unless the method detects an error (see [Error Indicators and Warnings]).

Description

d01fc returns an estimate of a multi-dimensional integral over a hyper-rectangle (i.e., with constant limits), and also an estimate of the relative error. You set the relative accuracy required, return values for the integrand via a method argument functn, and also set the minimum and maximum acceptable number of calls to functn (in minpts and maxpts).
The method operates by repeated subdivision of the hyper-rectangular region into smaller hyper-rectangles. In each subregion, the integral is estimated using a seventh-degree rule, and an error estimate is obtained by comparison with a fifth-degree rule which uses a subset of the same points. The fourth differences of the integrand along each coordinate axis are evaluated, and the subregion is marked for possible future subdivision in half along that coordinate axis which has the largest absolute fourth difference.
If the estimated errors, totalled over the subregions, exceed the requested relative error (or if fewer than minpts calls to functn have been made), further subdivision is necessary, and is performed on the subregion with the largest estimated error, that subregion being halved along the appropriate coordinate axis.
The method will fail if the requested relative error level has not been attained by the time maxpts calls to functn have been made; or, if the amount lenwrk of working storage is insufficient. A formula for the recommended value of lenwrk is given in [Parameters]. If a smaller value is used, and is exhausted in the course of execution, the method switches to a less efficient mode of operation; only if this mode also breaks down is insufficient storage reported.
d01fc is based on the HALF method developed by van Dooren and de Ridder (1976). It uses a different basic rule, described in Genz and Malik (1980).

References

Error Indicators and Warnings

Note: d01fc may return useful information for one or more of the following detected errors or warnings.
Errors or warnings detected by the method:
Some error messages may refer to parameters that are dropped from this interface (lenwrk, wrkstr, iuser, ruser) In these cases, an error in another parameter has usually caused an incorrect value to be inferred.
ifail=1
On entry,ndim<2,
orndim>15,
ormaxpts is too small,
oreps0.0.
ifail=2
maxpts was too small to obtain the required relative accuracy eps. On failure, finval and acc contain estimates of the integral and the relative error, but acc will be greater than eps.
ifail=3
lenwrk was too small. On failure, finval and acc contain estimates of the integral and the relative error, but acc will be greater than eps.
ifail=-8000
ifail=-6000

Accuracy

Further Comments

Execution time will usually be dominated by the time taken to evaluate functn, and hence the maximum time that could be taken will be proportional to maxpts.

Example

See Also