.\" Manpage for quadrule. .\" Author: Mike Neish .\" Based on comments from the source code, and description on the web site .\" (http://people.sc.fsu.edu/~jburkardt/c_src/quadrule/quadrule.html) .TH quadrule 3 "15 Mar 2013" .SH NAME quadrule \(hy C library of quadrature rules .SH SYNOPSIS .B #include .SH DESCRIPTION .P .B APPROXIMATING INTEGRALS .sp The following functions apply an existing set of abscissas and weights to compute an approximation to an integral. .HP .BI "double summer ( double " func " ( double x ), int " order ", double " xtab "[], double " weight "[] )" .sp Carries out a quadrature rule over a single interval. .HP .BI "double sum_sub ( double " func " ( double x ), double " a ", double " b ", int " nsub ", int " order ", double " xlo ", double " xhi ", double " xtab "[], double " weight "[] )" .sp Carries out a composite quadrature rule. .sp \fIxlo\fP and \fIxhi\fP are the left and right endpoints of the interval over which the quadrature rule was defined. .sp \fIa\fP and \fIb\fP are the lower and upper limits of integration. .sp \fInsub\fP is the number of equal subintervals into which the finite interval (\fIa\fP,\fIb\fP) is to be subdivided for higher accuracy. \fInsub\fP must be at least 1. .HP .BI "double bdf_sum ( double " func " ( double x ), int " order ", double " xtab "[], double " weight "[] )" .sp Carries out explicit backward difference quadrature on [0,1]. Requires \fIxtab\fP and \fIweight\fP to be pre\(hycomputed from \fBbdfc_set\fP or \fBbdfp_set\fP. .HP .BI "double laguerre_sum ( double " func " ( double x ), double " a ", int " order ", double " xtab "[], double " weight "[] )" .sp Carries out Laguerre quadrature over [ A, +oo ). Requires \fIxtab\fP and \fIweight\fP to be pre\(hycomputed from \fBlaguerre_compute\fP, \fBgen_laguerre_compute\fP, or \fBlaguerre_set\fP. .HP .BI "void summer_gk ( double " func " ( double x ), int " orderg ", double " weightg "[], double *" resultg ", int " orderk " , double " xtabk "[], double " weightk "[], double *" resultk " )" .sp Carries out Gauss\(hyKronrod quadrature over a single interval. Before calling this function, \fIweightg\fP should be pre\(hycomputed from \fBlegendre_compute_dr\fP or \fBlegendre_set\fP. Also, \fIxtabk\fP and \fIweightk\fP should be pre\(hycomputed from \fBkronrod_set\fP. The orders should follow the relation \fIorderk\fP = 2 * \fIorderg\fP + 1. \fIresultk\fP will contain the result of the Gauss\(hyKronrod sum. \fIresultg\fP contains an intermediate sum, using only the Gauss quadrature. .HP .BI "void sum_sub_gk ( double " func " ( double x ), double " a ", double " b ", int " nsub ", int " orderg ", double " weightg "[], double *" resultg ", int " orderk ", double " xtabk "[], double " weightk "[], double *" resultk ", double *" error " )" .sp Carries out a composite Gauss\(hyKronrod rule. Approximates the integral of \fIfunc\fP from \fIa\fP to \fIb\fP, by dividing the domain into \fInsub\fP subdomains, and applying a Gauss\(hyKronrod rule on each subdomain. .P The following are utility function(s), to modify existing weights / abscissas before computing an integral. .HP .BI "void rule_adjust ( double " a ", double " b ", double " c ", double " d ", int " order ", double " xtab "[], double " weight "[] )" .sp Maps a quadrature rule from [A,B] to [C,D]. \fIxtab\fP and \fIweight\fP are overwritten. .P .B COMPUTING QUADRATURE ABSCISSAS / WEIGHTS .sp The following functions compute arrays of abscissas and weights (\fIxtab\fP, \fIweight\fP) for a particular quadrature rule, for any given \fIorder\fP. The range of the abscissas is ( \-1 <= x < 1 ) unless otherwise given. .sp NOTE: \fIxtab\fP and \fIweight\fP must be allocated before calling these functions. .HP .BI "void chebyshev1_compute ( int " order ", double " xtab "[], double " weight "[] )" .sp Computes a Gauss\(hyChebyshev type 1 quadrature rule. .HP .BI "void chebyshev2_compute ( int " order ", double " xtab "[], double " weight "[] )" .sp Computes a Gauss\(hyChebyshev type 2 quadrature rule. .HP .BI "void chebyshev3_compute ( int " order ", double " xtab "[], double " weight "[] )" .sp Computes a Gauss\(hyChebyshev type 3 quadrature rule. .HP .BI "void clenshaw_curtis_compute ( int " order ", double " xtab "[], double " weight "[] )" .sp Computes a Clenshaw Curtis quadrature rule. .HP .BI "void fejer1_compute ( int " order ", double " xtab "[], double " weight "[] )" .sp Computes a Fejer type 1 quadrature rule. .HP .BI "void fejer2_compute ( int " order ", double " xtab "[], double " weight "[] )" .sp Computes a Fejer type 2 quadrature rule. .HP .BI "void gegenbauer_compute ( int " order ", double " alpha ", double " xtab "[], double " weight "[] )" .sp Computes a Gauss\(hyGegenbauer quadrature rule. .HP .BI "void gen_hermite_compute ( int " order ", double " alpha ", double " xtab "[], double " weight "[] )" .sp Computes a generalized Gauss\(hyHermite rule for the interval ( \-infinity < x < +infinity ) .HP .BI "void gen_laguerre_compute ( int " order ", double " alpha ", double " xtab "[], double " weight "[] )" .sp Computes a generalized Gauss\(hyLaguerre quadrature rule for the interval ( alpha <= x < infinity ) .HP .BI "void hermite_ek_compute ( int " order ", double " xtab "[], double " weight "[] )" .sp Computes a Gauss\(hyHermite quadrature rule, using an algorithm by Elhay and Kautsky. Interval is ( \-infinity < x < infinity ) .HP .BI "void hermite_ss_compute ( int " order ", double " xtab "[], double " weight "[] )" .sp Computes a Gauss\(hyHermite quadrature rule, using an algorithm by Arthur Stroud and Don Secrest. Interval is ( \-infinity < x < infinity ) .HP .BI "void jacobi_compute ( int " order ", double " alpha ", double " beta ", double " xtab "[], double " weight "[] )" .sp Computes a Gauss\(hyJacobi quadrature rule. .HP .BI "void laguerre_compute ( int " order ", double " xtab "[], double " weight "[] )" .sp Computes a Gauss\(hyLaguerre quadrature rule for the inverval ( 0 <= x < infinity ) .HP .BI "void legendre_compute_dr ( int " order ", double " xtab "[], double " weight "[] )" .sp Gauss\(hyLegendre quadrature by Davis\(hyRabinowitz method. .HP .BI "void lobatto_compute ( int " order ", double " xtab "[], double " weight "[] )" .sp Computes a Lobatto quadrature rule. .HP .BI "void nc_compute ( int " order ", double " x_min ", double " x_max ", double " xtab "[], double " weight "[] )" .sp Computes a Newton\(hyCotes quadrature rule. .sp ( x_min <= x <= x_max ) .HP .BI "void ncc_compute ( int " order ", double " xtab "[], double " weight "[] )" .sp Computes a Newton\(hyCotes Closed quadrature rule. .HP .BI "void nco_compute ( int " order ", double " xtab "[], double " weight "[] )" .sp Computes a Newton\(hyCotes Open quadrature rule. .HP .BI "void ncoh_compute ( int " order ", double " xtab "[], double " weight "[] )" .sp Computes a Newton\(hyCotes "open half" quadrature rule. .sp ( x_min <= x <= x_max ) .HP .BI "void radau_compute ( int " order ", double " xtab "[], double " weight "[] )" .sp Computes a Radau quadrature rule. .P .B PRE\(hyCOMPUTED QUADRATURES .sp The following functions return abscissas/weights for various quadrature rules, but only for particular orders. .sp NOTE: Check the valid range of \fIorder\fP parameters for the particular function before using it. Using an unsupported \fIorder\fP will cause an abort. .HP .BI "void bashforth_set ( int " order ", double " xtab "[], double " weight " [] )" .sp Sets an Adams\(hyBashforth quadrature for \fIorder\fP = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 16, 18, or 20. .HP .BI "void bdfc_set ( int " order ", double " xtab "[], double " weight "[] )" .sp Sets weights for backward differentiation corrector quadrature, for 1 <= \fIorder\fP <= 19. .HP .BI "void bdfp_set ( int " order ", double " xtab "[], double " weight "[] )" .sp Sets weights for backward differentiation predictor quadrature, for 1 <= \fIorder\fP <= 19. .HP .BI "void cheb_set ( int " order ", double " xtab "[], double " weight "[] )" .sp Sets abscissas and weights for Chebyshev quadrature, for \fIorder\fP = 1, 2, 3, 4, 5, 6, 7, or 9. .HP .BI "void clenshaw_curtis_set ( int " order ", double " xtab "[], double " weight "[] )" .sp Sets a Clenshaw\(hyCurtis quadrature rule, for \fIorder\fP = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 33, 65, or 129. .HP .BI "void fejer1_set ( int " order ", double " xtab "[], double " weight "[] )" .sp Sets abscissas and weights for Fejer type 1 quadrature, for \fIorder\fP = 1, 2, 3, 4, 5, 6, 7, 8, 9, or 10. .HP .BI "void fejer2_set ( int " order ", double " xtab "[], double " weight "[] )" .sp Sets abscissas and weights for Fejer type 2 quadrature, for \fIorder\fP = 1, 2, 3, 4, 5, 6, 7, 8, 9, or 10. .HP .BI "void hermite_genz_keister_set ( int " order ", double " xtab "[], double " weight "[] )" .sp Sets a Hermite Genz\(hyKeister rule, for \fIorder\fP = 1, 3, 7, 9, 17, 19, 31, 33, or 35. .HP .BI "void hermite_set ( int " order ", double " xtab "[], double " weight "[] )" .sp Sets abscissas and weights for Hermite quadrature. The \fIorder\fP must be between 1 and 20, or 31/32/33, 63/64/65, 127/128/129. .HP .BI "void kronrod_set ( int " order ", double " xtab "[], double " weight "[] )" .sp Sets abscissas and weights for Gauss\(hyKronrod quadrature. The \fIorder\fP may be 15, 21, 31 or 41, corresponding to Gauss\(hyLegendre rules of order 7, 10, 15 or 20. .HP .BI "void laguerre_set ( int " order ", double " xtab "[], double " weight "[] )" .sp Sets abscissas and weights for Laguerre quadrature. The \fIorder\fP must be between 1 and 20, or 31/32/33, 63/64/65, 127/128/129. .HP .BI "void legendre_set ( int " order ", double " xtab "[], double " weight "[] )" .sp Sets abscissas and weights for Gauss\(hyLegendre quadrature. The \fIorder\fP must be between 1 and 33 or 63/64/65, 127/128/129, 255/256/257. .HP .BI "void legendre_set_cos ( int " order ", double " xtab "[], double " weight "[] )" .sp Sets Gauss\(hyLegendre rules for COS(X)*F(X) on [\-PI/2,PI/2]. The \fIorder\fP must be 1, 2, 4, 8 or 16. .HP .BI "void legendre_set_cos2 ( int " order ", double " xtab "[], double " weight "[] )" .sp Sets Gauss\(hyLegendre rules for COS(X)*F(X) on [0,PI/2]. The \fIorder\fP must be 2, 4, 8 or 16. .HP .BI "void legendre_set_log ( int " order ", double " xtab "[], double " weight "[] )" .sp Sets a Gauss\(hyLegendre rule for \- LOG(X) * F(X) on [0,1]. The \fIorder\fP must be between 1 through 8, or 16. .HP .BI "void legendre_set_sqrtx_01 ( int " order ", double " xtab "[], double " weight "[] )" .sp Sets Gauss\(hyLegendre rules for SQRT(X)*F(X) on [0,1]. The \fIorder\fP must be between 1 and 16 or 63/64, 127/128. .HP .BI "void legendre_set_sqrtx2_01 ( int " order ", double " xtab "[], double " weight "[] )" .sp Sets Gauss\(hyLegendre rules for F(X)/SQRT(X) on [0,1]. The \fIorder\fP must be be tween 1 and 16 or 63/64, 127/128. .HP .BI "void legendre_set_x0_01 ( int " order ", double " xtab "[], double " weight "[] )" .sp Sets a Gauss\(hyLegendre rule for F(X) on [0,1]. The \fIorder\fP must be between 1 and 8. .HP .BI "void legendre_set_x1 ( int " order ", double " xtab "[], double " weight "[] )" .sp Sets a Gauss\(hyLegendre rule for ( 1 + X ) * F(X) on [\-1,1]. The \fIorder\fP must be between 1 and 9. .HP .BI "void legendre_set_x1_01 ( int " order ", double " xtab "[], double " weight "[] )" .sp Sets a Gauss\(hyLegendre rule for X * F(X) on [0,1]. The \fIorder\fP must be between 1 and 8. .HP .BI "void legendre_set_x2 ( int " order ", double " xtab "[], double " weight "[] )" .sp Sets Gauss\(hyLegendre rules for ( 1 + X )^2*F(X) on [\-1,1]. The \fIorder\fP must be between 1 and 9. .HP .BI "void legendre_set_x2_01 ( int " order ", double " xtab "[], double " weight "[] )" .sp Sets a Gauss\(hyLegendre rule for X*X * F(X) on [0,1]. The \fIorder\fP must be between 1 and 8. .HP .BI "void lobatto_set ( int " order ", double " xtab "[], double " weight "[] )" .sp Sets abscissas and weights for Lobatto quadrature. The \fIorder\fP must be between 2 and 20. .HP .BI "void moulton_set ( int " order ", double " xtab "[], double " weight "[] )" .sp Sets weights for Adams\(hyMoulton quadrature. The \fIorder\fP must be between 1 and 10 or 12, 14, 16, 18 or 20. .HP .BI "void ncc_set ( int " order ", double " xtab "[], double " weight "[] )" .sp Sets abscissas and weights for closed Newton\(hyCotes quadrature. The \fIorder\fP must be between 1 and 21. .HP .BI "void nco_set ( int " order ", double " xtab "[], double " weight "[] )" .sp Sets abscissas and weights for open Newton\(hyCotes quadrature. The \fIorder\fP must be between 1 and 7, or 9. .HP .BI "void ncoh_set ( int " order ", double " xtab "[], double " weight "[] )" .sp Sets abscissas and weights for Newton\(hyCotes "open half" rules. The \fIorder\fP must be between 1 and 17. .HP .BI "void patterson_set ( int " order ", double " xtab "[], double " weight "[] )" .sp Sets abscissas and weights for Gauss\(hyPatterson quadrature. The \fIorder\fP must be 1, 3, 7, 15, 31, 63, 127 or 255. .HP .BI "void radau_set ( int " order ", double " xtab "[], double " weight "[] )" .sp Sets abscissas and weights for Radau quadrature. The \fIorder\fP must be between 1 and 15. .SH AUTHOR John Burkardt .SH SEE ALSO .nf The official quadrule web page http://people.sc.fsu.edu/~jburkardt/c_src/quadrule/quadrule.html .fi