File: quadrule.3

package info (click to toggle)
quadrule 0~20121001-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,044 kB
  • sloc: ansic: 16,614; sh: 10,127; makefile: 11
file content (270 lines) | stat: -rw-r--r-- 13,357 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
.\" 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 <quadrule.h>
.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