d01gy calculates the optimal coefficients for use by
(D01GCF not in this release) d01gd,
for prime numbers of points.
Syntax
C# |
---|
public static void d01gy( int ndim, int npts, double[] vk, out int ifail ) |
Visual Basic |
---|
Public Shared Sub d01gy ( _ ndim As Integer, _ npts As Integer, _ vk As Double(), _ <OutAttribute> ByRef ifail As Integer _ ) |
Visual C++ |
---|
public: static void d01gy( int ndim, int npts, array<double>^ vk, [OutAttribute] int% ifail ) |
F# |
---|
static member d01gy : ndim : int * npts : int * vk : float[] * ifail : int byref -> unit |
Parameters
- ndim
- Type: System..::..Int32On entry: , the number of dimensions of the integral.Constraint: .
- npts
- Type: System..::..Int32On entry: , the number of points to be used.Constraint: must be a prime number .
- vk
- Type: array<System..::..Double>[]()[][]An array of size [ndim]On exit: the optimal coefficients.
- ifail
- Type: System..::..Int32%On exit: unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).
Description
The Korobov (1963) procedure for calculating the optimal coefficients for -point integration over the -cube imposes the constraint that
where is a prime number and is an adjustable parameter. This parameter is computed to minimize the error in the integral
when computed using the number theoretic rule, and the resulting coefficients can be shown to fit the Korobov definition of optimality.
(1) |
(2) |
The computation for large values of is extremely time consuming (the number of elementary operations varying as ) and there is a practical upper limit to the number of points that can be used. Method d01gz is computationally more economical in this respect but the associated error is likely to be larger.
References
Korobov N M (1963) Number Theoretic Methods in Approximate Analysis Fizmatgiz, Moscow
Error Indicators and Warnings
Errors or warnings detected by the method:
On entry, .
On entry, .
On entry, npts is not a prime number.
- The precision of the machine is insufficient to perform the computation exactly. Try a smaller value of npts, or use an implementation of higher precision.
Accuracy
The optimal coefficients are returned as exact integers (though stored in a real array).
Parallelism and Performance
None.
Further Comments
The time taken is approximately proportional to (see [Description]).
Example
This example calculates the Korobov optimal coefficients where the number of dimensions is and the number of points is .