| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
set -e |
| 4 |
|
| 5 |
cp test.c ${AUTOPKGTEST_TMP} |
| 6 |
cd ${AUTOPKGTEST_TMP} |
| 7 |
|
| 8 |
gcc -o htest test.c -lcubature -lm |
| 9 |
gcc -o ptest -DPCUBATURE test.c -lcubature -lm |
| 10 |
|
| 11 |
# ./htest <dim> <tol> <integrand> <maxeval> |
| 12 |
# |
| 13 |
# where `<dim>` = #dimensions, `<tol>` = relative tolerance, `<integrand>` is |
| 14 |
# 0–7 for one of eight possible test integrands (see below) and `<maxeval>` |
| 15 |
# is the maximum number of function evaluations (0 for none, the default). |
| 16 |
# Similarly for `ptest` (which tests the `pcubature` function). |
| 17 |
|
| 18 |
echo |
| 19 |
echo "0: a product of cosine functions" |
| 20 |
./htest 3 1e-5 0 |
| 21 |
./ptest 3 1e-5 0 |
| 22 |
|
| 23 |
echo |
| 24 |
echo "1: a Gaussian integral of exp(-x²), remapped to [0,∞) limits" |
| 25 |
./htest 3 1e-5 1 |
| 26 |
./ptest 3 1e-5 1 |
| 27 |
|
| 28 |
# Test 2 takes too long and is therefore excluded |
| 29 |
#echo |
| 30 |
#echo "2: volume of a hypersphere (integrating a discontinuous function!)" |
| 31 |
#./htest 3 1e-5 2 |
| 32 |
#./ptest 3 1e-5 2 |
| 33 |
|
| 34 |
echo |
| 35 |
echo "3: a simple polynomial (product of coordinates)" |
| 36 |
./htest 3 1e-5 3 |
| 37 |
./ptest 3 1e-5 3 |
| 38 |
|
| 39 |
echo |
| 40 |
echo "4: a Gaussian centered in the middle of the integration volume" |
| 41 |
./htest 3 1e-5 4 |
| 42 |
./ptest 3 1e-5 4 |
| 43 |
|
| 44 |
echo |
| 45 |
echo "5: a sum of two Gaussians" |
| 46 |
./htest 3 1e-5 5 |
| 47 |
./ptest 3 1e-5 5 |
| 48 |
|
| 49 |
echo |
| 50 |
echo "6: an example function by Tsuda, a product of terms with near poles" |
| 51 |
./htest 3 1e-5 6 |
| 52 |
./ptest 3 1e-5 6 |
| 53 |
|
| 54 |
echo |
| 55 |
echo "7: a test integrand by Morokoff and Caflisch, a simple product of" |
| 56 |
echo " dim-th roots of the coordinates (weakly singular at the boundary)" |
| 57 |
./htest 3 1e-5 7 |
| 58 |
./ptest 3 1e-5 7 |