rb-gsl 1.15.3.1 → 1.15.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (222) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHORS +2 -2
  3. data/ChangeLog +8 -0
  4. data/Rakefile +39 -96
  5. data/VERSION +1 -1
  6. data/ext/array.c +2 -2
  7. data/ext/block_source.c +1 -1
  8. data/ext/dirac.c +1 -1
  9. data/ext/eigen.c +13 -13
  10. data/ext/extconf.rb +17 -11
  11. data/ext/function.c +5 -5
  12. data/ext/gsl_narray.c +6 -6
  13. data/ext/histogram.c +7 -6
  14. data/ext/histogram2d.c +4 -4
  15. data/ext/interp.c +1 -1
  16. data/ext/linalg.c +13 -11
  17. data/ext/linalg_complex.c +8 -6
  18. data/ext/math.c +1 -1
  19. data/ext/matrix_complex.c +6 -6
  20. data/ext/matrix_source.c +10 -10
  21. data/ext/monte.c +2 -2
  22. data/ext/multimin.c +4 -4
  23. data/ext/multiroots.c +8 -8
  24. data/ext/nmf.c +6 -6
  25. data/ext/ntuple.c +4 -4
  26. data/ext/odeiv.c +2 -2
  27. data/ext/permutation.c +1 -1
  28. data/ext/poly2.c +6 -6
  29. data/ext/poly_source.c +9 -6
  30. data/ext/sf.c +31 -45
  31. data/ext/signal.c +2 -2
  32. data/ext/vector_complex.c +11 -10
  33. data/ext/vector_double.c +7 -4
  34. data/ext/vector_source.c +29 -26
  35. data/ext/wavelet.c +1 -1
  36. data/include/rb_gsl_common.h +12 -0
  37. data/include/rb_gsl_config.h +10 -1
  38. data/rdoc/blas.rdoc +4 -4
  39. data/rdoc/bspline.rdoc +8 -8
  40. data/rdoc/cheb.rdoc +9 -9
  41. data/rdoc/cholesky_complex.rdoc +1 -1
  42. data/rdoc/combi.rdoc +10 -10
  43. data/rdoc/complex.rdoc +12 -12
  44. data/rdoc/const.rdoc +21 -21
  45. data/rdoc/dht.rdoc +7 -7
  46. data/rdoc/diff.rdoc +7 -7
  47. data/rdoc/ehandling.rdoc +4 -4
  48. data/rdoc/eigen.rdoc +12 -12
  49. data/rdoc/fft.rdoc +27 -27
  50. data/rdoc/fit.rdoc +19 -19
  51. data/rdoc/function.rdoc +1 -1
  52. data/rdoc/graph.rdoc +3 -3
  53. data/rdoc/hist.rdoc +17 -17
  54. data/rdoc/hist2d.rdoc +5 -5
  55. data/rdoc/hist3d.rdoc +4 -4
  56. data/rdoc/index.rdoc +4 -4
  57. data/rdoc/integration.rdoc +17 -17
  58. data/rdoc/interp.rdoc +12 -12
  59. data/rdoc/intro.rdoc +4 -4
  60. data/rdoc/linalg.rdoc +21 -21
  61. data/rdoc/linalg_complex.rdoc +1 -1
  62. data/rdoc/math.rdoc +14 -14
  63. data/rdoc/matrix.rdoc +21 -21
  64. data/rdoc/min.rdoc +10 -10
  65. data/rdoc/monte.rdoc +4 -4
  66. data/rdoc/multimin.rdoc +13 -13
  67. data/rdoc/multiroot.rdoc +13 -13
  68. data/rdoc/narray.rdoc +10 -10
  69. data/rdoc/ndlinear.rdoc +5 -5
  70. data/rdoc/nonlinearfit.rdoc +18 -18
  71. data/rdoc/ntuple.rdoc +6 -6
  72. data/rdoc/odeiv.rdoc +13 -13
  73. data/rdoc/perm.rdoc +12 -12
  74. data/rdoc/poly.rdoc +18 -18
  75. data/rdoc/qrng.rdoc +10 -10
  76. data/rdoc/randist.rdoc +11 -11
  77. data/rdoc/ref.rdoc +50 -50
  78. data/rdoc/rng.rdoc +10 -10
  79. data/rdoc/rngextra.rdoc +5 -5
  80. data/rdoc/roots.rdoc +13 -13
  81. data/rdoc/sf.rdoc +36 -36
  82. data/rdoc/siman.rdoc +4 -4
  83. data/rdoc/sort.rdoc +7 -7
  84. data/rdoc/start.rdoc +1 -1
  85. data/rdoc/stats.rdoc +14 -14
  86. data/rdoc/sum.rdoc +5 -5
  87. data/rdoc/tensor.rdoc +4 -4
  88. data/rdoc/tut.rdoc +1 -1
  89. data/rdoc/use.rdoc +5 -5
  90. data/rdoc/vector.rdoc +29 -29
  91. data/rdoc/vector_complex.rdoc +6 -6
  92. data/rdoc/wavelet.rdoc +9 -9
  93. data/test/gsl/blas_test.rb +79 -0
  94. data/test/gsl/bspline_test.rb +63 -0
  95. data/test/gsl/cdf_test.rb +1512 -0
  96. data/test/gsl/cheb_test.rb +80 -0
  97. data/test/gsl/combination_test.rb +100 -0
  98. data/test/gsl/complex_test.rb +20 -0
  99. data/test/gsl/const_test.rb +29 -0
  100. data/test/gsl/deriv_test.rb +62 -0
  101. data/test/gsl/dht_test.rb +79 -0
  102. data/test/gsl/diff_test.rb +53 -0
  103. data/test/gsl/eigen_test.rb +563 -0
  104. data/test/gsl/err_test.rb +23 -0
  105. data/test/gsl/fit_test.rb +101 -0
  106. data/test/gsl/histo_test.rb +14 -0
  107. data/test/gsl/integration_test.rb +274 -0
  108. data/test/gsl/interp_test.rb +27 -0
  109. data/test/gsl/linalg_test.rb +463 -0
  110. data/test/gsl/matrix_nmf_test.rb +37 -0
  111. data/test/gsl/matrix_test.rb +77 -0
  112. data/test/gsl/min_test.rb +89 -0
  113. data/test/gsl/monte_test.rb +77 -0
  114. data/test/gsl/multifit_test.rb +753 -0
  115. data/test/gsl/multimin_test.rb +157 -0
  116. data/test/gsl/multiroot_test.rb +135 -0
  117. data/test/gsl/multiset_test.rb +52 -0
  118. data/test/gsl/odeiv_test.rb +275 -0
  119. data/test/gsl/poly_test.rb +338 -0
  120. data/test/gsl/qrng_test.rb +94 -0
  121. data/test/gsl/quartic_test.rb +28 -0
  122. data/test/gsl/randist_test.rb +122 -0
  123. data/test/gsl/rng_test.rb +303 -0
  124. data/test/gsl/roots_test.rb +78 -0
  125. data/test/gsl/sf_test.rb +2079 -0
  126. data/test/gsl/stats_test.rb +122 -0
  127. data/test/gsl/sum_test.rb +69 -0
  128. data/test/gsl/tensor_test.rb +396 -0
  129. data/test/gsl/vector_test.rb +223 -0
  130. data/test/gsl/wavelet_test.rb +130 -0
  131. data/test/gsl_test.rb +321 -0
  132. data/test/test_helper.rb +42 -0
  133. metadata +107 -150
  134. data/setup.rb +0 -1585
  135. data/tests/blas/amax.rb +0 -14
  136. data/tests/blas/asum.rb +0 -16
  137. data/tests/blas/axpy.rb +0 -25
  138. data/tests/blas/copy.rb +0 -23
  139. data/tests/blas/dot.rb +0 -23
  140. data/tests/bspline.rb +0 -53
  141. data/tests/cdf.rb +0 -1388
  142. data/tests/cheb.rb +0 -112
  143. data/tests/combination.rb +0 -123
  144. data/tests/complex.rb +0 -17
  145. data/tests/const.rb +0 -24
  146. data/tests/deriv.rb +0 -85
  147. data/tests/dht/dht1.rb +0 -17
  148. data/tests/dht/dht2.rb +0 -23
  149. data/tests/dht/dht3.rb +0 -23
  150. data/tests/dht/dht4.rb +0 -23
  151. data/tests/diff.rb +0 -78
  152. data/tests/eigen/eigen.rb +0 -220
  153. data/tests/eigen/gen.rb +0 -105
  154. data/tests/eigen/genherm.rb +0 -66
  155. data/tests/eigen/gensymm.rb +0 -68
  156. data/tests/eigen/nonsymm.rb +0 -53
  157. data/tests/eigen/nonsymmv.rb +0 -53
  158. data/tests/eigen/symm-herm.rb +0 -74
  159. data/tests/err.rb +0 -58
  160. data/tests/fit.rb +0 -124
  161. data/tests/gsl_test.rb +0 -118
  162. data/tests/gsl_test2.rb +0 -110
  163. data/tests/histo.rb +0 -12
  164. data/tests/integration/integration1.rb +0 -72
  165. data/tests/integration/integration2.rb +0 -71
  166. data/tests/integration/integration3.rb +0 -71
  167. data/tests/integration/integration4.rb +0 -71
  168. data/tests/interp.rb +0 -45
  169. data/tests/linalg/HH.rb +0 -64
  170. data/tests/linalg/LU.rb +0 -47
  171. data/tests/linalg/QR.rb +0 -77
  172. data/tests/linalg/SV.rb +0 -24
  173. data/tests/linalg/TDN.rb +0 -116
  174. data/tests/linalg/TDS.rb +0 -122
  175. data/tests/linalg/bidiag.rb +0 -73
  176. data/tests/linalg/cholesky.rb +0 -20
  177. data/tests/linalg/linalg.rb +0 -158
  178. data/tests/matrix/matrix_complex_test.rb +0 -36
  179. data/tests/matrix/matrix_nmf_test.rb +0 -39
  180. data/tests/matrix/matrix_test.rb +0 -48
  181. data/tests/min.rb +0 -99
  182. data/tests/monte/miser.rb +0 -31
  183. data/tests/monte/vegas.rb +0 -45
  184. data/tests/multifit/test_2dgauss.rb +0 -112
  185. data/tests/multifit/test_brown.rb +0 -90
  186. data/tests/multifit/test_enso.rb +0 -246
  187. data/tests/multifit/test_filip.rb +0 -155
  188. data/tests/multifit/test_gauss.rb +0 -97
  189. data/tests/multifit/test_longley.rb +0 -110
  190. data/tests/multifit/test_multifit.rb +0 -52
  191. data/tests/multimin.rb +0 -139
  192. data/tests/multiroot.rb +0 -131
  193. data/tests/multiset.rb +0 -52
  194. data/tests/narray/blas_dnrm2.rb +0 -20
  195. data/tests/odeiv.rb +0 -353
  196. data/tests/poly/poly.rb +0 -290
  197. data/tests/poly/special.rb +0 -65
  198. data/tests/qrng.rb +0 -131
  199. data/tests/quartic.rb +0 -29
  200. data/tests/randist.rb +0 -134
  201. data/tests/rng.rb +0 -305
  202. data/tests/roots.rb +0 -76
  203. data/tests/run-test.sh +0 -17
  204. data/tests/sf/gsl_test_sf.rb +0 -249
  205. data/tests/sf/test_airy.rb +0 -83
  206. data/tests/sf/test_bessel.rb +0 -306
  207. data/tests/sf/test_coulomb.rb +0 -17
  208. data/tests/sf/test_dilog.rb +0 -25
  209. data/tests/sf/test_gamma.rb +0 -209
  210. data/tests/sf/test_hyperg.rb +0 -356
  211. data/tests/sf/test_legendre.rb +0 -227
  212. data/tests/sf/test_mathieu.rb +0 -59
  213. data/tests/sf/test_mode.rb +0 -19
  214. data/tests/sf/test_sf.rb +0 -839
  215. data/tests/stats.rb +0 -174
  216. data/tests/stats_mt.rb +0 -16
  217. data/tests/sum.rb +0 -98
  218. data/tests/sys.rb +0 -323
  219. data/tests/tensor.rb +0 -419
  220. data/tests/vector/vector_complex_test.rb +0 -101
  221. data/tests/vector/vector_test.rb +0 -141
  222. data/tests/wavelet.rb +0 -142
