|
|
◆ qawf()
| void qawf |
( |
double(*)(double) |
f, |
|
|
double |
a, |
|
|
double |
omega, |
|
|
int |
integr, |
|
|
double |
epsabs, |
|
|
int |
limlst, |
|
|
int |
limit, |
|
|
int |
maxp1, |
|
|
double * |
result, |
|
|
double * |
abserr, |
|
|
int * |
neval, |
|
|
int * |
lst, |
|
|
double |
work[], |
|
|
int |
lwork, |
|
|
int |
iwork[], |
|
|
int |
liwork, |
|
|
int * |
info |
|
) |
| |
Semi-infinite interval adaptive quadrature for Fourier integrals (25-point Clenshaw-Curtis and 15-point Gauss-Kronrod rule)
- Purpose
- The routine calculates an approximation result to a Fourier integral I = ∫ f(x)*w(x) dx over [a, +∞] satisfying the requested accuracy, where the weight function w(x) = cos(ω*x) or sin(ω*x).
Result is obtained by the adaptive integration applying a 25-point modified Clenshaw-Curtis rule and a 15-point Gauss-Kronrod rule to satisfy the requested accuracy.
- Parameters
-
| [in] | f | The user supplied subroutine which calculates the integrand function f(x) defined as follows. double f(double x)
{
return computed f(x) value
}
|
| [in] | a | Lower limit of integration. |
| [in] | omega | Parameter ω in the weight function. |
| [in] | integr | Indicates which weight function is to be used.
= 1: w(x) = cos(ω*x)
= 2: w(x) = sin(ω*x) |
| [in] | epsabs | Absolute accuracy requested. (epsabs > 0) |
| [in] | limlst | Upper bound on the number of cycles. (limlst >= 3) |
| [in] | limit | Upper bound on the subintervals allowed in the partition of each cycle. (limit >= 1) |
| [in] | maxp1 | Upper bound on the number of Chebyshev moments which can be stored. (maxp1 >= 1)
For the intervals of lengths abs(b-a)*2^(-L), L = 0, 1, ..., maxp1-2. |
| [out] | result | Approximation to I = integral of f*w over [a, +inf]. |
| [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] | lst | Number of cycles actually needed for the integration. |
| [out] | work[] | Array work[lwork]
Work array.
work[0], ..., work[lst-1]: The integral approximations over the cycles.
work[limlst], ..., work[limlst+lst-1]: The error estimates over the cycles.
Further elements of work[] have no specific meaning for the user. |
| [in] | lwork | The length of work[]. (lwork >= 2*limlst + 4*limit + 25*maxp1) |
| [out] | iwork[] | Array iwork[liwork]
Work array.
iwork[k] for k = 0, 1, ..., lst-1 contain the error flags on the cycles. |
| [in] | liwork | The length of iwork[]. (liwork >= limlst + 2*limit) |
| [out] | info | = 0: Successful exit
= -4: The argument integr had an illegal value (integr != 1 and integr != 2)
= -5: The argument epsabs had an illegal value (epsabs <= 0)
= -6: The argument limlst had an illegal value (limlst < 3)
= -7: The argument limit had an illegal value (limit < 1)
= -8: The argument maxp1 had an illegal value (maxp1 < 1)
= -14: The argument lwork had an illegal value (lwork < 2*limlst + 4*limit + 25*maxp1)
= -16: The argument liwork had an illegal value (lwork < limlst + 2*limit)
= 1: Maximum number of cycles allowed has been reached
= 4: The extrapolation table does not converge to within the requested accuracy
= 7: Bad integrand behaviour occurs within one or more of the cycles |
- Reference
- SLATEC (QUADPACK)
|