rb-gsl 1.16.0.4 → 1.16.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +12 -0
- data/.travis.yml +24 -0
- data/AUTHORS +6 -0
- data/COPYING +341 -339
- data/ChangeLog +608 -587
- data/Gemfile +4 -0
- data/README.md +77 -0
- data/Rakefile +14 -33
- data/THANKS +1 -1
- data/examples/blas/blas.rb +1 -1
- data/examples/bspline.rb +3 -3
- data/examples/complex/functions.rb +4 -4
- data/examples/complex/mul.rb +1 -1
- data/examples/const/physconst.rb +4 -4
- data/examples/const/travel.rb +4 -4
- data/examples/eigen/nonsymmv.rb +1 -1
- data/examples/eigen/qhoscillator.rb +3 -3
- data/examples/fft/radix2.rb +1 -1
- data/examples/fft/real-halfcomplex.rb +3 -3
- data/examples/fft/real-halfcomplex2.rb +3 -3
- data/examples/fit/expfit.rb +1 -1
- data/examples/fit/multifit.rb +1 -1
- data/examples/fit/ndlinear.rb +44 -44
- data/examples/fit/nonlinearfit.rb +1 -1
- data/examples/fit/wlinear.rb +3 -3
- data/examples/function/function.rb +1 -1
- data/examples/function/min.rb +1 -1
- data/examples/function/synchrotron.rb +2 -2
- data/examples/gallery/koch.rb +1 -1
- data/examples/histogram/cauchy.rb +2 -2
- data/examples/histogram/exponential.rb +1 -1
- data/examples/histogram/histo3d.rb +1 -1
- data/examples/histogram/histogram-pdf.rb +2 -2
- data/examples/histogram/xexp.rb +1 -1
- data/examples/integration/ahmed.rb +2 -2
- data/examples/integration/cosmology.rb +7 -7
- data/examples/integration/friedmann.rb +4 -4
- data/examples/integration/qng.rb +1 -1
- data/examples/interp/demo.rb +2 -2
- data/examples/linalg/LQ_solve.rb +1 -1
- data/examples/linalg/LU.rb +1 -1
- data/examples/linalg/LU2.rb +1 -1
- data/examples/linalg/LU_narray.rb +1 -1
- data/examples/linalg/PTLQ.rb +1 -1
- data/examples/linalg/QRPT.rb +1 -1
- data/examples/linalg/chol.rb +1 -1
- data/examples/linalg/chol_narray.rb +1 -1
- data/examples/linalg/complex.rb +1 -1
- data/examples/math/elementary.rb +1 -1
- data/examples/math/functions.rb +1 -1
- data/examples/math/inf_nan.rb +1 -1
- data/examples/math/minmax.rb +1 -1
- data/examples/math/power.rb +1 -1
- data/examples/math/test.rb +1 -1
- data/examples/min.rb +1 -1
- data/examples/multimin/bundle.rb +1 -1
- data/examples/multimin/cqp.rb +17 -17
- data/examples/multiroot/fsolver3.rb +1 -1
- data/examples/odeiv/binarysystem.rb +12 -12
- data/examples/odeiv/demo.rb +3 -3
- data/examples/odeiv/frei1.rb +7 -7
- data/examples/odeiv/frei2.rb +4 -4
- data/examples/odeiv/oscillator.rb +1 -1
- data/examples/odeiv/sedov.rb +3 -3
- data/examples/odeiv/whitedwarf.rb +11 -11
- data/examples/permutation/ex1.rb +2 -2
- data/examples/permutation/permutation.rb +1 -1
- data/examples/poly/demo.rb +1 -1
- data/examples/random/diffusion.rb +1 -1
- data/examples/random/generator.rb +2 -2
- data/examples/random/randomwalk.rb +3 -3
- data/examples/random/rng.rb +1 -1
- data/examples/roots/bisection.rb +1 -1
- data/examples/roots/brent.rb +1 -1
- data/examples/roots/demo.rb +1 -1
- data/examples/roots/newton.rb +2 -2
- data/examples/roots/recombination.gp +0 -1
- data/examples/sf/hyperg.rb +1 -1
- data/examples/sf/sphbessel.rb +1 -1
- data/examples/sort/sort.rb +1 -1
- data/examples/tamu_anova.rb +4 -4
- data/examples/vector/add.rb +1 -1
- data/examples/vector/decimate.rb +1 -1
- data/examples/vector/gnuplot.rb +8 -8
- data/examples/vector/vector.rb +2 -2
- data/examples/wavelet/wavelet1.rb +1 -1
- data/ext/{gsl → gsl_native}/alf.c +9 -9
- data/ext/{gsl → gsl_native}/array.c +64 -151
- data/ext/{gsl → gsl_native}/array_complex.c +61 -63
- data/ext/{gsl → gsl_native}/blas.c +0 -0
- data/ext/{gsl → gsl_native}/blas1.c +32 -32
- data/ext/{gsl → gsl_native}/blas2.c +54 -58
- data/ext/{gsl → gsl_native}/blas3.c +54 -54
- data/ext/{gsl → gsl_native}/block.c +3 -6
- data/ext/{gsl/block_source.c → gsl_native/block_source.h} +109 -111
- data/ext/gsl_native/bspline.c +122 -0
- data/ext/{gsl → gsl_native}/bundle.c +0 -0
- data/ext/{gsl → gsl_native}/cdf.c +76 -88
- data/ext/{gsl → gsl_native}/cheb.c +74 -85
- data/ext/{gsl → gsl_native}/combination.c +9 -16
- data/ext/{gsl → gsl_native}/common.c +7 -37
- data/ext/{gsl → gsl_native}/complex.c +113 -115
- data/ext/gsl_native/const.c +331 -0
- data/ext/{gsl → gsl_native}/const_additional.c +12 -33
- data/ext/gsl_native/cqp.c +283 -0
- data/ext/{gsl → gsl_native}/deriv.c +22 -30
- data/ext/{gsl → gsl_native}/dht.c +20 -28
- data/ext/{gsl → gsl_native}/diff.c +23 -25
- data/ext/{gsl → gsl_native}/dirac.c +44 -45
- data/ext/{gsl → gsl_native}/eigen.c +1031 -1082
- data/ext/{gsl → gsl_native}/error.c +13 -13
- data/ext/{gsl → gsl_native}/extconf.rb +5 -13
- data/ext/{gsl → gsl_native}/fft.c +192 -198
- data/ext/{gsl → gsl_native}/fit.c +16 -16
- data/ext/gsl_native/fresnel.c +312 -0
- data/ext/{gsl → gsl_native}/function.c +29 -35
- data/ext/{gsl → gsl_native}/geometry.c +15 -15
- data/ext/{gsl → gsl_native}/graph.c +37 -87
- data/ext/{gsl → gsl_native}/gsl.c +10 -23
- data/ext/{gsl → gsl_native}/gsl_narray.c +15 -24
- data/ext/{gsl → gsl_native}/histogram.c +123 -150
- data/ext/{gsl → gsl_native}/histogram2d.c +71 -96
- data/ext/{gsl → gsl_native}/histogram3d.c +72 -72
- data/ext/{gsl → gsl_native}/histogram3d_source.c +195 -196
- data/ext/{gsl → gsl_native}/histogram_find.c +31 -33
- data/ext/{gsl → gsl_native}/histogram_oper.c +43 -52
- data/ext/{gsl → gsl_native}/ieee.c +7 -15
- data/ext/{gsl → gsl_native}/include/rb_gsl.h +0 -7
- data/ext/{gsl → gsl_native}/include/rb_gsl_array.h +15 -25
- data/ext/{gsl → gsl_native}/include/rb_gsl_cheb.h +0 -0
- data/ext/{gsl → gsl_native}/include/rb_gsl_common.h +44 -52
- data/ext/{gsl → gsl_native}/include/rb_gsl_complex.h +0 -0
- data/ext/{gsl → gsl_native}/include/rb_gsl_const.h +0 -5
- data/ext/{gsl → gsl_native}/include/rb_gsl_dirac.h +0 -0
- data/ext/{gsl → gsl_native}/include/rb_gsl_eigen.h +0 -0
- data/ext/{gsl → gsl_native}/include/rb_gsl_fft.h +0 -3
- data/ext/{gsl → gsl_native}/include/rb_gsl_fit.h +0 -0
- data/ext/{gsl → gsl_native}/include/rb_gsl_function.h +0 -0
- data/ext/{gsl → gsl_native}/include/rb_gsl_graph.h +2 -2
- data/ext/{gsl → gsl_native}/include/rb_gsl_histogram.h +8 -8
- data/ext/{gsl → gsl_native}/include/rb_gsl_histogram3d.h +50 -50
- data/ext/{gsl → gsl_native}/include/rb_gsl_integration.h +0 -0
- data/ext/{gsl → gsl_native}/include/rb_gsl_interp.h +0 -0
- data/ext/{gsl → gsl_native}/include/rb_gsl_linalg.h +0 -1
- data/ext/{gsl → gsl_native}/include/rb_gsl_math.h +0 -4
- data/ext/{gsl → gsl_native}/include/rb_gsl_odeiv.h +0 -0
- data/ext/{gsl → gsl_native}/include/rb_gsl_poly.h +3 -3
- data/ext/{gsl → gsl_native}/include/rb_gsl_rational.h +1 -1
- data/ext/{gsl → gsl_native}/include/rb_gsl_rng.h +0 -0
- data/ext/{gsl → gsl_native}/include/rb_gsl_root.h +0 -0
- data/ext/{gsl → gsl_native}/include/rb_gsl_sf.h +39 -43
- data/ext/{gsl → gsl_native}/include/rb_gsl_statistics.h +0 -0
- data/ext/{gsl → gsl_native}/include/rb_gsl_tensor.h +0 -0
- data/ext/{gsl → gsl_native}/include/rb_gsl_with_narray.h +0 -0
- data/ext/{gsl → gsl_native}/include/templates_off.h +0 -0
- data/ext/{gsl → gsl_native}/include/templates_on.h +1 -1
- data/ext/{gsl → gsl_native}/integration.c +160 -183
- data/ext/{gsl → gsl_native}/interp.c +23 -31
- data/ext/gsl_native/jacobi.c +733 -0
- data/ext/{gsl → gsl_native}/linalg.c +448 -576
- data/ext/{gsl → gsl_native}/linalg_complex.c +84 -98
- data/ext/{gsl → gsl_native}/math.c +45 -63
- data/ext/{gsl → gsl_native}/matrix.c +4 -6
- data/ext/{gsl → gsl_native}/matrix_complex.c +111 -114
- data/ext/{gsl → gsl_native}/matrix_double.c +74 -77
- data/ext/{gsl → gsl_native}/matrix_int.c +49 -50
- data/ext/{gsl/matrix_source.c → gsl_native/matrix_source.h} +280 -302
- data/ext/{gsl → gsl_native}/min.c +43 -74
- data/ext/{gsl → gsl_native}/monte.c +45 -59
- data/ext/{gsl → gsl_native}/multifit.c +138 -147
- data/ext/{gsl → gsl_native}/multimin.c +55 -83
- data/ext/{gsl → gsl_native}/multimin_fsdf.c +15 -15
- data/ext/{gsl → gsl_native}/multiroots.c +61 -64
- data/ext/{gsl → gsl_native}/multiset.c +3 -7
- data/ext/{gsl → gsl_native}/ndlinear.c +320 -321
- data/ext/{gsl → gsl_native}/nmf.c +11 -11
- data/ext/{gsl → gsl_native}/nmf_wrap.c +1 -1
- data/ext/{gsl → gsl_native}/ntuple.c +13 -13
- data/ext/{gsl → gsl_native}/odeiv.c +95 -106
- data/ext/gsl_native/ool.c +879 -0
- data/ext/{gsl → gsl_native}/permutation.c +36 -34
- data/ext/{gsl → gsl_native}/poly.c +2 -5
- data/ext/{gsl → gsl_native}/poly2.c +6 -6
- data/ext/{gsl/poly_source.c → gsl_native/poly_source.h} +232 -275
- data/ext/{gsl → gsl_native}/qrng.c +6 -17
- data/ext/{gsl → gsl_native}/randist.c +218 -243
- data/ext/{gsl → gsl_native}/rational.c +9 -9
- data/ext/{gsl → gsl_native}/rng.c +29 -45
- data/ext/{gsl → gsl_native}/root.c +43 -43
- data/ext/{gsl → gsl_native}/sf.c +163 -197
- data/ext/{gsl → gsl_native}/sf_airy.c +0 -0
- data/ext/{gsl → gsl_native}/sf_bessel.c +6 -6
- data/ext/{gsl → gsl_native}/sf_clausen.c +0 -0
- data/ext/{gsl → gsl_native}/sf_coulomb.c +39 -39
- data/ext/{gsl → gsl_native}/sf_coupling.c +29 -29
- data/ext/{gsl → gsl_native}/sf_dawson.c +0 -0
- data/ext/{gsl → gsl_native}/sf_debye.c +0 -9
- data/ext/{gsl → gsl_native}/sf_dilog.c +0 -0
- data/ext/{gsl → gsl_native}/sf_elementary.c +2 -2
- data/ext/{gsl → gsl_native}/sf_ellint.c +42 -42
- data/ext/{gsl → gsl_native}/sf_elljac.c +2 -2
- data/ext/{gsl → gsl_native}/sf_erfc.c +0 -4
- data/ext/{gsl → gsl_native}/sf_exp.c +2 -2
- data/ext/{gsl → gsl_native}/sf_expint.c +1 -11
- data/ext/{gsl → gsl_native}/sf_fermi_dirac.c +0 -0
- data/ext/{gsl → gsl_native}/sf_gamma.c +1 -5
- data/ext/{gsl → gsl_native}/sf_gegenbauer.c +0 -0
- data/ext/{gsl → gsl_native}/sf_hyperg.c +0 -0
- data/ext/{gsl → gsl_native}/sf_laguerre.c +3 -3
- data/ext/{gsl → gsl_native}/sf_lambert.c +0 -0
- data/ext/{gsl → gsl_native}/sf_legendre.c +0 -0
- data/ext/{gsl → gsl_native}/sf_log.c +3 -3
- data/ext/gsl_native/sf_mathieu.c +235 -0
- data/ext/{gsl → gsl_native}/sf_power.c +0 -0
- data/ext/{gsl → gsl_native}/sf_psi.c +2 -11
- data/ext/{gsl → gsl_native}/sf_synchrotron.c +0 -0
- data/ext/{gsl → gsl_native}/sf_transport.c +0 -0
- data/ext/{gsl → gsl_native}/sf_trigonometric.c +3 -3
- data/ext/{gsl → gsl_native}/sf_zeta.c +0 -4
- data/ext/{gsl → gsl_native}/signal.c +60 -64
- data/ext/{gsl → gsl_native}/siman.c +36 -40
- data/ext/{gsl → gsl_native}/sort.c +3 -4
- data/ext/{gsl → gsl_native}/spline.c +25 -43
- data/ext/{gsl → gsl_native}/stats.c +102 -115
- data/ext/{gsl → gsl_native}/sum.c +32 -32
- data/ext/{gsl → gsl_native}/tamu_anova.c +0 -0
- data/ext/{gsl → gsl_native}/tensor.c +2 -4
- data/ext/{gsl/tensor_source.c → gsl_native/tensor_source.h} +144 -144
- data/ext/{gsl → gsl_native}/vector.c +2 -4
- data/ext/{gsl → gsl_native}/vector_complex.c +165 -171
- data/ext/{gsl → gsl_native}/vector_double.c +167 -174
- data/ext/{gsl → gsl_native}/vector_int.c +23 -25
- data/ext/{gsl/vector_source.c → gsl_native/vector_source.h} +400 -414
- data/ext/{gsl → gsl_native}/wavelet.c +215 -236
- data/lib/gsl.rb +1 -7
- data/lib/gsl/gnuplot.rb +2 -2
- data/lib/gsl/version.rb +1 -3
- data/rb-gsl.gemspec +29 -0
- data/rdoc/blas.rdoc +3 -3
- data/rdoc/bspline.rdoc +7 -7
- data/rdoc/cheb.rdoc +8 -8
- data/rdoc/cholesky_complex.rdoc +1 -1
- data/rdoc/combi.rdoc +9 -9
- data/rdoc/complex.rdoc +11 -11
- data/rdoc/const.rdoc +20 -20
- data/rdoc/dht.rdoc +6 -6
- data/rdoc/diff.rdoc +6 -6
- data/rdoc/ehandling.rdoc +3 -3
- data/rdoc/eigen.rdoc +11 -11
- data/rdoc/fft.rdoc +26 -26
- data/rdoc/fit.rdoc +18 -18
- data/rdoc/graph.rdoc +2 -2
- data/rdoc/hist.rdoc +16 -16
- data/rdoc/hist2d.rdoc +4 -4
- data/rdoc/hist3d.rdoc +3 -3
- data/rdoc/integration.rdoc +16 -16
- data/rdoc/interp.rdoc +11 -11
- data/rdoc/intro.rdoc +3 -3
- data/rdoc/linalg.rdoc +20 -20
- data/rdoc/linalg_complex.rdoc +1 -1
- data/rdoc/math.rdoc +13 -13
- data/rdoc/matrix.rdoc +22 -22
- data/rdoc/min.rdoc +9 -9
- data/rdoc/monte.rdoc +3 -3
- data/rdoc/multimin.rdoc +12 -12
- data/rdoc/multiroot.rdoc +12 -12
- data/rdoc/narray.rdoc +9 -9
- data/rdoc/ndlinear.rdoc +4 -4
- data/rdoc/nonlinearfit.rdoc +17 -17
- data/rdoc/ntuple.rdoc +5 -5
- data/rdoc/odeiv.rdoc +12 -12
- data/rdoc/perm.rdoc +11 -11
- data/rdoc/poly.rdoc +17 -17
- data/rdoc/qrng.rdoc +9 -9
- data/rdoc/randist.rdoc +10 -10
- data/rdoc/ref.rdoc +49 -49
- data/rdoc/rng.rdoc +9 -9
- data/rdoc/roots.rdoc +12 -12
- data/rdoc/sf.rdoc +35 -35
- data/rdoc/siman.rdoc +3 -3
- data/rdoc/sort.rdoc +6 -6
- data/rdoc/start.rdoc +2 -2
- data/rdoc/stats.rdoc +13 -13
- data/rdoc/sum.rdoc +4 -4
- data/rdoc/tensor.rdoc +3 -3
- data/rdoc/tut.rdoc +1 -1
- data/rdoc/use.rdoc +3 -3
- data/rdoc/vector.rdoc +28 -28
- data/rdoc/vector_complex.rdoc +6 -6
- data/rdoc/wavelet.rdoc +8 -8
- data/test/gsl/blas_test.rb +1 -1
- data/test/gsl/index_test.rb +61 -0
- data/test/gsl/matrix_test.rb +21 -0
- data/uncrustify.cfg +1693 -0
- metadata +212 -243
- data/README +0 -28
- data/ext/gsl/bspline.c +0 -130
- data/ext/gsl/const.c +0 -672
- data/ext/gsl/cqp.c +0 -283
- data/ext/gsl/fcmp.c +0 -64
- data/ext/gsl/fresnel.c +0 -312
- data/ext/gsl/jacobi.c +0 -739
- data/ext/gsl/ool.c +0 -879
- data/ext/gsl/oper_complex_source.c +0 -251
- data/ext/gsl/sf_mathieu.c +0 -238
- data/rdoc/index.rdoc +0 -50
File without changes
|
File without changes
|
File without changes
|
@@ -27,7 +27,7 @@ EXTERN VALUE cgsl_rational;
|
|
27
27
|
typedef gsl_vector gsl_poly;
|
28
28
|
typedef gsl_vector_int gsl_poly_int;
|
29
29
|
/*
|
30
|
-
typedef struct ___gsl_rational
|
30
|
+
typedef struct ___gsl_rational
|
31
31
|
{
|
32
32
|
VALUE num, den;
|
33
33
|
gsl_poly *pnum;
|
@@ -36,7 +36,7 @@ typedef struct ___gsl_rational
|
|
36
36
|
*/
|
37
37
|
|
38
38
|
int gsl_poly_conv(const double *a, size_t na, const double *b, size_t nb,
|
39
|
-
|
39
|
+
double *c, size_t *nc);
|
40
40
|
|
41
41
|
gsl_vector* gsl_poly_deconv_vector(const gsl_vector *c, const gsl_vector *a, gsl_vector **r);
|
42
42
|
gsl_vector* gsl_poly_deriv(const gsl_vector *v);
|
@@ -51,7 +51,7 @@ VALUE rb_gsl_poly_complex_solve2(int argc, VALUE *argv, VALUE obj);
|
|
51
51
|
|
52
52
|
|
53
53
|
int gsl_poly_int_conv(const int *a, size_t na, const int *b, size_t nb,
|
54
|
-
|
54
|
+
int *c, size_t *nc);
|
55
55
|
|
56
56
|
gsl_vector_int* gsl_poly_int_deconv_vector(const gsl_vector_int *c, const gsl_vector_int *a, gsl_vector_int **r);
|
57
57
|
gsl_vector_int* gsl_poly_int_deriv(const gsl_vector_int *v);
|
File without changes
|
File without changes
|
@@ -13,6 +13,7 @@
|
|
13
13
|
|
14
14
|
#include <gsl/gsl_sf.h>
|
15
15
|
#include <gsl/gsl_complex.h>
|
16
|
+
#include <gsl/gsl_sf_mathieu.h>
|
16
17
|
#include "rb_gsl.h"
|
17
18
|
|
18
19
|
EXTERN VALUE cgsl_sf_result, cgsl_sf_result_e10;
|
@@ -23,56 +24,56 @@ VALUE rb_gsl_sf_eval1(double (*func)(double), VALUE argv);
|
|
23
24
|
VALUE rb_gsl_sf_eval_int_double(double (*func)(int, double), VALUE jj, VALUE argv);
|
24
25
|
VALUE rb_gsl_sf_eval_double_double(double (*func)(double, double), VALUE ff, VALUE argv);
|
25
26
|
VALUE rb_gsl_sf_eval1_uint(double (*func)(unsigned int), VALUE argv);
|
26
|
-
VALUE rb_gsl_sf_eval_double_m(double (*func)(double, gsl_mode_t), VALUE argv, VALUE m)
|
27
|
-
VALUE rb_gsl_sf_eval_int_double_double(double (*func)(int, double, double), VALUE jj,
|
28
|
-
|
27
|
+
VALUE rb_gsl_sf_eval_double_m(double (*func)(double, gsl_mode_t), VALUE argv, VALUE m);
|
28
|
+
VALUE rb_gsl_sf_eval_int_double_double(double (*func)(int, double, double), VALUE jj,
|
29
|
+
VALUE ff, VALUE argv);
|
29
30
|
VALUE rb_gsl_sf_eval_int_int_double(double (*func)(int, int, double), VALUE jj,
|
30
|
-
|
31
|
-
VALUE rb_gsl_sf_eval_double3(double (*func)(double, double, double),
|
32
|
-
|
33
|
-
VALUE rb_gsl_sf_eval_double4(double (*func)(double, double, double, double),
|
34
|
-
|
31
|
+
VALUE jj2, VALUE argv);
|
32
|
+
VALUE rb_gsl_sf_eval_double3(double (*func)(double, double, double),
|
33
|
+
VALUE ff, VALUE ff2, VALUE argv);
|
34
|
+
VALUE rb_gsl_sf_eval_double4(double (*func)(double, double, double, double),
|
35
|
+
VALUE ff, VALUE ff2, VALUE ff3, VALUE argv);
|
35
36
|
VALUE rb_gsl_sf_eval_double_int(double (*func)(double, int), VALUE argv, VALUE jj);
|
36
37
|
VALUE rb_gsl_sf_eval1_int(double (*func)(int), VALUE argv);
|
37
38
|
VALUE rb_gsl_sf_eval_e(int (*func)(double, gsl_sf_result*), VALUE x);
|
38
|
-
VALUE rb_gsl_sf_eval_e_int_double(int (*func)(int, double, gsl_sf_result*),
|
39
|
-
|
40
|
-
VALUE rb_gsl_sf_eval_e_int_int_double(int (*func)(int, int, double, gsl_sf_result*),
|
41
|
-
|
42
|
-
VALUE rb_gsl_sf_eval_e_double2(int (*func)(double, double, gsl_sf_result*),
|
43
|
-
|
39
|
+
VALUE rb_gsl_sf_eval_e_int_double(int (*func)(int, double, gsl_sf_result*),
|
40
|
+
VALUE n, VALUE x);
|
41
|
+
VALUE rb_gsl_sf_eval_e_int_int_double(int (*func)(int, int, double, gsl_sf_result*),
|
42
|
+
VALUE n1, VALUE n2, VALUE x);
|
43
|
+
VALUE rb_gsl_sf_eval_e_double2(int (*func)(double, double, gsl_sf_result*),
|
44
|
+
VALUE x1, VALUE x2);
|
44
45
|
VALUE rb_gsl_sf_eval_e_uint(int (*func)(unsigned int, gsl_sf_result*), VALUE x);
|
45
|
-
VALUE rb_gsl_sf_eval_e_int_uint(int (*func)(int, unsigned int, gsl_sf_result*),
|
46
|
-
|
47
|
-
VALUE rb_gsl_sf_eval_e_double_uint(int (*func)(double, unsigned int, gsl_sf_result*),
|
48
|
-
|
49
|
-
VALUE rb_gsl_sf_eval_e_m(int (*func)(double, gsl_mode_t, gsl_sf_result*),
|
50
|
-
|
51
|
-
VALUE rb_gsl_sf_eval_e_double2_m(int (*func)(double, double, gsl_mode_t, gsl_sf_result*),
|
52
|
-
|
53
|
-
VALUE rb_gsl_sf_eval_e_double3_m(int (*func)(double, double, double, gsl_mode_t, gsl_sf_result*),
|
54
|
-
|
55
|
-
VALUE rb_gsl_sf_eval_double2_m(double (*func)(double, double, gsl_mode_t),
|
56
|
-
|
57
|
-
VALUE rb_gsl_sf_eval_double3_m(double (*func)(double, double, double, gsl_mode_t),
|
58
|
-
|
46
|
+
VALUE rb_gsl_sf_eval_e_int_uint(int (*func)(int, unsigned int, gsl_sf_result*),
|
47
|
+
VALUE n, VALUE x);
|
48
|
+
VALUE rb_gsl_sf_eval_e_double_uint(int (*func)(double, unsigned int, gsl_sf_result*),
|
49
|
+
VALUE y, VALUE x);
|
50
|
+
VALUE rb_gsl_sf_eval_e_m(int (*func)(double, gsl_mode_t, gsl_sf_result*),
|
51
|
+
VALUE x, VALUE m);
|
52
|
+
VALUE rb_gsl_sf_eval_e_double2_m(int (*func)(double, double, gsl_mode_t, gsl_sf_result*),
|
53
|
+
VALUE x1, VALUE x2, VALUE m);
|
54
|
+
VALUE rb_gsl_sf_eval_e_double3_m(int (*func)(double, double, double, gsl_mode_t, gsl_sf_result*),
|
55
|
+
VALUE x1, VALUE x2, VALUE x3, VALUE m);
|
56
|
+
VALUE rb_gsl_sf_eval_double2_m(double (*func)(double, double, gsl_mode_t),
|
57
|
+
VALUE argv, VALUE x2, VALUE m);
|
58
|
+
VALUE rb_gsl_sf_eval_double3_m(double (*func)(double, double, double, gsl_mode_t),
|
59
|
+
VALUE argv, VALUE x2, VALUE x3, VALUE m);
|
59
60
|
|
60
|
-
VALUE rb_gsl_sf_eval_e_double4_m(int (*func)(double, double, double, double, gsl_mode_t, gsl_sf_result*),
|
61
|
-
|
61
|
+
VALUE rb_gsl_sf_eval_e_double4_m(int (*func)(double, double, double, double, gsl_mode_t, gsl_sf_result*),
|
62
|
+
VALUE x1, VALUE x2, VALUE x3, VALUE x4, VALUE m);
|
62
63
|
|
63
64
|
VALUE rb_gsl_sf_eval_e_int(int (*func)(int, gsl_sf_result*), VALUE x);
|
64
|
-
VALUE rb_gsl_sf_eval_e_double3(int (*func)(double, double, double, gsl_sf_result*),
|
65
|
-
|
66
|
-
VALUE rb_gsl_sf_eval_e_int_double2(int (*func)(int, double, double, gsl_sf_result*),
|
67
|
-
|
68
|
-
VALUE rb_gsl_sf_eval_e_double2(int (*func)(double, double, gsl_sf_result*),
|
69
|
-
|
65
|
+
VALUE rb_gsl_sf_eval_e_double3(int (*func)(double, double, double, gsl_sf_result*),
|
66
|
+
VALUE x1, VALUE x2, VALUE x3);
|
67
|
+
VALUE rb_gsl_sf_eval_e_int_double2(int (*func)(int, double, double, gsl_sf_result*),
|
68
|
+
VALUE n, VALUE x1, VALUE x2);
|
69
|
+
VALUE rb_gsl_sf_eval_e_double2(int (*func)(double, double, gsl_sf_result*),
|
70
|
+
VALUE x1, VALUE x2);
|
70
71
|
|
71
72
|
VALUE eval_sf(double (*func)(double, gsl_mode_t), VALUE argv);
|
72
73
|
|
73
74
|
VALUE rb_gsl_sf_eval_double4_m(double (*func)(double, double, double, double,
|
74
|
-
|
75
|
-
|
75
|
+
gsl_mode_t),
|
76
|
+
VALUE argv, VALUE x2, VALUE x3, VALUE x4, VALUE m);
|
76
77
|
|
77
78
|
VALUE rb_gsl_sf_eval_complex(double (*f)(double), VALUE obj);
|
78
79
|
|
@@ -104,11 +105,6 @@ void Init_gsl_sf_synchrotron(VALUE module);
|
|
104
105
|
void Init_gsl_sf_transport(VALUE module);
|
105
106
|
void Init_gsl_sf_trigonometric(VALUE module);
|
106
107
|
void Init_gsl_sf_zeta(VALUE module);
|
107
|
-
|
108
|
-
|
109
|
-
#ifdef GSL_1_9_LATER
|
110
|
-
#include <gsl/gsl_sf_mathieu.h>
|
111
108
|
void Init_sf_mathieu(VALUE module);
|
112
|
-
#endif
|
113
109
|
|
114
110
|
#endif
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -173,7 +173,7 @@
|
|
173
173
|
#error unknown BASE_ directive in source.h
|
174
174
|
#endif
|
175
175
|
|
176
|
-
#define CONCAT2x(a,b) a ## _ ## b
|
176
|
+
#define CONCAT2x(a,b) a ## _ ## b
|
177
177
|
#define CONCAT2(a,b) CONCAT2x(a,b)
|
178
178
|
#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
|
179
179
|
#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
|
@@ -15,10 +15,10 @@
|
|
15
15
|
#include "include/rb_gsl_common.h"
|
16
16
|
|
17
17
|
#ifndef CHECK_WORKSPACE
|
18
|
-
#define CHECK_WORKSPACE(x) if(CLASS_OF(x)!=cgsl_integration_workspace)\
|
19
|
-
|
20
|
-
|
21
|
-
|
18
|
+
#define CHECK_WORKSPACE(x) if(CLASS_OF(x)!=cgsl_integration_workspace) \
|
19
|
+
rb_raise(rb_eTypeError, \
|
20
|
+
"wrong argument type %s (Integration::Workspace expected)", \
|
21
|
+
rb_class2name(CLASS_OF(x)));
|
22
22
|
#endif
|
23
23
|
|
24
24
|
#define EPSABS_DEFAULT 0.0
|
@@ -30,26 +30,24 @@ static VALUE cgsl_integration_qaws_table, cgsl_integration_qawo_table;
|
|
30
30
|
|
31
31
|
static VALUE cgsl_integration_workspace;
|
32
32
|
|
33
|
-
#ifdef GSL_1_14_LATER
|
34
33
|
static VALUE cgsl_integration_glfixed_table;
|
35
|
-
#endif
|
36
34
|
|
37
35
|
static int get_a_b(int argc, VALUE *argv, int argstart, double *a, double *b);
|
38
|
-
static int get_epsabs_epsrel(int argc, VALUE *argv, int argstart,
|
39
|
-
|
36
|
+
static int get_epsabs_epsrel(int argc, VALUE *argv, int argstart,
|
37
|
+
double *epsabs, double *epsrel);
|
40
38
|
static int get_a_b_epsabs_epsrel(int argc, VALUE *argv, int argstart,
|
41
|
-
|
42
|
-
|
39
|
+
double *a, double *b, double *epsabs,
|
40
|
+
double *epsrel);
|
43
41
|
static int get_limit_key_workspace(int argc, VALUE *argv, int argstart,
|
44
|
-
|
45
|
-
|
42
|
+
size_t *limit, int *key,
|
43
|
+
gsl_integration_workspace **w);
|
46
44
|
static int get_limit_workspace(int argc, VALUE *argv, int argstart,
|
47
|
-
|
48
|
-
|
45
|
+
size_t *limit,
|
46
|
+
gsl_integration_workspace **w);
|
49
47
|
static int get_epsabs_epsrel_limit_workspace(int argc, VALUE *argv, int argstart,
|
50
|
-
|
51
|
-
|
52
|
-
|
48
|
+
double *epsabs, double *epsrel,
|
49
|
+
size_t *limit,
|
50
|
+
gsl_integration_workspace **w);
|
53
51
|
|
54
52
|
static int get_a_b(int argc, VALUE *argv, int argstart, double *a, double *b)
|
55
53
|
{
|
@@ -74,8 +72,8 @@ static int get_a_b(int argc, VALUE *argv, int argstart, double *a, double *b)
|
|
74
72
|
return itmp;
|
75
73
|
}
|
76
74
|
|
77
|
-
static int get_epsabs_epsrel(int argc, VALUE *argv, int argstart,
|
78
|
-
|
75
|
+
static int get_epsabs_epsrel(int argc, VALUE *argv, int argstart,
|
76
|
+
double *epsabs, double *epsrel)
|
79
77
|
{
|
80
78
|
int itmp;
|
81
79
|
VALUE aa, bb;
|
@@ -94,13 +92,13 @@ static int get_epsabs_epsrel(int argc, VALUE *argv, int argstart,
|
|
94
92
|
*epsabs = NUM2DBL(argv[argstart]);
|
95
93
|
*epsrel = NUM2DBL(argv[argstart+1]);
|
96
94
|
itmp = 2;
|
97
|
-
}
|
98
|
-
return
|
95
|
+
}
|
96
|
+
return argstart + itmp;
|
99
97
|
}
|
100
98
|
|
101
99
|
static int get_a_b_epsabs_epsrel(int argc, VALUE *argv, int argstart,
|
102
|
-
|
103
|
-
|
100
|
+
double *a, double *b, double *epsabs,
|
101
|
+
double *epsrel)
|
104
102
|
{
|
105
103
|
int itmp;
|
106
104
|
*epsabs = EPSABS_DEFAULT;
|
@@ -111,8 +109,8 @@ static int get_a_b_epsabs_epsrel(int argc, VALUE *argv, int argstart,
|
|
111
109
|
}
|
112
110
|
|
113
111
|
static int get_limit_key_workspace(int argc, VALUE *argv, int argstart,
|
114
|
-
|
115
|
-
|
112
|
+
size_t *limit, int *key,
|
113
|
+
gsl_integration_workspace **w)
|
116
114
|
{
|
117
115
|
int flag = 0;
|
118
116
|
switch (argc-argstart) {
|
@@ -163,8 +161,8 @@ static int get_limit_key_workspace(int argc, VALUE *argv, int argstart,
|
|
163
161
|
}
|
164
162
|
|
165
163
|
static int get_limit_workspace(int argc, VALUE *argv, int argstart,
|
166
|
-
|
167
|
-
|
164
|
+
size_t *limit,
|
165
|
+
gsl_integration_workspace **w)
|
168
166
|
{
|
169
167
|
int flag = 0;
|
170
168
|
|
@@ -207,9 +205,9 @@ static int get_limit_workspace(int argc, VALUE *argv, int argstart,
|
|
207
205
|
}
|
208
206
|
|
209
207
|
static int get_epsabs_epsrel_limit_workspace(int argc, VALUE *argv, int argstart,
|
210
|
-
|
211
|
-
|
212
|
-
|
208
|
+
double *epsabs, double *epsrel,
|
209
|
+
size_t *limit,
|
210
|
+
gsl_integration_workspace **w)
|
213
211
|
{
|
214
212
|
int flag = 0, itmp;
|
215
213
|
itmp = argstart;
|
@@ -269,9 +267,8 @@ static VALUE rb_gsl_integration_qng(int argc, VALUE *argv, VALUE obj)
|
|
269
267
|
// local variable 'itmp' declared and set, but never used
|
270
268
|
//int itmp;
|
271
269
|
|
272
|
-
if (argc < 1) rb_raise(rb_eArgError,
|
273
|
-
|
274
|
-
|
270
|
+
if (argc < 1) rb_raise(rb_eArgError,
|
271
|
+
"wrong number of arguments (%d for >= 1)", argc);
|
275
272
|
switch (TYPE(obj)) {
|
276
273
|
case T_MODULE: case T_CLASS: case T_OBJECT:
|
277
274
|
CHECK_FUNCTION(argv[0]);
|
@@ -283,12 +280,12 @@ static VALUE rb_gsl_integration_qng(int argc, VALUE *argv, VALUE obj)
|
|
283
280
|
Data_Get_Struct(obj, gsl_function, F);
|
284
281
|
break;
|
285
282
|
}
|
286
|
-
status = gsl_integration_qng(F, a, b, epsabs, epsrel,
|
287
|
-
|
288
|
-
|
283
|
+
status = gsl_integration_qng(F, a, b, epsabs, epsrel,
|
284
|
+
&result, &abserr, &neval);
|
285
|
+
|
289
286
|
return rb_ary_new3(4, rb_float_new(result), rb_float_new(abserr),
|
290
|
-
|
291
|
-
}
|
287
|
+
INT2FIX(neval), INT2FIX(status));
|
288
|
+
}
|
292
289
|
|
293
290
|
static VALUE rb_gsl_integration_qag(int argc, VALUE *argv, VALUE obj)
|
294
291
|
{
|
@@ -298,9 +295,8 @@ static VALUE rb_gsl_integration_qag(int argc, VALUE *argv, VALUE obj)
|
|
298
295
|
gsl_function *F = NULL;
|
299
296
|
gsl_integration_workspace *w = NULL;
|
300
297
|
int key = KEY_DEFAULT, status, intervals, itmp, flag = 0;
|
301
|
-
if (argc < 1) rb_raise(rb_eArgError,
|
302
|
-
|
303
|
-
|
298
|
+
if (argc < 1) rb_raise(rb_eArgError,
|
299
|
+
"wrong number of arguments (%d for >= 1)", argc);
|
304
300
|
switch (TYPE(obj)) {
|
305
301
|
case T_MODULE: case T_CLASS: case T_OBJECT:
|
306
302
|
CHECK_FUNCTION(argv[0]);
|
@@ -325,26 +321,26 @@ static VALUE rb_gsl_integration_qag(int argc, VALUE *argv, VALUE obj)
|
|
325
321
|
default:
|
326
322
|
if (argc == 2) {
|
327
323
|
if (FIXNUM_P(argv[1])) {
|
328
|
-
|
329
|
-
|
330
|
-
|
324
|
+
key = FIX2INT(argv[1]);
|
325
|
+
w = gsl_integration_workspace_alloc(limit);
|
326
|
+
flag = 1;
|
331
327
|
} else if (rb_obj_is_kind_of(argv[1], cgsl_integration_workspace)) {
|
332
|
-
|
333
|
-
|
328
|
+
Data_Get_Struct(argv[1], gsl_integration_workspace, w);
|
329
|
+
flag = 0;
|
334
330
|
} else {
|
335
|
-
|
331
|
+
rb_raise(rb_eTypeError, "Key or Workspace expected");
|
336
332
|
}
|
337
333
|
itmp = get_a_b(argc, argv, 0, &a, &b);
|
338
334
|
} else if (argc == 3) {
|
339
335
|
if (FIXNUM_P(argv[2])) {
|
340
|
-
|
341
|
-
|
342
|
-
|
336
|
+
key = FIX2INT(argv[2]);
|
337
|
+
w = gsl_integration_workspace_alloc(limit);
|
338
|
+
flag = 1;
|
343
339
|
} else if (rb_obj_is_kind_of(argv[2], cgsl_integration_workspace)) {
|
344
|
-
|
345
|
-
|
340
|
+
Data_Get_Struct(argv[2], gsl_integration_workspace, w);
|
341
|
+
flag = 0;
|
346
342
|
} else {
|
347
|
-
|
343
|
+
rb_raise(rb_eTypeError, "Key or Workspace expected");
|
348
344
|
}
|
349
345
|
itmp = get_a_b(argc, argv, 0, &a, &b);
|
350
346
|
} else {
|
@@ -354,14 +350,13 @@ static VALUE rb_gsl_integration_qag(int argc, VALUE *argv, VALUE obj)
|
|
354
350
|
Data_Get_Struct(obj, gsl_function, F);
|
355
351
|
break;
|
356
352
|
}
|
357
|
-
status = gsl_integration_qag(F, a, b, epsabs, epsrel, limit, key, w,
|
358
|
-
|
353
|
+
status = gsl_integration_qag(F, a, b, epsabs, epsrel, limit, key, w,
|
354
|
+
&result, &abserr);
|
359
355
|
intervals = w->size;
|
360
356
|
if (flag == 1) gsl_integration_workspace_free(w);
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
}
|
357
|
+
return rb_ary_new3(4, rb_float_new(result), rb_float_new(abserr),
|
358
|
+
INT2FIX(intervals), INT2FIX(status));
|
359
|
+
}
|
365
360
|
|
366
361
|
static VALUE rb_gsl_integration_qags(int argc, VALUE *argv, VALUE obj)
|
367
362
|
{
|
@@ -383,16 +378,15 @@ static VALUE rb_gsl_integration_qags(int argc, VALUE *argv, VALUE obj)
|
|
383
378
|
break;
|
384
379
|
}
|
385
380
|
flag = get_epsabs_epsrel_limit_workspace(argc, argv, itmp, &epsabs, &epsrel,
|
386
|
-
|
387
|
-
|
388
|
-
status = gsl_integration_qags(F, a, b, epsabs, epsrel, limit, w,
|
389
|
-
|
381
|
+
&limit, &w);
|
382
|
+
|
383
|
+
status = gsl_integration_qags(F, a, b, epsabs, epsrel, limit, w,
|
384
|
+
&result, &abserr);
|
390
385
|
intervals = w->size;
|
391
386
|
if (flag == 1) gsl_integration_workspace_free(w);
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
}
|
387
|
+
return rb_ary_new3(4, rb_float_new(result), rb_float_new(abserr),
|
388
|
+
INT2FIX(intervals), INT2FIX(status));
|
389
|
+
}
|
396
390
|
|
397
391
|
static VALUE rb_gsl_integration_qagp(int argc, VALUE *argv, VALUE obj)
|
398
392
|
{
|
@@ -423,17 +417,16 @@ static VALUE rb_gsl_integration_qagp(int argc, VALUE *argv, VALUE obj)
|
|
423
417
|
}
|
424
418
|
itmp += 1;
|
425
419
|
flag = get_epsabs_epsrel_limit_workspace(argc, argv, itmp, &epsabs, &epsrel,
|
426
|
-
|
420
|
+
&limit, &w);
|
427
421
|
|
428
|
-
status = gsl_integration_qagp(F, v->data, v->size, epsabs, epsrel, limit, w,
|
429
|
-
|
422
|
+
status = gsl_integration_qagp(F, v->data, v->size, epsabs, epsrel, limit, w,
|
423
|
+
&result, &abserr);
|
430
424
|
intervals = w->size;
|
431
425
|
if (flag == 1) gsl_integration_workspace_free(w);
|
432
426
|
if (flag2 == 1) gsl_vector_free(v);
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
}
|
427
|
+
return rb_ary_new3(4, rb_float_new(result), rb_float_new(abserr),
|
428
|
+
INT2FIX(intervals), INT2FIX(status));
|
429
|
+
}
|
437
430
|
|
438
431
|
/* (-infty --- +infty) */
|
439
432
|
static VALUE rb_gsl_integration_qagi(int argc, VALUE *argv, VALUE obj)
|
@@ -456,15 +449,14 @@ static VALUE rb_gsl_integration_qagi(int argc, VALUE *argv, VALUE obj)
|
|
456
449
|
break;
|
457
450
|
}
|
458
451
|
flag = get_epsabs_epsrel_limit_workspace(argc, argv, itmp, &epsabs, &epsrel,
|
459
|
-
|
460
|
-
status = gsl_integration_qagi(F, epsabs, epsrel, limit, w,
|
461
|
-
|
452
|
+
&limit, &w);
|
453
|
+
status = gsl_integration_qagi(F, epsabs, epsrel, limit, w,
|
454
|
+
&result, &abserr);
|
462
455
|
intervals = w->size;
|
463
456
|
if (flag == 1) gsl_integration_workspace_free(w);
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
}
|
457
|
+
return rb_ary_new3(4, rb_float_new(result), rb_float_new(abserr),
|
458
|
+
INT2FIX(intervals), INT2FIX(status));
|
459
|
+
}
|
468
460
|
|
469
461
|
/* (a --- +infty) */
|
470
462
|
static VALUE rb_gsl_integration_qagiu(int argc, VALUE *argv, VALUE obj)
|
@@ -490,15 +482,14 @@ static VALUE rb_gsl_integration_qagiu(int argc, VALUE *argv, VALUE obj)
|
|
490
482
|
a = NUM2DBL(argv[itmp]);
|
491
483
|
itmp += 1;
|
492
484
|
flag = get_epsabs_epsrel_limit_workspace(argc, argv, itmp, &epsabs, &epsrel,
|
493
|
-
|
494
|
-
status = gsl_integration_qagiu(F, a, epsabs, epsrel, limit, w,
|
495
|
-
|
485
|
+
&limit, &w);
|
486
|
+
status = gsl_integration_qagiu(F, a, epsabs, epsrel, limit, w,
|
487
|
+
&result, &abserr);
|
496
488
|
intervals = w->size;
|
497
489
|
if (flag == 1) gsl_integration_workspace_free(w);
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
}
|
490
|
+
return rb_ary_new3(4, rb_float_new(result), rb_float_new(abserr),
|
491
|
+
INT2FIX(intervals), INT2FIX(status));
|
492
|
+
}
|
502
493
|
|
503
494
|
/* (-infty --- b) */
|
504
495
|
static VALUE rb_gsl_integration_qagil(int argc, VALUE *argv, VALUE obj)
|
@@ -523,17 +514,16 @@ static VALUE rb_gsl_integration_qagil(int argc, VALUE *argv, VALUE obj)
|
|
523
514
|
Need_Float(argv[itmp]);
|
524
515
|
b = NUM2DBL(argv[itmp]);
|
525
516
|
flag = get_epsabs_epsrel_limit_workspace(argc, argv, itmp+1, &epsabs, &epsrel,
|
526
|
-
|
517
|
+
&limit, &w);
|
527
518
|
Data_Get_Struct(obj, gsl_function, F);
|
528
519
|
|
529
|
-
status = gsl_integration_qagil(F, b, epsabs, epsrel, limit, w,
|
530
|
-
|
520
|
+
status = gsl_integration_qagil(F, b, epsabs, epsrel, limit, w,
|
521
|
+
&result, &abserr);
|
531
522
|
intervals = w->size;
|
532
523
|
if (flag == 1) gsl_integration_workspace_free(w);
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
}
|
524
|
+
return rb_ary_new3(4, rb_float_new(result), rb_float_new(abserr),
|
525
|
+
INT2FIX(intervals), INT2FIX(status));
|
526
|
+
}
|
537
527
|
|
538
528
|
static VALUE rb_gsl_integration_qawc(int argc, VALUE *argv, VALUE obj)
|
539
529
|
{
|
@@ -559,14 +549,13 @@ static VALUE rb_gsl_integration_qawc(int argc, VALUE *argv, VALUE obj)
|
|
559
549
|
Need_Float(argv[itmp]);
|
560
550
|
c = NUM2DBL(argv[itmp]);
|
561
551
|
flag = get_epsabs_epsrel_limit_workspace(argc, argv, itmp+1, &epsabs, &epsrel,
|
562
|
-
|
552
|
+
&limit, &w);
|
563
553
|
status = gsl_integration_qawc(F, a, b, c, epsabs, epsrel, limit, w, &result, &abserr);
|
564
554
|
intervals = w->size;
|
565
555
|
if (flag == 1) gsl_integration_workspace_free(w);
|
566
|
-
|
567
556
|
return rb_ary_new3(4, rb_float_new(result), rb_float_new(abserr), INT2FIX(intervals),
|
568
|
-
|
569
|
-
}
|
557
|
+
INT2FIX(status));
|
558
|
+
}
|
570
559
|
|
571
560
|
VALUE rb_gsl_integration_qaws_table_alloc(int argc, VALUE *argv, VALUE klass)
|
572
561
|
{
|
@@ -587,7 +576,7 @@ VALUE rb_gsl_integration_qaws_table_alloc(int argc, VALUE *argv, VALUE klass)
|
|
587
576
|
nu = argv[3];
|
588
577
|
}
|
589
578
|
t = gsl_integration_qaws_table_alloc(NUM2DBL(alpha), NUM2DBL(beta),
|
590
|
-
|
579
|
+
FIX2INT(mu), FIX2INT(nu));
|
591
580
|
return Data_Wrap_Struct(klass, 0, gsl_integration_qaws_table_free, t);
|
592
581
|
}
|
593
582
|
|
@@ -614,7 +603,6 @@ static VALUE rb_gsl_integration_qaws_table_set(int argc, VALUE *argv, VALUE obj)
|
|
614
603
|
} else {
|
615
604
|
rb_raise(rb_eTypeError, "wrong argument type %s", rb_class2name(CLASS_OF(argv[0])));
|
616
605
|
}
|
617
|
-
|
618
606
|
gsl_integration_qaws_table_set(t, alpha, beta, mu, nu);
|
619
607
|
return obj;
|
620
608
|
}
|
@@ -637,8 +625,8 @@ static VALUE rb_gsl_ary_to_integration_qaws_table(VALUE ary)
|
|
637
625
|
{
|
638
626
|
gsl_integration_qaws_table *t = NULL;
|
639
627
|
t = make_qaws_table(ary);
|
640
|
-
return Data_Wrap_Struct(cgsl_integration_qaws_table,
|
641
|
-
|
628
|
+
return Data_Wrap_Struct(cgsl_integration_qaws_table,
|
629
|
+
0, gsl_integration_qaws_table_free, t);
|
642
630
|
}
|
643
631
|
|
644
632
|
static gsl_integration_qaws_table* make_qaws_table(VALUE ary)
|
@@ -682,33 +670,30 @@ static VALUE rb_gsl_integration_qaws(int argc, VALUE *argv, VALUE obj)
|
|
682
670
|
} else {
|
683
671
|
flagt = 0;
|
684
672
|
if (!rb_obj_is_kind_of(argv[itmp], cgsl_integration_qaws_table))
|
685
|
-
|
686
|
-
|
673
|
+
rb_raise(rb_eTypeError, "Integration::QAWS_Table expected");
|
687
674
|
Data_Get_Struct(argv[itmp], gsl_integration_qaws_table, t);
|
688
675
|
}
|
689
676
|
flag = get_epsabs_epsrel_limit_workspace(argc, argv, itmp+1, &epsabs, &epsrel,
|
690
|
-
|
677
|
+
&limit, &w);
|
691
678
|
status = gsl_integration_qaws(F, a, b, t, epsabs, epsrel, limit, w, &result, &abserr);
|
692
679
|
intervals = w->size;
|
693
680
|
if (flag == 1) gsl_integration_workspace_free(w);
|
694
681
|
if (flagt == 1) gsl_integration_qaws_table_free(t);
|
695
|
-
|
696
682
|
return rb_ary_new3(4, rb_float_new(result), rb_float_new(abserr), INT2FIX(intervals),
|
697
|
-
|
698
|
-
}
|
683
|
+
INT2FIX(status));
|
684
|
+
}
|
699
685
|
|
700
686
|
static gsl_integration_qawo_table* make_qawo_table(VALUE ary);
|
701
687
|
|
702
688
|
static VALUE rb_gsl_integration_qawo_table_alloc(int argc, VALUE *argv,
|
703
|
-
|
689
|
+
VALUE klass)
|
704
690
|
{
|
705
691
|
gsl_integration_qawo_table *t = NULL;
|
706
692
|
double omega, L;
|
707
693
|
enum gsl_integration_qawo_enum sine;
|
708
694
|
size_t n;
|
709
|
-
if (argc != 1 && argc != 4)
|
695
|
+
if (argc != 1 && argc != 4)
|
710
696
|
rb_raise(rb_eArgError, "wrong nubmer of arguments (%d for 1 or 4)", argc);
|
711
|
-
|
712
697
|
if (TYPE(argv[0]) == T_ARRAY) {
|
713
698
|
omega = NUM2DBL(rb_ary_entry(argv[0], 0));
|
714
699
|
L = NUM2DBL(rb_ary_entry(argv[0], 1));
|
@@ -720,9 +705,8 @@ static VALUE rb_gsl_integration_qawo_table_alloc(int argc, VALUE *argv,
|
|
720
705
|
sine = FIX2INT(argv[2]);
|
721
706
|
n = FIX2INT(argv[3]);
|
722
707
|
}
|
723
|
-
|
724
708
|
t = gsl_integration_qawo_table_alloc(omega, L, sine, n);
|
725
|
-
|
709
|
+
|
726
710
|
return Data_Wrap_Struct(klass, 0, gsl_integration_qawo_table_free, t);
|
727
711
|
}
|
728
712
|
|
@@ -743,8 +727,8 @@ static VALUE rb_gsl_ary_to_integration_qawo_table(VALUE ary)
|
|
743
727
|
{
|
744
728
|
gsl_integration_qawo_table *t = NULL;
|
745
729
|
t = make_qawo_table(ary);
|
746
|
-
return Data_Wrap_Struct(cgsl_integration_qawo_table,
|
747
|
-
|
730
|
+
return Data_Wrap_Struct(cgsl_integration_qawo_table,
|
731
|
+
0, gsl_integration_qawo_table_free, t);
|
748
732
|
}
|
749
733
|
|
750
734
|
static gsl_integration_qawo_table* make_qawo_table(VALUE ary)
|
@@ -806,7 +790,7 @@ static VALUE rb_gsl_integration_qawo(int argc, VALUE *argv, VALUE obj)
|
|
806
790
|
int status, intervals, itmp, flag = 0, flagt = 0;
|
807
791
|
switch (TYPE(obj)) {
|
808
792
|
case T_MODULE: case T_CLASS: case T_OBJECT:
|
809
|
-
|
793
|
+
if (argc < 2) rb_raise(rb_eArgError, "too few arguments");
|
810
794
|
CHECK_FUNCTION(argv[0]);
|
811
795
|
Data_Get_Struct(argv[0], gsl_function, F);
|
812
796
|
itmp = 1;
|
@@ -821,18 +805,17 @@ static VALUE rb_gsl_integration_qawo(int argc, VALUE *argv, VALUE obj)
|
|
821
805
|
a = NUM2DBL(argv[itmp]);
|
822
806
|
flagt = get_qawo_table(argv[argc-1], &t);
|
823
807
|
flag = get_epsabs_epsrel_limit_workspace(argc-1, argv, itmp+1, &epsabs, &epsrel,
|
824
|
-
|
808
|
+
&limit, &w);
|
825
809
|
status = gsl_integration_qawo(F, a, epsabs, epsrel, limit, w, t, &result, &abserr);
|
826
810
|
intervals = w->size;
|
827
811
|
if (flag == 1) gsl_integration_workspace_free(w);
|
828
812
|
if (flagt == 1) gsl_integration_qawo_table_free(t);
|
829
|
-
|
830
813
|
return rb_ary_new3(4, rb_float_new(result), rb_float_new(abserr), INT2FIX(intervals),
|
831
|
-
|
832
|
-
}
|
814
|
+
INT2FIX(status));
|
815
|
+
}
|
833
816
|
|
834
817
|
static int get_qawo_table(VALUE tt,
|
835
|
-
|
818
|
+
gsl_integration_qawo_table **t)
|
836
819
|
{
|
837
820
|
int flagt;
|
838
821
|
|
@@ -879,7 +862,7 @@ static VALUE rb_gsl_integration_qawf(int argc, VALUE *argv, VALUE obj)
|
|
879
862
|
itmp += 1;
|
880
863
|
}
|
881
864
|
vtmp = argv + itmp;
|
882
|
-
flagt = get_qawo_table(argv[argc-1], &t);
|
865
|
+
flagt = get_qawo_table(argv[argc-1], &t);
|
883
866
|
|
884
867
|
switch (argc - 1 - itmp) {
|
885
868
|
case 0:
|
@@ -920,10 +903,9 @@ static VALUE rb_gsl_integration_qawf(int argc, VALUE *argv, VALUE obj)
|
|
920
903
|
gsl_integration_workspace_free(cw);
|
921
904
|
}
|
922
905
|
if (flagt == 1) gsl_integration_qawo_table_free(t);
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
}
|
906
|
+
return rb_ary_new3(4, rb_float_new(result), rb_float_new(abserr),
|
907
|
+
INT2FIX(intervals), INT2FIX(status));
|
908
|
+
}
|
927
909
|
|
928
910
|
|
929
911
|
static void rb_gsl_integration_define_symbols(VALUE module)
|
@@ -939,14 +921,14 @@ static void rb_gsl_integration_define_symbols(VALUE module)
|
|
939
921
|
}
|
940
922
|
|
941
923
|
static VALUE rb_gsl_integration_workspace_alloc(int argc, VALUE *argv,
|
942
|
-
|
924
|
+
VALUE klass)
|
943
925
|
{
|
944
926
|
size_t limit;
|
945
927
|
if (argc == 1) limit = FIX2INT(argv[0]);
|
946
928
|
else limit = LIMIT_DEFAULT;
|
947
|
-
return Data_Wrap_Struct(klass, 0,
|
948
|
-
|
949
|
-
|
929
|
+
return Data_Wrap_Struct(klass, 0,
|
930
|
+
gsl_integration_workspace_free,
|
931
|
+
gsl_integration_workspace_alloc(limit));
|
950
932
|
}
|
951
933
|
|
952
934
|
static VALUE rb_gsl_integration_workspace_limit(VALUE obj)
|
@@ -989,7 +971,7 @@ static VALUE rb_gsl_integration_workspace_to_a(VALUE obj)
|
|
989
971
|
gsl_integration_workspace *w = NULL;
|
990
972
|
Data_Get_Struct(obj, gsl_integration_workspace, w);
|
991
973
|
return rb_ary_new3(5, INT2FIX(w->limit), INT2FIX(w->size), INT2FIX(w->nrmax),
|
992
|
-
|
974
|
+
INT2FIX(w->i), INT2FIX(w->maximum_level));
|
993
975
|
}
|
994
976
|
|
995
977
|
static VALUE rb_gsl_integration_workspace_alist(VALUE obj)
|
@@ -1029,7 +1011,6 @@ static VALUE rb_gsl_integration_workspace_elist(VALUE obj)
|
|
1029
1011
|
return Data_Wrap_Struct(cgsl_vector_view_ro, 0, free, v);
|
1030
1012
|
}
|
1031
1013
|
|
1032
|
-
#ifdef GSL_1_14_LATER
|
1033
1014
|
static VALUE rb_gsl_integration_glfixed_table_alloc(VALUE klass, VALUE n)
|
1034
1015
|
{
|
1035
1016
|
gsl_integration_glfixed_table *t;
|
@@ -1045,7 +1026,7 @@ static VALUE rb_gsl_integration_glfixed(VALUE obj, VALUE aa, VALUE bb, VALUE tt)
|
|
1045
1026
|
double res;
|
1046
1027
|
if (!rb_obj_is_kind_of(tt, cgsl_integration_glfixed_table)) {
|
1047
1028
|
rb_raise(rb_eTypeError, "Wrong arugment type (%s for GSL::Integration::Glfixed_table)",
|
1048
|
-
|
1029
|
+
rb_class2name(CLASS_OF(tt)));
|
1049
1030
|
}
|
1050
1031
|
Data_Get_Struct(tt, gsl_integration_glfixed_table, t);
|
1051
1032
|
a = NUM2DBL(aa);
|
@@ -1054,7 +1035,6 @@ static VALUE rb_gsl_integration_glfixed(VALUE obj, VALUE aa, VALUE bb, VALUE tt)
|
|
1054
1035
|
res = gsl_integration_glfixed(f, a, b, t);
|
1055
1036
|
return rb_float_new(res);
|
1056
1037
|
}
|
1057
|
-
#endif
|
1058
1038
|
|
1059
1039
|
void Init_gsl_integration(VALUE module)
|
1060
1040
|
{
|
@@ -1080,69 +1060,69 @@ void Init_gsl_integration(VALUE module)
|
|
1080
1060
|
rb_define_alias(cgsl_function, "qagil", "integration_qagil");
|
1081
1061
|
rb_define_alias(cgsl_function, "qawc", "integration_qawc");
|
1082
1062
|
|
1083
|
-
cgsl_integration_qaws_table = rb_define_class_under(mgsl_integ, "QAWS_Table",
|
1084
|
-
|
1063
|
+
cgsl_integration_qaws_table = rb_define_class_under(mgsl_integ, "QAWS_Table",
|
1064
|
+
cGSL_Object);
|
1085
1065
|
rb_define_singleton_method(cgsl_integration_qaws_table, "alloc",
|
1086
|
-
|
1066
|
+
rb_gsl_integration_qaws_table_alloc, -1);
|
1087
1067
|
/* rb_define_singleton_method(cgsl_integration_qaws_table, "new",
|
1088
1068
|
rb_gsl_integration_qaws_table_alloc, -1);*/
|
1089
|
-
rb_define_method(cgsl_integration_qaws_table, "to_a",
|
1090
|
-
|
1091
|
-
rb_define_method(cgsl_integration_qaws_table, "set",
|
1092
|
-
|
1093
|
-
rb_define_method(rb_cArray, "to_gsl_integration_qaws_table",
|
1094
|
-
|
1069
|
+
rb_define_method(cgsl_integration_qaws_table, "to_a",
|
1070
|
+
rb_gsl_integration_qaws_table_to_a, 0);
|
1071
|
+
rb_define_method(cgsl_integration_qaws_table, "set",
|
1072
|
+
rb_gsl_integration_qaws_table_set, -1);
|
1073
|
+
rb_define_method(rb_cArray, "to_gsl_integration_qaws_table",
|
1074
|
+
rb_gsl_ary_to_integration_qaws_table, 0);
|
1095
1075
|
rb_define_alias(rb_cArray, "to_qaws_table", "to_gsl_integration_qaws_table");
|
1096
1076
|
rb_define_method(cgsl_function, "integration_qaws", rb_gsl_integration_qaws, -1);
|
1097
1077
|
rb_define_alias(cgsl_function, "qaws", "integration_qaws");
|
1098
1078
|
|
1099
|
-
cgsl_integration_qawo_table = rb_define_class_under(mgsl_integ, "QAWO_Table",
|
1100
|
-
|
1079
|
+
cgsl_integration_qawo_table = rb_define_class_under(mgsl_integ, "QAWO_Table",
|
1080
|
+
cGSL_Object);
|
1101
1081
|
rb_define_singleton_method(cgsl_integration_qawo_table, "alloc",
|
1102
|
-
|
1082
|
+
rb_gsl_integration_qawo_table_alloc, -1);
|
1103
1083
|
/* rb_define_singleton_method(cgsl_integration_qawo_table, "new",
|
1104
1084
|
rb_gsl_integration_qawo_table_alloc, -1);*/
|
1105
|
-
rb_define_method(cgsl_integration_qawo_table, "to_a",
|
1106
|
-
|
1107
|
-
rb_define_method(rb_cArray, "to_gsl_integration_qawo_table",
|
1108
|
-
|
1109
|
-
rb_define_method(cgsl_integration_qawo_table, "set",
|
1110
|
-
|
1111
|
-
rb_define_method(cgsl_integration_qawo_table, "set_length",
|
1112
|
-
|
1085
|
+
rb_define_method(cgsl_integration_qawo_table, "to_a",
|
1086
|
+
rb_gsl_integration_qawo_table_to_a, 0);
|
1087
|
+
rb_define_method(rb_cArray, "to_gsl_integration_qawo_table",
|
1088
|
+
rb_gsl_ary_to_integration_qawo_table, 0);
|
1089
|
+
rb_define_method(cgsl_integration_qawo_table, "set",
|
1090
|
+
rb_gsl_integration_qawo_table_set, -1);
|
1091
|
+
rb_define_method(cgsl_integration_qawo_table, "set_length",
|
1092
|
+
rb_gsl_integration_qawo_table_set_length, 1);
|
1113
1093
|
rb_define_method(cgsl_function, "integration_qawo", rb_gsl_integration_qawo, -1);
|
1114
1094
|
rb_define_method(cgsl_function, "integration_qawf", rb_gsl_integration_qawf, -1);
|
1115
1095
|
rb_define_alias(cgsl_function, "qawo", "integration_qawo");
|
1116
1096
|
rb_define_alias(cgsl_function, "qawf", "integration_qawf");
|
1117
1097
|
|
1118
|
-
cgsl_integration_workspace = rb_define_class_under(mgsl_integ,
|
1119
|
-
|
1098
|
+
cgsl_integration_workspace = rb_define_class_under(mgsl_integ,
|
1099
|
+
"Workspace", cGSL_Object);
|
1120
1100
|
|
1121
1101
|
/* rb_define_singleton_method(cgsl_integration_workspace, "new",
|
1122
1102
|
rb_gsl_integration_workspace_alloc, -1);*/
|
1123
1103
|
rb_define_singleton_method(cgsl_integration_workspace, "alloc",
|
1124
|
-
|
1125
|
-
|
1126
|
-
rb_define_method(cgsl_integration_workspace, "limit",
|
1127
|
-
|
1128
|
-
rb_define_method(cgsl_integration_workspace, "size",
|
1129
|
-
|
1130
|
-
rb_define_method(cgsl_integration_workspace, "nrmax",
|
1131
|
-
|
1132
|
-
rb_define_method(cgsl_integration_workspace, "i",
|
1133
|
-
|
1134
|
-
rb_define_method(cgsl_integration_workspace, "maximum_level",
|
1135
|
-
|
1136
|
-
rb_define_method(cgsl_integration_workspace, "to_a",
|
1137
|
-
|
1138
|
-
rb_define_method(cgsl_integration_workspace, "alist",
|
1139
|
-
|
1140
|
-
rb_define_method(cgsl_integration_workspace, "blist",
|
1141
|
-
|
1142
|
-
rb_define_method(cgsl_integration_workspace, "rlist",
|
1143
|
-
|
1144
|
-
rb_define_method(cgsl_integration_workspace, "elist",
|
1145
|
-
|
1104
|
+
rb_gsl_integration_workspace_alloc, -1);
|
1105
|
+
|
1106
|
+
rb_define_method(cgsl_integration_workspace, "limit",
|
1107
|
+
rb_gsl_integration_workspace_limit, 0);
|
1108
|
+
rb_define_method(cgsl_integration_workspace, "size",
|
1109
|
+
rb_gsl_integration_workspace_size, 0);
|
1110
|
+
rb_define_method(cgsl_integration_workspace, "nrmax",
|
1111
|
+
rb_gsl_integration_workspace_nrmax, 0);
|
1112
|
+
rb_define_method(cgsl_integration_workspace, "i",
|
1113
|
+
rb_gsl_integration_workspace_i, 0);
|
1114
|
+
rb_define_method(cgsl_integration_workspace, "maximum_level",
|
1115
|
+
rb_gsl_integration_workspace_maximum_level, 0);
|
1116
|
+
rb_define_method(cgsl_integration_workspace, "to_a",
|
1117
|
+
rb_gsl_integration_workspace_to_a, 0);
|
1118
|
+
rb_define_method(cgsl_integration_workspace, "alist",
|
1119
|
+
rb_gsl_integration_workspace_alist, 0);
|
1120
|
+
rb_define_method(cgsl_integration_workspace, "blist",
|
1121
|
+
rb_gsl_integration_workspace_blist, 0);
|
1122
|
+
rb_define_method(cgsl_integration_workspace, "rlist",
|
1123
|
+
rb_gsl_integration_workspace_rlist, 0);
|
1124
|
+
rb_define_method(cgsl_integration_workspace, "elist",
|
1125
|
+
rb_gsl_integration_workspace_elist, 0);
|
1146
1126
|
|
1147
1127
|
/*****/
|
1148
1128
|
rb_define_module_function(mgsl_integ, "qng", rb_gsl_integration_qng, -1);
|
@@ -1157,13 +1137,10 @@ void Init_gsl_integration(VALUE module)
|
|
1157
1137
|
rb_define_module_function(mgsl_integ, "qawo", rb_gsl_integration_qawo, -1);
|
1158
1138
|
rb_define_module_function(mgsl_integ, "qawf", rb_gsl_integration_qawf, -1);
|
1159
1139
|
|
1160
|
-
#ifdef GSL_1_14_LATER
|
1161
1140
|
cgsl_integration_glfixed_table = rb_define_class_under(mgsl_integ, "Glfixed_table", cGSL_Object);
|
1162
1141
|
rb_define_singleton_method(cgsl_integration_glfixed_table, "alloc",
|
1163
|
-
|
1142
|
+
rb_gsl_integration_glfixed_table_alloc, 1);
|
1164
1143
|
rb_define_method(cgsl_function, "glfixed", rb_gsl_integration_glfixed, 3);
|
1165
|
-
#endif
|
1166
|
-
|
1167
1144
|
}
|
1168
1145
|
|
1169
1146
|
#undef EPSABS_DEFAULT
|