SDDSlib
|
Implements recursive Gaussian quadrature for numerical integration. More...
#include <math.h>
#include "mdb.h"
Go to the source code of this file.
Macros | |
#define | _CGQ .57735026918962576451 |
#define | gauss_quad(fn, z, a, w) |
#define | MAXSTACK 16384 |
Functions | |
long | gaussianQuadrature (double(*fn)(), double a, double b, long n, double err, double *result) |
Integrate a function using recursive Gaussian quadrature. | |
Implements recursive Gaussian quadrature for numerical integration.
This file contains the implementation of the recursive Gaussian quadrature technique for integrating functions numerically. The primary function gaussianQuadrature
divides the integration interval into panels and recursively refines the estimate to achieve the desired error tolerance.
Definition in file gaussQuad.c.
#define _CGQ .57735026918962576451 |
Definition at line 24 of file gaussQuad.c.
#define gauss_quad | ( | fn, | |
z, | |||
a, | |||
w ) |
Definition at line 25 of file gaussQuad.c.
#define MAXSTACK 16384 |
Definition at line 27 of file gaussQuad.c.
long gaussianQuadrature | ( | double(* | fn )(), |
double | a, | ||
double | b, | ||
long | n, | ||
double | err, | ||
double * | result ) |
Integrate a function using recursive Gaussian quadrature.
Performs numerical integration of the specified function over the interval [a, b] using a recursive Gaussian quadrature technique. The interval is initially divided into n
panels, and each panel is recursively subdivided until the desired fractional error err
is achieved.
fn | Pointer to the function to be integrated. |
a | Lower limit of integration. |
b | Upper limit of integration. |
n | Initial number of panels to divide the interval into. |
err | Fractional error permissible on any quadrature. |
result | Pointer to a double where the result of the integration will be stored. |
Definition at line 45 of file gaussQuad.c.