@@ -1,110 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require("gsl")
3
- include GSL
4
-
5
- module GSL
6
- module Test
7
- Verbose = true
8
- $tests = 0
9
- $passed = 0
10
- $failed = 0
11
-
12
- # PASS if status == 0, FAIL otherwise
13
- def test(status, desc)
14
- $tests += 1
15
- if status == 0
16
- $passed += 1
17
- printf("PASS: #{desc}\n")
18
- else
19
- $failed += 1
20
- printf("FAIL: #{desc}\n")
21
- end
22
- end
23
-
24
- # PASS if status == true, FAIL otherwise
25
- def test2(status, desc)
26
- $tests += 1
27
- if status == true
28
- $passed += 1
29
- printf("PASS: #{desc}\n")
30
- else
31
- $failed += 1
32
- printf("FAIL: #{desc}\n")
33
- end
34
- end
35
-
36
- def test_factor(result, expected, factor, desc)
37
- status = nil
38
- if result == expected
39
- status = 0
40
- elsif expected == 0.0
41
- status = (result > expected or result < expected) ? 1 : 0
42
- else
43
- u = result/expected
44
- status = (u > factor or u < 1.0/factor) ? 1 : 0
45
- end
46
- $tests += 1
47
- if status == 0
48
- $passed += 1
49
- printf("PASS: #{desc} (%g observed vs %g expected)\n", result, expected)
50
- else
51
- $failed += 1
52
- printf("FAIL: #{desc} (%.18g observed vs %.18g expected)\n", result, expected)
53
- end
54
- end
55
-
56
- def test_rel(result, expected, relerr, desc)
57
- status = nil
58
- if isnan?(result) or isnan?(expected)
59
- status = isnan?(result) != isnan?(expected) ? 1 : 0
60
- elsif isinf?(result) or isinf?(expected)
61
- status = isinf?(result) != isinf?(expected) ? 1 : 0
62
- elsif expected.to_f != 0.0
63
- status = (result - expected).abs/expected.abs > relerr ? 1 : 0
64
- else
65
- status = result.abs > relerr ? 1 : 0
66
- end
67
- $tests += 1
68
- if status == 0
69
- $passed += 1
70
- printf("PASS: #{desc} (%g observed vs %g expected)\n", result, expected)
71
- else
72
- $failed += 1
73
- printf("FAIL: #{desc} (%.18g observed vs %.18g expected)\n", result, expected)
74
- end
75
- end
76
-
77
- def test_abs(result, expected, abserr, desc)
78
- status = nil
79
- if isnan?(result) or isnan?(expected)
80
- status = isnan?(result) != isnan?(expected) ? 1 : 0
81
- elsif isinf?(result) or isinf?(expected)
82
- status = isinf?(result) != isinf?(expected) ? 1 : 0
83
- else
84
- status = (result - expected).abs > abserr ? 1 : 0
85
- end
86
- $tests += 1
87
- if status == 0
88
- $passed += 1
89
- printf("PASS: #{desc} (%g observed vs %g expected)\n", result, expected)
90
- else
91
- $failed += 1
92
- printf("FAIL: #{desc} (%.18g observed vs %.18g expected)\n", result, expected)
93
- end
94
- end
95
-
96
- def test_int(result, expected, desc)
97
- status = (result != expected) ? 1 : 0
98
- $tests += 1
99
- if status == 0
100
- $passed += 1
101
- printf("PASS: #{desc} (%d observed vs %d expected)\n", result, expected)
102
- else
103
- $failed += 1
104
- printf("FAIL: #{desc} (%d observed vs %d expected)\n", result, expected)
105
- end
106
- end
107
-
108
- end
109
- end
110
-
@@ -1,12 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require("gsl")
3
-
4
- h = GSL::Histogram.alloc(10, [0, 10])
5
- p h
6
-
7
- p h.get_range(2)
8
-
9
- p h.range
10
- p h.bin
11
-
12
-
@@ -1,72 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require("gsl")
3
- include Math
4
-
5
- f = GSL::Function::alloc{ |x|
6
- exp(x)*cos(x)
7
- }
8
-
9
- xmin = 0.0
10
- xmax = 1.0
11
- limit = 1000
12
-
13
- puts("QNG")
14
- p f.integration_qng(xmin, xmax, 0.0, 1.0e-7)
15
- p f.integration_qng(xmin, xmax)
16
- p f.integration_qng([xmin, xmax])
17
- p f.integration_qng([xmin, xmax], [0.0, 1.0e-7])
18
- p f.integration_qng([xmin, xmax], 0.0, 1.0e-7)
19
- p f.integration_qng(xmin, xmax, [0.0, 1.0e-7])
20
-
21
- puts("QAG")
22
- p f.integration_qag(xmin, xmax, 0.0, 1.0e-7, limit, GSL::Integration::GAUSS15)
23
- p f.integration_qag([xmin, xmax], 0.0, 1.0e-7, limit, GSL::Integration::GAUSS15)
24
- p f.integration_qag([xmin, xmax], [0.0, 1.0e-7], limit, GSL::Integration::GAUSS15)
25
- p f.integration_qag(xmin, xmax, [0.0, 1.0e-7], limit, GSL::Integration::GAUSS15)
26
- p f.integration_qag(xmin, xmax, GSL::Integration::GAUSS15)
27
- p f.integration_qag([xmin, xmax], GSL::Integration::GAUSS15)
28
- w = GSL::Integration::Workspace.alloc
29
- p f.integration_qag(xmin, xmax, [0.0, 1.0e-7], limit, GSL::Integration::GAUSS15, w)
30
- p f.integration_qag(xmin, xmax, 0.0, 1.0e-7, GSL::Integration::GAUSS15, w)
31
- p f.integration_qag([xmin, xmax], 0.0, 1.0e-7, GSL::Integration::GAUSS15, w)
32
- p f.integration_qag([xmin, xmax], [0.0, 1.0e-7], GSL::Integration::GAUSS15, w)
33
- p f.integration_qag([xmin, xmax], [0.0, 1.0e-7], limit, GSL::Integration::GAUSS15, w)
34
- p f.integration_qag([xmin, xmax], w)
35
-
36
- puts("QAGS")
37
- p f.integration_qags(xmin, xmax)
38
- p f.integration_qags([xmin, xmax])
39
- p f.integration_qags(xmin, xmax, 0.0, 1e-7)
40
- p f.integration_qags(xmin, xmax, [0.0, 1e-7])
41
- p f.integration_qags([xmin, xmax], [0.0, 1e-7])
42
- p f.integration_qags([xmin, xmax], 0.0, 1e-7)
43
- p f.integration_qags([xmin, xmax], 0.0, 1e-7, limit)
44
- p f.integration_qags([xmin, xmax], [0.0, 1e-7], limit)
45
- p f.integration_qags(xmin, xmax, [0.0, 1e-7], limit)
46
- p f.integration_qags([xmin, xmax], 0.0, 1e-7, limit, w)
47
- p f.integration_qags(xmin, xmax, 0.0, 1e-7, limit, w)
48
- p f.integration_qags(xmin, xmax, [0.0, 1e-7], w)
49
- p f.integration_qags([xmin, xmax], [0.0, 1e-7], w)
50
-
51
- p f.integration_qags([xmin, xmax], limit)
52
- p f.integration_qags(xmin, xmax, limit)
53
- p f.integration_qags([xmin, xmax], w)
54
- p f.integration_qags(xmin, xmax, w)
55
- p f.integration_qags(xmin, xmax, limit, w)
56
- p f.integration_qags([xmin, xmax], limit, w)
57
-
58
- puts("QAGP")
59
- p f.integration_qagp([xmin, xmax])
60
- p f.integration_qagp([xmin, xmax], [0.0, 1e-7])
61
- p f.integration_qagp([xmin, xmax], 0.0, 1e-7)
62
- p f.integration_qagp([xmin, xmax], 0.0, 1e-7, limit)
63
- p f.integration_qagp([xmin, xmax], [0.0, 1e-7], limit)
64
- p f.integration_qagp([xmin, xmax], 0.0, 1e-7, limit, w)
65
- p f.integration_qagp([xmin, xmax], [0.0, 1e-7], w)
66
-
67
- p f.integration_qagp([xmin, xmax], limit)
68
- p f.integration_qagp([xmin, xmax], w)
69
- p f.integration_qagp([xmin, xmax], limit, w)
70
-
71
-
72
- __END__
@@ -1,71 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require("gsl")
3
- include Math
4
-
5
- f = GSL::Function::alloc{ |x|
6
- sin(x)/x
7
- }
8
-
9
- xmin = 0.0
10
- xmax = 2.0*PI
11
- limit = 1000
12
-
13
- puts("QNG")
14
- p f.integration_qng(xmin, xmax, 0.0, 1.0e-7)
15
- p f.integration_qng(xmin, xmax)
16
- p f.integration_qng([xmin, xmax])
17
- p f.integration_qng([xmin, xmax], [0.0, 1.0e-7])
18
- p f.integration_qng([xmin, xmax], 0.0, 1.0e-7)
19
- p f.integration_qng(xmin, xmax, [0.0, 1.0e-7])
20
-
21
- puts("QAG")
22
- p f.integration_qag(xmin, xmax, 0.0, 1.0e-7, limit, GSL::Integration::GAUSS15)
23
- p f.integration_qag([xmin, xmax], 0.0, 1.0e-7, limit, GSL::Integration::GAUSS15)
24
- p f.integration_qag([xmin, xmax], [0.0, 1.0e-7], limit, GSL::Integration::GAUSS15)
25
- p f.integration_qag(xmin, xmax, [0.0, 1.0e-7], limit, GSL::Integration::GAUSS15)
26
- p f.integration_qag(xmin, xmax, GSL::Integration::GAUSS15)
27
- p f.integration_qag([xmin, xmax], GSL::Integration::GAUSS15)
28
- w = GSL::Integration::Workspace.alloc(2000)
29
- p f.integration_qag(xmin, xmax, [0.0, 1.0e-7], limit, GSL::Integration::GAUSS15, w)
30
- p f.integration_qag(xmin, xmax, 0.0, 1.0e-7, GSL::Integration::GAUSS15, w)
31
- p f.integration_qag([xmin, xmax], 0.0, 1.0e-7, GSL::Integration::GAUSS15, w)
32
- p f.integration_qag([xmin, xmax], [0.0, 1.0e-7], GSL::Integration::GAUSS15, w)
33
- p f.integration_qag([xmin, xmax], [0.0, 1.0e-7], limit, GSL::Integration::GAUSS15, w)
34
-
35
- puts("QAGS")
36
- p f.integration_qags(xmin, xmax)
37
- p f.integration_qags([xmin, xmax])
38
- p f.integration_qags(xmin, xmax, 0.0, 1e-7)
39
- p f.integration_qags(xmin, xmax, [0.0, 1e-7])
40
- p f.integration_qags([xmin, xmax], [0.0, 1e-7])
41
- p f.integration_qags([xmin, xmax], 0.0, 1e-7)
42
- p f.integration_qags([xmin, xmax], 0.0, 1e-7, limit)
43
- p f.integration_qags([xmin, xmax], [0.0, 1e-7], limit)
44
- p f.integration_qags(xmin, xmax, [0.0, 1e-7], limit)
45
- p f.integration_qags([xmin, xmax], 0.0, 1e-7, limit, w)
46
- p f.integration_qags(xmin, xmax, 0.0, 1e-7, limit, w)
47
- p f.integration_qags(xmin, xmax, [0.0, 1e-7], w)
48
- p f.integration_qags([xmin, xmax], [0.0, 1e-7], w)
49
-
50
- p f.integration_qags([xmin, xmax], limit)
51
- p f.integration_qags(xmin, xmax, limit)
52
- p f.integration_qags([xmin, xmax], w)
53
- p f.integration_qags(xmin, xmax, w)
54
- p f.integration_qags(xmin, xmax, limit, w)
55
- p f.integration_qags([xmin, xmax], limit, w)
56
-
57
- puts("QAGP")
58
- p f.integration_qagp([xmin, xmax])
59
- p f.integration_qagp([xmin, xmax], [0.0, 1e-7])
60
- p f.integration_qagp([xmin, xmax], 0.0, 1e-7)
61
- p f.integration_qagp([xmin, xmax], 0.0, 1e-7, limit)
62
- p f.integration_qagp([xmin, xmax], [0.0, 1e-7], limit)
63
- p f.integration_qagp([xmin, xmax], 0.0, 1e-7, limit, w)
64
- p f.integration_qagp([xmin, xmax], [0.0, 1e-7], w)
65
-
66
- p f.integration_qagp([xmin, xmax], limit)
67
- p f.integration_qagp([xmin, xmax], w)
68
- p f.integration_qagp([xmin, xmax], limit, w)
69
-
70
-
71
- __END__
@@ -1,71 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require("gsl")
3
- include Math
4
-
5
- f = GSL::Function::alloc{ |x|
6
- exp(-x)/sqrt(x)
7
- }
8
-
9
- xmin = 0.0
10
- xmax = 1.0
11
- limit = 1000
12
-
13
- =begin
14
- puts("QNG")
15
- p f.integration_qng(xmin, xmax, 0.0, 1.0e-7)
16
- p f.integration_qng(xmin, xmax)
17
- p f.integration_qng([xmin, xmax])
18
- p f.integration_qng([xmin, xmax], [0.0, 1.0e-7])
19
- p f.integration_qng([xmin, xmax], 0.0, 1.0e-7)
20
- p f.integration_qng(xmin, xmax, [0.0, 1.0e-7])
21
- =end
22
-
23
- puts("QAG")
24
- p f.integration_qag(xmin, xmax, 0.0, 1.0e-7, limit, GSL::Integration::GAUSS15)
25
- p f.integration_qag([xmin, xmax], 0.0, 1.0e-7, limit, GSL::Integration::GAUSS15)
26
- p f.integration_qag([xmin, xmax], [0.0, 1.0e-7], limit, GSL::Integration::GAUSS15)
27
- p f.integration_qag(xmin, xmax, [0.0, 1.0e-7], limit, GSL::Integration::GAUSS15)
28
- p f.integration_qag(xmin, xmax, GSL::Integration::GAUSS15)
29
- p f.integration_qag([xmin, xmax], GSL::Integration::GAUSS15)
30
- w = GSL::Integration::Workspace.alloc(2000)
31
- p f.integration_qag(xmin, xmax, [0.0, 1.0e-7], limit, GSL::Integration::GAUSS15, w)
32
- p f.integration_qag(xmin, xmax, 0.0, 1.0e-7, GSL::Integration::GAUSS15, w)
33
- p f.integration_qag([xmin, xmax], 0.0, 1.0e-7, GSL::Integration::GAUSS15, w)
34
- p f.integration_qag([xmin, xmax], [0.0, 1.0e-7], GSL::Integration::GAUSS15, w)
35
- p f.integration_qag([xmin, xmax], [0.0, 1.0e-7], limit, GSL::Integration::GAUSS15, w)
36
-
37
- puts("QAGS")
38
- p f.integration_qags(xmin, xmax)
39
- p f.integration_qags([xmin, xmax])
40
- p f.integration_qags(xmin, xmax, 0.0, 1e-7)
41
- p f.integration_qags(xmin, xmax, [0.0, 1e-7])
42
- p f.integration_qags([xmin, xmax], [0.0, 1e-7])
43
- p f.integration_qags([xmin, xmax], 0.0, 1e-7)
44
- p f.integration_qags([xmin, xmax], 0.0, 1e-7, limit)
45
- p f.integration_qags([xmin, xmax], [0.0, 1e-7], limit)
46
- p f.integration_qags(xmin, xmax, [0.0, 1e-7], limit)
47
- p f.integration_qags([xmin, xmax], 0.0, 1e-7, limit, w)
48
- p f.integration_qags(xmin, xmax, 0.0, 1e-7, limit, w)
49
- p f.integration_qags(xmin, xmax, [0.0, 1e-7], w)
50
- p f.integration_qags([xmin, xmax], [0.0, 1e-7], w)
51
-
52
- p f.integration_qags([xmin, xmax], limit)
53
- p f.integration_qags(xmin, xmax, limit)
54
- p f.integration_qags([xmin, xmax], w)
55
- p f.integration_qags(xmin, xmax, w)
56
- p f.integration_qags(xmin, xmax, limit, w)
57
- p f.integration_qags([xmin, xmax], limit, w)
58
-
59
- puts("QAGP")
60
- p f.integration_qagp([xmin, xmax])
61
- p f.integration_qagp([xmin, xmax], [0.0, 1e-7])
62
- p f.integration_qagp([xmin, xmax], 0.0, 1e-7)
63
- p f.integration_qagp([xmin, xmax], 0.0, 1e-7, limit)
64
- p f.integration_qagp([xmin, xmax], [0.0, 1e-7], limit)
65
- p f.integration_qagp([xmin, xmax], 0.0, 1e-7, limit, w)
66
- p f.integration_qagp([xmin, xmax], [0.0, 1e-7], w)
67
-
68
- p f.integration_qagp([xmin, xmax], limit)
69
- p f.integration_qagp([xmin, xmax], w)
70
- p f.integration_qagp([xmin, xmax], limit, w)
71
-
@@ -1,71 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require("gsl")
3
- include Math
4
-
5
- f = GSL::Function::alloc{ |x|
6
- (1.0 - exp(-x))/sqrt(x)
7
- }
8
-
9
- xmin = 0.0
10
- xmax = 0.2
11
- limit = 1000
12
-
13
- =begin
14
- puts("QNG")
15
- p f.integration_qng(xmin, xmax, 0.0, 1.0e-7)
16
- p f.integration_qng(xmin, xmax)
17
- p f.integration_qng([xmin, xmax])
18
- p f.integration_qng([xmin, xmax], [0.0, 1.0e-7])
19
- p f.integration_qng([xmin, xmax], 0.0, 1.0e-7)
20
- p f.integration_qng(xmin, xmax, [0.0, 1.0e-7])
21
- =end
22
-
23
- puts("QAG")
24
- p f.integration_qag(xmin, xmax, 0.0, 1.0e-7, limit, GSL::Integration::GAUSS15)
25
- p f.integration_qag([xmin, xmax], 0.0, 1.0e-7, limit, GSL::Integration::GAUSS15)
26
- p f.integration_qag([xmin, xmax], [0.0, 1.0e-7], limit, GSL::Integration::GAUSS15)
27
- p f.integration_qag(xmin, xmax, [0.0, 1.0e-7], limit, GSL::Integration::GAUSS15)
28
- p f.integration_qag(xmin, xmax, GSL::Integration::GAUSS15)
29
- p f.integration_qag([xmin, xmax], GSL::Integration::GAUSS15)
30
- w = GSL::Integration::Workspace.alloc(2000)
31
- p f.integration_qag(xmin, xmax, [0.0, 1.0e-7], limit, GSL::Integration::GAUSS15, w)
32
- p f.integration_qag(xmin, xmax, 0.0, 1.0e-7, GSL::Integration::GAUSS15, w)
33
- p f.integration_qag([xmin, xmax], 0.0, 1.0e-7, GSL::Integration::GAUSS15, w)
34
- p f.integration_qag([xmin, xmax], [0.0, 1.0e-7], GSL::Integration::GAUSS15, w)
35
- p f.integration_qag([xmin, xmax], [0.0, 1.0e-7], limit, GSL::Integration::GAUSS15, w)
36
-
37
- puts("QAGS")
38
- p f.integration_qags(xmin, xmax)
39
- p f.integration_qags([xmin, xmax])
40
- p f.integration_qags(xmin, xmax, 0.0, 1e-7)
41
- p f.integration_qags(xmin, xmax, [0.0, 1e-7])
42
- p f.integration_qags([xmin, xmax], [0.0, 1e-7])
43
- p f.integration_qags([xmin, xmax], 0.0, 1e-7)
44
- p f.integration_qags([xmin, xmax], 0.0, 1e-7, limit)
45
- p f.integration_qags([xmin, xmax], [0.0, 1e-7], limit)
46
- p f.integration_qags(xmin, xmax, [0.0, 1e-7], limit)
47
- p f.integration_qags([xmin, xmax], 0.0, 1e-7, limit, w)
48
- p f.integration_qags(xmin, xmax, 0.0, 1e-7, limit, w)
49
- p f.integration_qags(xmin, xmax, [0.0, 1e-7], w)
50
- p f.integration_qags([xmin, xmax], [0.0, 1e-7], w)
51
-
52
- p f.integration_qags([xmin, xmax], limit)
53
- p f.integration_qags(xmin, xmax, limit)
54
- p f.integration_qags([xmin, xmax], w)
55
- p f.integration_qags(xmin, xmax, w)
56
- p f.integration_qags(xmin, xmax, limit, w)
57
- p f.integration_qags([xmin, xmax], limit, w)
58
-
59
- puts("QAGP")
60
- p f.integration_qagp([xmin, xmax])
61
- p f.integration_qagp([xmin, xmax], [0.0, 1e-7])
62
- p f.integration_qagp([xmin, xmax], 0.0, 1e-7)
63
- p f.integration_qagp([xmin, xmax], 0.0, 1e-7, limit)
64
- p f.integration_qagp([xmin, xmax], [0.0, 1e-7], limit)
65
- p f.integration_qagp([xmin, xmax], 0.0, 1e-7, limit, w)
66
- p f.integration_qagp([xmin, xmax], [0.0, 1e-7], w)
67
-
68
- p f.integration_qagp([xmin, xmax], limit)
69
- p f.integration_qagp([xmin, xmax], w)
70
- p f.integration_qagp([xmin, xmax], limit, w)
71
-
@@ -1,45 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # Ruby/GSL implementation of GSL "interpolation/test.c"
3
- require("gsl")
4
- require("./gsl_test2.rb")
5
- include GSL::Test
6
- include Math
7
-
8
- def test_bsearch()
9
- status = 0
10
- x_array = GSL::Vector.alloc(0.0, 1.0, 2.0, 3.0, 4.0)
11
- index_result = Interp.bsearch(x_array, 1.5, 0, 4)
12
- s = (index_result != 1) ? 1 : 0
13
- status += 1
14
- test(s, "simple bsearch")
15
-
16
- index_result = x_array.bsearch(4.0, 0, 4)
17
- s = (index_result != 3) ? 1 : 0
18
- status += s;
19
- test(s, "upper endpoint bsearch");
20
-
21
- index_result = Interp.bsearch(x_array, 0.0, 0, 4);
22
- s = (index_result != 0) ? 1 : 0
23
- status += s;
24
- test(s, "lower endpoint bsearch");
25
-
26
- index_result = Interp.bsearch(x_array, 2.0, 0, 4);
27
- s = (index_result != 2) ? 1 : 0
28
- status += s;
29
- test(s, "degenerate bsearch");
30
-
31
- index_result = Interp.bsearch(x_array, 10.0, 0, 4);
32
- s = (index_result != 3) ? 1 : 0
33
- status += s;
34
- test(s, "out of bounds bsearch +");
35
-
36
- index_result = Interp.bsearch(x_array, -10.0, 0, 4);
37
- s = (index_result != 0) ? 1 : 0
38
- status += s;
39
- test(s, "out of bounds bsearch -");
40
-
41
- end
42
-
43
-
44
-
45
- test_bsearch()