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.
- checksums.yaml +4 -4
- data/AUTHORS +2 -2
- data/ChangeLog +8 -0
- data/Rakefile +39 -96
- data/VERSION +1 -1
- data/ext/array.c +2 -2
- data/ext/block_source.c +1 -1
- data/ext/dirac.c +1 -1
- data/ext/eigen.c +13 -13
- data/ext/extconf.rb +17 -11
- data/ext/function.c +5 -5
- data/ext/gsl_narray.c +6 -6
- data/ext/histogram.c +7 -6
- data/ext/histogram2d.c +4 -4
- data/ext/interp.c +1 -1
- data/ext/linalg.c +13 -11
- data/ext/linalg_complex.c +8 -6
- data/ext/math.c +1 -1
- data/ext/matrix_complex.c +6 -6
- data/ext/matrix_source.c +10 -10
- data/ext/monte.c +2 -2
- data/ext/multimin.c +4 -4
- data/ext/multiroots.c +8 -8
- data/ext/nmf.c +6 -6
- data/ext/ntuple.c +4 -4
- data/ext/odeiv.c +2 -2
- data/ext/permutation.c +1 -1
- data/ext/poly2.c +6 -6
- data/ext/poly_source.c +9 -6
- data/ext/sf.c +31 -45
- data/ext/signal.c +2 -2
- data/ext/vector_complex.c +11 -10
- data/ext/vector_double.c +7 -4
- data/ext/vector_source.c +29 -26
- data/ext/wavelet.c +1 -1
- data/include/rb_gsl_common.h +12 -0
- data/include/rb_gsl_config.h +10 -1
- data/rdoc/blas.rdoc +4 -4
- data/rdoc/bspline.rdoc +8 -8
- data/rdoc/cheb.rdoc +9 -9
- data/rdoc/cholesky_complex.rdoc +1 -1
- data/rdoc/combi.rdoc +10 -10
- data/rdoc/complex.rdoc +12 -12
- data/rdoc/const.rdoc +21 -21
- data/rdoc/dht.rdoc +7 -7
- data/rdoc/diff.rdoc +7 -7
- data/rdoc/ehandling.rdoc +4 -4
- data/rdoc/eigen.rdoc +12 -12
- data/rdoc/fft.rdoc +27 -27
- data/rdoc/fit.rdoc +19 -19
- data/rdoc/function.rdoc +1 -1
- data/rdoc/graph.rdoc +3 -3
- data/rdoc/hist.rdoc +17 -17
- data/rdoc/hist2d.rdoc +5 -5
- data/rdoc/hist3d.rdoc +4 -4
- data/rdoc/index.rdoc +4 -4
- data/rdoc/integration.rdoc +17 -17
- data/rdoc/interp.rdoc +12 -12
- data/rdoc/intro.rdoc +4 -4
- data/rdoc/linalg.rdoc +21 -21
- data/rdoc/linalg_complex.rdoc +1 -1
- data/rdoc/math.rdoc +14 -14
- data/rdoc/matrix.rdoc +21 -21
- data/rdoc/min.rdoc +10 -10
- data/rdoc/monte.rdoc +4 -4
- data/rdoc/multimin.rdoc +13 -13
- data/rdoc/multiroot.rdoc +13 -13
- data/rdoc/narray.rdoc +10 -10
- data/rdoc/ndlinear.rdoc +5 -5
- data/rdoc/nonlinearfit.rdoc +18 -18
- data/rdoc/ntuple.rdoc +6 -6
- data/rdoc/odeiv.rdoc +13 -13
- data/rdoc/perm.rdoc +12 -12
- data/rdoc/poly.rdoc +18 -18
- data/rdoc/qrng.rdoc +10 -10
- data/rdoc/randist.rdoc +11 -11
- data/rdoc/ref.rdoc +50 -50
- data/rdoc/rng.rdoc +10 -10
- data/rdoc/rngextra.rdoc +5 -5
- data/rdoc/roots.rdoc +13 -13
- data/rdoc/sf.rdoc +36 -36
- data/rdoc/siman.rdoc +4 -4
- data/rdoc/sort.rdoc +7 -7
- data/rdoc/start.rdoc +1 -1
- data/rdoc/stats.rdoc +14 -14
- data/rdoc/sum.rdoc +5 -5
- data/rdoc/tensor.rdoc +4 -4
- data/rdoc/tut.rdoc +1 -1
- data/rdoc/use.rdoc +5 -5
- data/rdoc/vector.rdoc +29 -29
- data/rdoc/vector_complex.rdoc +6 -6
- data/rdoc/wavelet.rdoc +9 -9
- data/test/gsl/blas_test.rb +79 -0
- data/test/gsl/bspline_test.rb +63 -0
- data/test/gsl/cdf_test.rb +1512 -0
- data/test/gsl/cheb_test.rb +80 -0
- data/test/gsl/combination_test.rb +100 -0
- data/test/gsl/complex_test.rb +20 -0
- data/test/gsl/const_test.rb +29 -0
- data/test/gsl/deriv_test.rb +62 -0
- data/test/gsl/dht_test.rb +79 -0
- data/test/gsl/diff_test.rb +53 -0
- data/test/gsl/eigen_test.rb +563 -0
- data/test/gsl/err_test.rb +23 -0
- data/test/gsl/fit_test.rb +101 -0
- data/test/gsl/histo_test.rb +14 -0
- data/test/gsl/integration_test.rb +274 -0
- data/test/gsl/interp_test.rb +27 -0
- data/test/gsl/linalg_test.rb +463 -0
- data/test/gsl/matrix_nmf_test.rb +37 -0
- data/test/gsl/matrix_test.rb +77 -0
- data/test/gsl/min_test.rb +89 -0
- data/test/gsl/monte_test.rb +77 -0
- data/test/gsl/multifit_test.rb +753 -0
- data/test/gsl/multimin_test.rb +157 -0
- data/test/gsl/multiroot_test.rb +135 -0
- data/test/gsl/multiset_test.rb +52 -0
- data/test/gsl/odeiv_test.rb +275 -0
- data/test/gsl/poly_test.rb +338 -0
- data/test/gsl/qrng_test.rb +94 -0
- data/test/gsl/quartic_test.rb +28 -0
- data/test/gsl/randist_test.rb +122 -0
- data/test/gsl/rng_test.rb +303 -0
- data/test/gsl/roots_test.rb +78 -0
- data/test/gsl/sf_test.rb +2079 -0
- data/test/gsl/stats_test.rb +122 -0
- data/test/gsl/sum_test.rb +69 -0
- data/test/gsl/tensor_test.rb +396 -0
- data/test/gsl/vector_test.rb +223 -0
- data/test/gsl/wavelet_test.rb +130 -0
- data/test/gsl_test.rb +321 -0
- data/test/test_helper.rb +42 -0
- metadata +107 -150
- data/setup.rb +0 -1585
- data/tests/blas/amax.rb +0 -14
- data/tests/blas/asum.rb +0 -16
- data/tests/blas/axpy.rb +0 -25
- data/tests/blas/copy.rb +0 -23
- data/tests/blas/dot.rb +0 -23
- data/tests/bspline.rb +0 -53
- data/tests/cdf.rb +0 -1388
- data/tests/cheb.rb +0 -112
- data/tests/combination.rb +0 -123
- data/tests/complex.rb +0 -17
- data/tests/const.rb +0 -24
- data/tests/deriv.rb +0 -85
- data/tests/dht/dht1.rb +0 -17
- data/tests/dht/dht2.rb +0 -23
- data/tests/dht/dht3.rb +0 -23
- data/tests/dht/dht4.rb +0 -23
- data/tests/diff.rb +0 -78
- data/tests/eigen/eigen.rb +0 -220
- data/tests/eigen/gen.rb +0 -105
- data/tests/eigen/genherm.rb +0 -66
- data/tests/eigen/gensymm.rb +0 -68
- data/tests/eigen/nonsymm.rb +0 -53
- data/tests/eigen/nonsymmv.rb +0 -53
- data/tests/eigen/symm-herm.rb +0 -74
- data/tests/err.rb +0 -58
- data/tests/fit.rb +0 -124
- data/tests/gsl_test.rb +0 -118
- data/tests/gsl_test2.rb +0 -110
- data/tests/histo.rb +0 -12
- data/tests/integration/integration1.rb +0 -72
- data/tests/integration/integration2.rb +0 -71
- data/tests/integration/integration3.rb +0 -71
- data/tests/integration/integration4.rb +0 -71
- data/tests/interp.rb +0 -45
- data/tests/linalg/HH.rb +0 -64
- data/tests/linalg/LU.rb +0 -47
- data/tests/linalg/QR.rb +0 -77
- data/tests/linalg/SV.rb +0 -24
- data/tests/linalg/TDN.rb +0 -116
- data/tests/linalg/TDS.rb +0 -122
- data/tests/linalg/bidiag.rb +0 -73
- data/tests/linalg/cholesky.rb +0 -20
- data/tests/linalg/linalg.rb +0 -158
- data/tests/matrix/matrix_complex_test.rb +0 -36
- data/tests/matrix/matrix_nmf_test.rb +0 -39
- data/tests/matrix/matrix_test.rb +0 -48
- data/tests/min.rb +0 -99
- data/tests/monte/miser.rb +0 -31
- data/tests/monte/vegas.rb +0 -45
- data/tests/multifit/test_2dgauss.rb +0 -112
- data/tests/multifit/test_brown.rb +0 -90
- data/tests/multifit/test_enso.rb +0 -246
- data/tests/multifit/test_filip.rb +0 -155
- data/tests/multifit/test_gauss.rb +0 -97
- data/tests/multifit/test_longley.rb +0 -110
- data/tests/multifit/test_multifit.rb +0 -52
- data/tests/multimin.rb +0 -139
- data/tests/multiroot.rb +0 -131
- data/tests/multiset.rb +0 -52
- data/tests/narray/blas_dnrm2.rb +0 -20
- data/tests/odeiv.rb +0 -353
- data/tests/poly/poly.rb +0 -290
- data/tests/poly/special.rb +0 -65
- data/tests/qrng.rb +0 -131
- data/tests/quartic.rb +0 -29
- data/tests/randist.rb +0 -134
- data/tests/rng.rb +0 -305
- data/tests/roots.rb +0 -76
- data/tests/run-test.sh +0 -17
- data/tests/sf/gsl_test_sf.rb +0 -249
- data/tests/sf/test_airy.rb +0 -83
- data/tests/sf/test_bessel.rb +0 -306
- data/tests/sf/test_coulomb.rb +0 -17
- data/tests/sf/test_dilog.rb +0 -25
- data/tests/sf/test_gamma.rb +0 -209
- data/tests/sf/test_hyperg.rb +0 -356
- data/tests/sf/test_legendre.rb +0 -227
- data/tests/sf/test_mathieu.rb +0 -59
- data/tests/sf/test_mode.rb +0 -19
- data/tests/sf/test_sf.rb +0 -839
- data/tests/stats.rb +0 -174
- data/tests/stats_mt.rb +0 -16
- data/tests/sum.rb +0 -98
- data/tests/sys.rb +0 -323
- data/tests/tensor.rb +0 -419
- data/tests/vector/vector_complex_test.rb +0 -101
- data/tests/vector/vector_test.rb +0 -141
- data/tests/wavelet.rb +0 -142
data/tests/gsl_test2.rb
DELETED
@@ -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
|
-
|
data/tests/histo.rb
DELETED
@@ -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
|
-
|
data/tests/interp.rb
DELETED
@@ -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()
|