forked from johannesgerer/jburkardt-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestpack.html
301 lines (269 loc) · 8.16 KB
/
testpack.html
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
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
<html>
<head>
<title>
TESTPACK - Testing Multidimensional Integration Routines
</title>
</head>
<body bgcolor="#EEEEEE" link="#CC0000" alink="#FF3300" vlink="#000055">
<h1 align = "center">
TESTPACK <br> Testing Multidimensional Integration Routines
</h1>
<hr>
<p>
<b>TESTPACK</b>
is a C++ program which
demonstrates the testing of a routine for multidimensional
integration.
</p>
<p>
In this case, the code being tested is a subroutine known as
ADAPT, written by Genz. The code is tested on six test integrand
functions, also defined by Genz. The test is done with a variety
of spatial dimensions, parameter values, and difficulty factors.
</p>
<p>
With <b>M</b> denoting the spatial dimension, <b>R</b> a parameter,
<b>C</b> a scaling vector, and <b>X0</b> a displacement vector,
the test functions can be summarized as:
<ol>
<li>
f(x) = cos ( 2 * pi * r + sum ( c(1:m) * x(1:m) ) ), <br>
Genz "Oscillatory";
</li>
<li>
f(x) = 1 / product ( c(1:m)^2 + (x(1:m) - x0(1:m))^2),<br>
Genz "Product Peak";
</li>
<li>
f(x) = 1 / ( 1 + sum ( c(1:m) * x(1:m) ) )^(m+r),<br>
Genz "Corner Peak";
</li>
<li>
f(x) = exp(-sum(c(1:m)^2 * ( x(1:m) - x0(1:m))^2 ) ),<br>
Genz "Gaussian";
</li>
<li>
f(x) = exp ( - sum ( c(1:m) * abs ( x(1:m) - x0(1:m) ) ) ),<br>
Genz "Continuous";
</li>
<li>
f(x) = exp(sum(c(1:m)*x(1:m)) for x(1:m) <= x0(1:m), 0 otherwise,<br>
Genz "Discontinuous";
</li>
</ol>
</p>
<h3 align = "center">
Languages:
</h3>
<p>
<b>TESTPACK</b> is available in
<a href = "../../c_src/testpack/testpack.html">a C version</a> and
<a href = "../../cpp_src/testpack/testpack.html">a C++ version</a> and
<a href = "../../f77_src/testpack/testpack.html">a FORTRAN77 version</a> and
<a href = "../../f_src/testpack/testpack.html">a FORTRAN90 version</a> and
<a href = "../../m_src/testpack/testpack.html">a MATLAB version</a>.
</p>
<h3 align = "center">
Related Data and Programs:
</h3>
<p>
<a href = "../../f_src/integral_test/integral_test.html">
INTEGRAL_TEST</a>,
a FORTRAN90 program which
tests the suitability of
a set of N points for use in an equal-weight quadrature rule over
the M-dimensional unit hypercube.
</p>
<p>
<a href = "../../f_src/intlib/intlib.html">
INTLIB</a>,
a FORTRAN90 library which
estimates the integral of a function over a one-dimensional interval.
</p>
<p>
<a href = "../../cpp_src/nintlib/nintlib.html">
NINTLIB</a>,
a C++ library which
estimates the integral of a function over a one-dimensional interval.
</p>
<p>
<a href = "../../cpp_src/product_rule/product_rule.html">
PRODUCT_RULE</a>,
a C++ program which
can create a multidimensional quadrature rule as a product of
one dimensional rules.
</p>
<p>
<a href = "../../cpp_src/quadrule/quadrule.html">
QUADRULE</a>,
a C++ library which
defines a variety of
(mostly 1-dimensional) quadrature rules.
</p>
<p>
<a href = "../../c_src/smolpack/smolpack.html">
SMOLPACK</a>,
a C library which
uses the Genz test functions
to demonstrate quadrature in multiple dimensions using a sparse grid.
</p>
<p>
<a href = "../../m_src/spinterp/spinterp.html">
SPINTERP</a>,
a MATLAB library which
uses the Genz test functions
to demonstrate multilinear interpolation on a sparse grid.
</p>
<p>
<a href = "../../cpp_src/stroud/stroud.html">
STROUD</a>,
a C++ library which
defines a variety of quadrature rules over various "interesting" geometric shapes.
</p>
<p>
<a href = "../../cpp_src/test_nint/test_nint.html">
TEST_NINT</a>,
a C++ library which
can be used to test N-dimensional quadrature routines.
</p>
<h3 align = "center">
Reference:
</h3>
<p>
<ol>
<li>
Alan Genz,<br>
Testing Multidimensional Integration Routines,<br>
in Tools, Methods, and Languages for Scientific and
Engineering Computation,<br>
edited by B Ford, JC Rault, F Thomasset,<br>
North-Holland, 1984, pages 81-94,<br>
ISBN: 0444875700,<br>
LC: Q183.9.I53.
</li>
<li>
Alan Genz,<br>
A Package for Testing Multiple Integration Subroutines,<br>
in Numerical Integration:
Recent Developments, Software and Applications,<br>
edited by Patrick Keast, Graeme Fairweather,<br>
Reidel, 1987, pages 337-340,<br>
ISBN: 9027725144,<br>
LC: QA299.3.N38
</li>
<li>
John Hart, Ward Cheney, Charles Lawson, Hans Maehly,
Charles Mesztenyi, John Rice, Henry Thatcher,
Christoph Witzgall,<br>
Computer Approximations,<br>
Wiley, 1968,<br>
LC: QA297.C64.
</li>
<li>
Linus Schrage,<br>
A More Portable Fortran Random Number Generator,<br>
ACM Transactions on Mathematical Software,<br>
Volume 5, Number 2, June 1979, pages 132-138.
</li>
</ol>
</p>
<h3 align = "center">
Source Code:
</h3>
<p>
<ul>
<li>
<a href = "testpack.cpp">testpack.cpp</a>, the source code.
</li>
<li>
<a href = "testpack.sh">testpack.sh</a>,
commands to compile the source code.
</li>
<li>
<a href = "testpack_output.txt">testpack_output.txt</a>,
the output file.
</li>
</ul>
</p>
<h3 align = "center">
List of Routines:
</h3>
<p>
<ul>
<li>
<b>MAIN</b> is the main program for TESTPACK.
</li>
<li>
<b>ADAPT</b> carries out adaptive multidimensional quadrature.
</li>
<li>
<b>FUNCTN</b> evaluates one of the test integrand functions.
</li>
<li>
<b>I4_MAX</b> returns the maximum of two I4's.
</li>
<li>
<b>I4_MIN</b> returns the minimum of two I4's.
</li>
<li>
<b>I4_POWER</b> returns the value of I^J.
</li>
<li>
<b>I4VEC_SUM</b> sums the entries of an I4VEC.
</li>
<li>
<b>MULTST</b> tests a multidimensional integration routine.
</li>
<li>
<b>PHI</b> estimates the normal cumulative density function.
</li>
<li>
<b>R8_ABS</b> returns the absolute value of an R8.
</li>
<li>
<b>R8_EPSILON</b> returns the R8 roundoff unit.
</li>
<li>
<b>R8_MAX</b> returns the maximum of two R8's.
</li>
<li>
<b>R8_MIN</b> returns the minimum of two R8's.
</li>
<li>
<b>R8VEC_DOT</b> computes the dot product of a pair of R8VEC's.
</li>
<li>
<b>R8VEC_MEDIAN</b> computes the median of an R8VEC.
</li>
<li>
<b>R8VEC_PRODUCT</b> returns the product of the entries of an R8VEC.
</li>
<li>
<b>R8VEC_SUM</b> returns the sum of an R8VEC.
</li>
<li>
<b>RANDOM_SCHRAGE</b> is a portable random number generator
</li>
<li>
<b>TIMESTAMP</b> prints the current YMDHMS date as a time stamp.
</li>
<li>
<b>TUPLE_NEXT</b> computes the next element of a tuple space.
</li>
<li>
<b>VALINT</b> computes the exact integrals of the test functions.
</li>
</ul>
</p>
<p>
You can go up one level to <a href = "../cpp_src.html">
the C++ source codes</a>.
</p>
<hr>
<i>
Last revised on 22 March 2007.
</i>
<!-- John Burkardt -->
</body>
<!-- Initial HTML skeleton created by HTMLINDEX. -->
</html>