|
|
◆ qng_r()
| void qng_r |
( |
double |
a, |
|
|
double |
b, |
|
|
double |
epsabs, |
|
|
double |
epsrel, |
|
|
double * |
result, |
|
|
double * |
abserr, |
|
|
int * |
neval, |
|
|
int * |
info, |
|
|
double * |
xx, |
|
|
double |
yy, |
|
|
int * |
irev |
|
) |
| |
Finite interval automatic quadrature (21/43/87 point Gauss-Kronrod rule) (reverse communication version)
- Purpose
- This routine computes I = integral of f over [a, b], satisfying the requested accuracy, where f is a given function. User should provide the necessary computed values of f according to the argument irev.
The appropriate one is automatically selected from 21, 43 or 87 point Gauss-Kronrod rules to satisfy the requested accuracy.
- Parameters
-
| [in] | a | Lower limit of integration. |
| [in] | b | Upper limit of integration. |
| [in] | epsabs | Absolute accuracy requested. The requested accuracy is assumed to be satisfied if abserr <= max(epsabs, epsrel*|result|)). |
| [in] | epsrel | Relative accuracy requested.
The requested accuracy is assumed to be satisfied if abserr <= max(epsabs, epsrel*|result|)).
If epsabs <= 0 and epsrel < 50*eps, epsrel is assumed to be 50*eps, where eps is the machine precision. |
| [out] | result | Approximation to I = integral of f over [a, b]. |
| [out] | abserr | Estimate of the modulus of the absolute error, which should equal or exceed the true error. |
| [out] | neval | Number of integrand evaluations. |
| [out] | info | = 0: Successful exit
= 1: The maximum number of steps has been executed. The integral is probably too difficult to be computed by qng_r. |
| [out] | xx | irev = 1 to 9: xx contains the abscissa where the function value should be evaluated and given in the next call. |
| [in] | yy | irev = 1 to 9: The function value f(xx) should be given in yy in the next call. |
| [in,out] | irev | Control variable for reverse communication.
[in] Before first call, irev should be initialized to zero. On succeeding calls, irev should not be altered.
[out] If irev is not zero, complete the following tasks and call this routine again without changing irev.
= 0: Computation finished.
= 1 to 9: User should set the function value at xx in yy. Do not alter any variables other than yy. |
- Reference
- SLATEC (QUADPACK)
|