gsl 1.15.3 → 1.16.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +12 -0
- data/.travis.yml +24 -0
- data/AUTHORS +10 -2
- data/COPYING +341 -339
- data/ChangeLog +612 -554
- data/Gemfile +4 -0
- data/README.md +77 -0
- data/Rakefile +14 -93
- 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/{alf.c → gsl_native/alf.c} +10 -10
- data/ext/{array.c → gsl_native/array.c} +70 -159
- data/ext/{array_complex.c → gsl_native/array_complex.c} +63 -66
- data/ext/{blas.c → gsl_native/blas.c} +2 -3
- data/ext/{blas1.c → gsl_native/blas1.c} +35 -36
- data/ext/{blas2.c → gsl_native/blas2.c} +57 -62
- data/ext/{blas3.c → gsl_native/blas3.c} +57 -58
- data/ext/{block.c → gsl_native/block.c} +14 -18
- data/ext/{block_source.c → gsl_native/block_source.h} +110 -112
- data/ext/gsl_native/bspline.c +122 -0
- data/ext/{bundle.c → gsl_native/bundle.c} +0 -0
- data/ext/{cdf.c → gsl_native/cdf.c} +79 -93
- data/ext/{cheb.c → gsl_native/cheb.c} +78 -89
- data/ext/{combination.c → gsl_native/combination.c} +11 -19
- data/ext/{common.c → gsl_native/common.c} +9 -41
- data/ext/{complex.c → gsl_native/complex.c} +116 -118
- data/ext/gsl_native/const.c +331 -0
- data/ext/{const_additional.c → gsl_native/const_additional.c} +13 -34
- data/ext/gsl_native/cqp.c +283 -0
- data/ext/{deriv.c → gsl_native/deriv.c} +25 -33
- data/ext/{dht.c → gsl_native/dht.c} +23 -31
- data/ext/{diff.c → gsl_native/diff.c} +26 -28
- data/ext/{dirac.c → gsl_native/dirac.c} +45 -46
- data/ext/{eigen.c → gsl_native/eigen.c} +1044 -1095
- data/ext/{error.c → gsl_native/error.c} +18 -18
- data/ext/gsl_native/extconf.rb +118 -0
- data/ext/{fft.c → gsl_native/fft.c} +197 -204
- data/ext/{fit.c → gsl_native/fit.c} +17 -18
- data/ext/gsl_native/fresnel.c +312 -0
- data/ext/{function.c → gsl_native/function.c} +37 -43
- data/ext/{geometry.c → gsl_native/geometry.c} +16 -16
- data/ext/{graph.c → gsl_native/graph.c} +39 -89
- data/ext/{gsl.c → gsl_native/gsl.c} +12 -33
- data/ext/{gsl_narray.c → gsl_native/gsl_narray.c} +20 -30
- data/ext/{histogram.c → gsl_native/histogram.c} +133 -160
- data/ext/{histogram2d.c → gsl_native/histogram2d.c} +78 -104
- data/ext/{histogram3d.c → gsl_native/histogram3d.c} +76 -76
- data/ext/{histogram3d_source.c → gsl_native/histogram3d_source.c} +196 -197
- data/ext/{histogram_find.c → gsl_native/histogram_find.c} +32 -34
- data/ext/{histogram_oper.c → gsl_native/histogram_oper.c} +43 -52
- data/ext/{ieee.c → gsl_native/ieee.c} +9 -21
- data/{include → ext/gsl_native/include}/rb_gsl.h +4 -26
- data/{include → ext/gsl_native/include}/rb_gsl_array.h +15 -39
- data/{include → ext/gsl_native/include}/rb_gsl_cheb.h +0 -2
- data/{include → ext/gsl_native/include}/rb_gsl_common.h +61 -61
- data/{include → ext/gsl_native/include}/rb_gsl_complex.h +1 -1
- data/{include → ext/gsl_native/include}/rb_gsl_const.h +0 -6
- data/ext/gsl_native/include/rb_gsl_dirac.h +6 -0
- data/{include → ext/gsl_native/include}/rb_gsl_eigen.h +1 -1
- data/{include → ext/gsl_native/include}/rb_gsl_fft.h +0 -13
- data/{include → ext/gsl_native/include}/rb_gsl_fit.h +0 -2
- data/{include → ext/gsl_native/include}/rb_gsl_function.h +0 -4
- data/{include → ext/gsl_native/include}/rb_gsl_graph.h +2 -4
- data/{include → ext/gsl_native/include}/rb_gsl_histogram.h +8 -8
- data/{include → ext/gsl_native/include}/rb_gsl_histogram3d.h +50 -50
- data/{include → ext/gsl_native/include}/rb_gsl_integration.h +1 -1
- data/{include → ext/gsl_native/include}/rb_gsl_interp.h +0 -5
- data/{include → ext/gsl_native/include}/rb_gsl_linalg.h +2 -6
- data/{include → ext/gsl_native/include}/rb_gsl_math.h +0 -6
- data/{include → ext/gsl_native/include}/rb_gsl_odeiv.h +0 -3
- data/{include → ext/gsl_native/include}/rb_gsl_poly.h +3 -7
- data/{include → ext/gsl_native/include}/rb_gsl_rational.h +1 -8
- data/{include → ext/gsl_native/include}/rb_gsl_rng.h +0 -1
- data/{include → ext/gsl_native/include}/rb_gsl_root.h +1 -1
- data/{include → ext/gsl_native/include}/rb_gsl_sf.h +39 -48
- data/{include → ext/gsl_native/include}/rb_gsl_statistics.h +1 -1
- data/{include → ext/gsl_native/include}/rb_gsl_tensor.h +0 -2
- data/{include → ext/gsl_native/include}/rb_gsl_with_narray.h +3 -1
- data/{include → ext/gsl_native/include}/templates_off.h +0 -0
- data/{include → ext/gsl_native/include}/templates_on.h +1 -1
- data/ext/{integration.c → gsl_native/integration.c} +164 -189
- data/ext/{interp.c → gsl_native/interp.c} +25 -38
- data/ext/gsl_native/jacobi.c +733 -0
- data/ext/{linalg.c → gsl_native/linalg.c} +462 -589
- data/ext/{linalg_complex.c → gsl_native/linalg_complex.c} +93 -106
- data/ext/{math.c → gsl_native/math.c} +48 -67
- data/ext/{matrix.c → gsl_native/matrix.c} +13 -16
- data/ext/{matrix_complex.c → gsl_native/matrix_complex.c} +119 -123
- data/ext/{matrix_double.c → gsl_native/matrix_double.c} +79 -82
- data/ext/{matrix_int.c → gsl_native/matrix_int.c} +53 -54
- data/ext/{matrix_source.c → gsl_native/matrix_source.h} +292 -318
- data/ext/{min.c → gsl_native/min.c} +45 -76
- data/ext/{monte.c → gsl_native/monte.c} +50 -64
- data/ext/{multifit.c → gsl_native/multifit.c} +142 -151
- data/ext/{multimin.c → gsl_native/multimin.c} +64 -92
- data/ext/{multimin_fsdf.c → gsl_native/multimin_fsdf.c} +16 -16
- data/ext/{multiroots.c → gsl_native/multiroots.c} +73 -76
- data/ext/{multiset.c → gsl_native/multiset.c} +4 -8
- data/ext/{ndlinear.c → gsl_native/ndlinear.c} +320 -321
- data/ext/{nmf.c → gsl_native/nmf.c} +11 -11
- data/ext/{nmf_wrap.c → gsl_native/nmf_wrap.c} +1 -1
- data/ext/{ntuple.c → gsl_native/ntuple.c} +23 -23
- data/ext/{odeiv.c → gsl_native/odeiv.c} +101 -116
- data/ext/gsl_native/ool.c +879 -0
- data/ext/{permutation.c → gsl_native/permutation.c} +39 -37
- data/ext/{poly.c → gsl_native/poly.c} +10 -13
- data/ext/{poly2.c → gsl_native/poly2.c} +16 -16
- data/ext/{poly_source.c → gsl_native/poly_source.h} +249 -293
- data/ext/{qrng.c → gsl_native/qrng.c} +9 -20
- data/ext/{randist.c → gsl_native/randist.c} +222 -247
- data/ext/{rational.c → gsl_native/rational.c} +12 -12
- data/ext/{rng.c → gsl_native/rng.c} +30 -47
- data/ext/{root.c → gsl_native/root.c} +47 -48
- data/ext/{sf.c → gsl_native/sf.c} +196 -244
- data/ext/{sf_airy.c → gsl_native/sf_airy.c} +2 -2
- data/ext/{sf_bessel.c → gsl_native/sf_bessel.c} +7 -7
- data/ext/{sf_clausen.c → gsl_native/sf_clausen.c} +1 -1
- data/ext/{sf_coulomb.c → gsl_native/sf_coulomb.c} +40 -40
- data/ext/{sf_coupling.c → gsl_native/sf_coupling.c} +30 -30
- data/ext/{sf_dawson.c → gsl_native/sf_dawson.c} +1 -1
- data/ext/{sf_debye.c → gsl_native/sf_debye.c} +1 -10
- data/ext/{sf_dilog.c → gsl_native/sf_dilog.c} +1 -1
- data/ext/{sf_elementary.c → gsl_native/sf_elementary.c} +3 -3
- data/ext/{sf_ellint.c → gsl_native/sf_ellint.c} +43 -43
- data/ext/{sf_elljac.c → gsl_native/sf_elljac.c} +3 -3
- data/ext/{sf_erfc.c → gsl_native/sf_erfc.c} +1 -5
- data/ext/{sf_exp.c → gsl_native/sf_exp.c} +3 -3
- data/ext/{sf_expint.c → gsl_native/sf_expint.c} +2 -12
- data/ext/{sf_fermi_dirac.c → gsl_native/sf_fermi_dirac.c} +1 -1
- data/ext/{sf_gamma.c → gsl_native/sf_gamma.c} +2 -6
- data/ext/{sf_gegenbauer.c → gsl_native/sf_gegenbauer.c} +1 -1
- data/ext/{sf_hyperg.c → gsl_native/sf_hyperg.c} +1 -1
- data/ext/{sf_laguerre.c → gsl_native/sf_laguerre.c} +4 -4
- data/ext/{sf_lambert.c → gsl_native/sf_lambert.c} +1 -1
- data/ext/{sf_legendre.c → gsl_native/sf_legendre.c} +1 -1
- data/ext/{sf_log.c → gsl_native/sf_log.c} +4 -4
- data/ext/gsl_native/sf_mathieu.c +235 -0
- data/ext/{sf_power.c → gsl_native/sf_power.c} +1 -1
- data/ext/{sf_psi.c → gsl_native/sf_psi.c} +3 -12
- data/ext/{sf_synchrotron.c → gsl_native/sf_synchrotron.c} +1 -1
- data/ext/{sf_transport.c → gsl_native/sf_transport.c} +1 -1
- data/ext/{sf_trigonometric.c → gsl_native/sf_trigonometric.c} +4 -4
- data/ext/{sf_zeta.c → gsl_native/sf_zeta.c} +1 -5
- data/ext/{signal.c → gsl_native/signal.c} +63 -68
- data/ext/{siman.c → gsl_native/siman.c} +45 -49
- data/ext/{sort.c → gsl_native/sort.c} +6 -7
- data/ext/{spline.c → gsl_native/spline.c} +28 -46
- data/ext/{stats.c → gsl_native/stats.c} +105 -118
- data/ext/{sum.c → gsl_native/sum.c} +34 -34
- data/ext/{tamu_anova.c → gsl_native/tamu_anova.c} +1 -1
- data/ext/{tensor.c → gsl_native/tensor.c} +8 -11
- data/ext/{tensor_source.c → gsl_native/tensor_source.h} +147 -148
- data/ext/{vector.c → gsl_native/vector.c} +11 -14
- data/ext/{vector_complex.c → gsl_native/vector_complex.c} +179 -184
- data/ext/{vector_double.c → gsl_native/vector_double.c} +178 -183
- data/ext/{vector_int.c → gsl_native/vector_int.c} +27 -29
- data/ext/{vector_source.c → gsl_native/vector_source.h} +428 -443
- data/ext/{wavelet.c → gsl_native/wavelet.c} +224 -246
- data/gsl.gemspec +29 -0
- data/lib/gsl.rb +8 -3
- data/lib/gsl/gnuplot.rb +3 -3
- data/lib/gsl/oper.rb +35 -60
- data/lib/gsl/version.rb +3 -0
- data/lib/rbgsl.rb +1 -3
- data/rdoc/alf.rdoc +5 -5
- data/rdoc/blas.rdoc +9 -9
- data/rdoc/bspline.rdoc +17 -17
- data/rdoc/changes.rdoc +4 -9
- data/rdoc/cheb.rdoc +25 -25
- data/rdoc/cholesky_complex.rdoc +21 -21
- data/rdoc/combi.rdoc +37 -37
- data/rdoc/complex.rdoc +22 -22
- data/rdoc/const.rdoc +47 -47
- data/rdoc/dht.rdoc +49 -49
- data/rdoc/diff.rdoc +42 -42
- data/rdoc/ehandling.rdoc +6 -6
- data/rdoc/eigen.rdoc +153 -153
- data/rdoc/fft.rdoc +146 -146
- data/rdoc/fit.rdoc +109 -109
- data/rdoc/function.rdoc +11 -11
- data/rdoc/graph.rdoc +17 -17
- data/rdoc/hist.rdoc +103 -103
- data/rdoc/hist2d.rdoc +42 -42
- data/rdoc/hist3d.rdoc +9 -9
- data/rdoc/integration.rdoc +110 -110
- data/rdoc/interp.rdoc +71 -71
- data/rdoc/intro.rdoc +8 -8
- data/rdoc/linalg.rdoc +188 -188
- data/rdoc/linalg_complex.rdoc +1 -1
- data/rdoc/math.rdoc +58 -58
- data/rdoc/matrix.rdoc +275 -275
- data/rdoc/min.rdoc +57 -57
- data/rdoc/monte.rdoc +22 -22
- data/rdoc/multimin.rdoc +95 -95
- data/rdoc/multiroot.rdoc +80 -80
- data/rdoc/narray.rdoc +32 -32
- data/rdoc/ndlinear.rdoc +54 -54
- data/rdoc/nonlinearfit.rdoc +100 -100
- data/rdoc/ntuple.rdoc +31 -31
- data/rdoc/odeiv.rdoc +88 -88
- data/rdoc/perm.rdoc +90 -90
- data/rdoc/poly.rdoc +66 -66
- data/rdoc/qrng.rdoc +21 -21
- data/rdoc/randist.rdoc +82 -82
- data/rdoc/ref.rdoc +57 -57
- data/rdoc/rng.rdoc +85 -85
- data/rdoc/roots.rdoc +57 -57
- data/rdoc/sf.rdoc +428 -428
- data/rdoc/siman.rdoc +19 -19
- data/rdoc/sort.rdoc +30 -30
- data/rdoc/start.rdoc +8 -8
- data/rdoc/stats.rdoc +52 -52
- data/rdoc/sum.rdoc +12 -12
- data/rdoc/tensor.rdoc +31 -31
- data/rdoc/tut.rdoc +1 -1
- data/rdoc/use.rdoc +39 -39
- data/rdoc/vector.rdoc +188 -188
- data/rdoc/vector_complex.rdoc +24 -24
- data/rdoc/wavelet.rdoc +46 -46
- 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/index_test.rb +61 -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 +98 -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/oper_test.rb +98 -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
- data/uncrustify.cfg +1693 -0
- metadata +337 -378
- data/README +0 -32
- data/VERSION +0 -1
- data/ext/bspline.c +0 -130
- data/ext/const.c +0 -673
- data/ext/cqp.c +0 -283
- data/ext/extconf.rb +0 -295
- data/ext/fcmp.c +0 -66
- data/ext/fresnel.c +0 -312
- data/ext/jacobi.c +0 -739
- data/ext/ool.c +0 -879
- data/ext/oper_complex_source.c +0 -253
- data/ext/sf_mathieu.c +0 -238
- data/include/rb_gsl_config.h +0 -62
- data/include/rb_gsl_dirac.h +0 -13
- data/rdoc/index.rdoc +0 -62
- data/rdoc/rngextra.rdoc +0 -11
- data/rdoc/screenshot.rdoc +0 -40
- 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
@@ -9,18 +9,16 @@
|
|
9
9
|
WITHOUT ANY WARRANTY.
|
10
10
|
*/
|
11
11
|
|
12
|
-
#include "
|
13
|
-
|
14
|
-
#include "
|
15
|
-
#include "
|
16
|
-
#include "rb_gsl_integration.h"
|
17
|
-
#include "rb_gsl_common.h"
|
12
|
+
#include "include/rb_gsl_array.h"
|
13
|
+
#include "include/rb_gsl_function.h"
|
14
|
+
#include "include/rb_gsl_integration.h"
|
15
|
+
#include "include/rb_gsl_common.h"
|
18
16
|
|
19
17
|
#ifndef CHECK_WORKSPACE
|
20
|
-
#define CHECK_WORKSPACE(x) if(CLASS_OF(x)!=cgsl_integration_workspace)\
|
21
|
-
|
22
|
-
|
23
|
-
|
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)));
|
24
22
|
#endif
|
25
23
|
|
26
24
|
#define EPSABS_DEFAULT 0.0
|
@@ -32,26 +30,24 @@ static VALUE cgsl_integration_qaws_table, cgsl_integration_qawo_table;
|
|
32
30
|
|
33
31
|
static VALUE cgsl_integration_workspace;
|
34
32
|
|
35
|
-
#ifdef GSL_1_14_LATER
|
36
33
|
static VALUE cgsl_integration_glfixed_table;
|
37
|
-
#endif
|
38
34
|
|
39
35
|
static int get_a_b(int argc, VALUE *argv, int argstart, double *a, double *b);
|
40
|
-
static int get_epsabs_epsrel(int argc, VALUE *argv, int argstart,
|
41
|
-
|
36
|
+
static int get_epsabs_epsrel(int argc, VALUE *argv, int argstart,
|
37
|
+
double *epsabs, double *epsrel);
|
42
38
|
static int get_a_b_epsabs_epsrel(int argc, VALUE *argv, int argstart,
|
43
|
-
|
44
|
-
|
39
|
+
double *a, double *b, double *epsabs,
|
40
|
+
double *epsrel);
|
45
41
|
static int get_limit_key_workspace(int argc, VALUE *argv, int argstart,
|
46
|
-
|
47
|
-
|
42
|
+
size_t *limit, int *key,
|
43
|
+
gsl_integration_workspace **w);
|
48
44
|
static int get_limit_workspace(int argc, VALUE *argv, int argstart,
|
49
|
-
|
50
|
-
|
45
|
+
size_t *limit,
|
46
|
+
gsl_integration_workspace **w);
|
51
47
|
static int get_epsabs_epsrel_limit_workspace(int argc, VALUE *argv, int argstart,
|
52
|
-
|
53
|
-
|
54
|
-
|
48
|
+
double *epsabs, double *epsrel,
|
49
|
+
size_t *limit,
|
50
|
+
gsl_integration_workspace **w);
|
55
51
|
|
56
52
|
static int get_a_b(int argc, VALUE *argv, int argstart, double *a, double *b)
|
57
53
|
{
|
@@ -76,8 +72,8 @@ static int get_a_b(int argc, VALUE *argv, int argstart, double *a, double *b)
|
|
76
72
|
return itmp;
|
77
73
|
}
|
78
74
|
|
79
|
-
static int get_epsabs_epsrel(int argc, VALUE *argv, int argstart,
|
80
|
-
|
75
|
+
static int get_epsabs_epsrel(int argc, VALUE *argv, int argstart,
|
76
|
+
double *epsabs, double *epsrel)
|
81
77
|
{
|
82
78
|
int itmp;
|
83
79
|
VALUE aa, bb;
|
@@ -96,13 +92,13 @@ static int get_epsabs_epsrel(int argc, VALUE *argv, int argstart,
|
|
96
92
|
*epsabs = NUM2DBL(argv[argstart]);
|
97
93
|
*epsrel = NUM2DBL(argv[argstart+1]);
|
98
94
|
itmp = 2;
|
99
|
-
}
|
100
|
-
return
|
95
|
+
}
|
96
|
+
return argstart + itmp;
|
101
97
|
}
|
102
98
|
|
103
99
|
static int get_a_b_epsabs_epsrel(int argc, VALUE *argv, int argstart,
|
104
|
-
|
105
|
-
|
100
|
+
double *a, double *b, double *epsabs,
|
101
|
+
double *epsrel)
|
106
102
|
{
|
107
103
|
int itmp;
|
108
104
|
*epsabs = EPSABS_DEFAULT;
|
@@ -113,8 +109,8 @@ static int get_a_b_epsabs_epsrel(int argc, VALUE *argv, int argstart,
|
|
113
109
|
}
|
114
110
|
|
115
111
|
static int get_limit_key_workspace(int argc, VALUE *argv, int argstart,
|
116
|
-
|
117
|
-
|
112
|
+
size_t *limit, int *key,
|
113
|
+
gsl_integration_workspace **w)
|
118
114
|
{
|
119
115
|
int flag = 0;
|
120
116
|
switch (argc-argstart) {
|
@@ -165,8 +161,8 @@ static int get_limit_key_workspace(int argc, VALUE *argv, int argstart,
|
|
165
161
|
}
|
166
162
|
|
167
163
|
static int get_limit_workspace(int argc, VALUE *argv, int argstart,
|
168
|
-
|
169
|
-
|
164
|
+
size_t *limit,
|
165
|
+
gsl_integration_workspace **w)
|
170
166
|
{
|
171
167
|
int flag = 0;
|
172
168
|
|
@@ -209,9 +205,9 @@ static int get_limit_workspace(int argc, VALUE *argv, int argstart,
|
|
209
205
|
}
|
210
206
|
|
211
207
|
static int get_epsabs_epsrel_limit_workspace(int argc, VALUE *argv, int argstart,
|
212
|
-
|
213
|
-
|
214
|
-
|
208
|
+
double *epsabs, double *epsrel,
|
209
|
+
size_t *limit,
|
210
|
+
gsl_integration_workspace **w)
|
215
211
|
{
|
216
212
|
int flag = 0, itmp;
|
217
213
|
itmp = argstart;
|
@@ -271,9 +267,8 @@ static VALUE rb_gsl_integration_qng(int argc, VALUE *argv, VALUE obj)
|
|
271
267
|
// local variable 'itmp' declared and set, but never used
|
272
268
|
//int itmp;
|
273
269
|
|
274
|
-
if (argc < 1) rb_raise(rb_eArgError,
|
275
|
-
|
276
|
-
|
270
|
+
if (argc < 1) rb_raise(rb_eArgError,
|
271
|
+
"wrong number of arguments (%d for >= 1)", argc);
|
277
272
|
switch (TYPE(obj)) {
|
278
273
|
case T_MODULE: case T_CLASS: case T_OBJECT:
|
279
274
|
CHECK_FUNCTION(argv[0]);
|
@@ -285,12 +280,12 @@ static VALUE rb_gsl_integration_qng(int argc, VALUE *argv, VALUE obj)
|
|
285
280
|
Data_Get_Struct(obj, gsl_function, F);
|
286
281
|
break;
|
287
282
|
}
|
288
|
-
status = gsl_integration_qng(F, a, b, epsabs, epsrel,
|
289
|
-
|
290
|
-
|
283
|
+
status = gsl_integration_qng(F, a, b, epsabs, epsrel,
|
284
|
+
&result, &abserr, &neval);
|
285
|
+
|
291
286
|
return rb_ary_new3(4, rb_float_new(result), rb_float_new(abserr),
|
292
|
-
|
293
|
-
}
|
287
|
+
INT2FIX(neval), INT2FIX(status));
|
288
|
+
}
|
294
289
|
|
295
290
|
static VALUE rb_gsl_integration_qag(int argc, VALUE *argv, VALUE obj)
|
296
291
|
{
|
@@ -300,9 +295,8 @@ static VALUE rb_gsl_integration_qag(int argc, VALUE *argv, VALUE obj)
|
|
300
295
|
gsl_function *F = NULL;
|
301
296
|
gsl_integration_workspace *w = NULL;
|
302
297
|
int key = KEY_DEFAULT, status, intervals, itmp, flag = 0;
|
303
|
-
if (argc < 1) rb_raise(rb_eArgError,
|
304
|
-
|
305
|
-
|
298
|
+
if (argc < 1) rb_raise(rb_eArgError,
|
299
|
+
"wrong number of arguments (%d for >= 1)", argc);
|
306
300
|
switch (TYPE(obj)) {
|
307
301
|
case T_MODULE: case T_CLASS: case T_OBJECT:
|
308
302
|
CHECK_FUNCTION(argv[0]);
|
@@ -327,26 +321,26 @@ static VALUE rb_gsl_integration_qag(int argc, VALUE *argv, VALUE obj)
|
|
327
321
|
default:
|
328
322
|
if (argc == 2) {
|
329
323
|
if (FIXNUM_P(argv[1])) {
|
330
|
-
|
331
|
-
|
332
|
-
|
324
|
+
key = FIX2INT(argv[1]);
|
325
|
+
w = gsl_integration_workspace_alloc(limit);
|
326
|
+
flag = 1;
|
333
327
|
} else if (rb_obj_is_kind_of(argv[1], cgsl_integration_workspace)) {
|
334
|
-
|
335
|
-
|
328
|
+
Data_Get_Struct(argv[1], gsl_integration_workspace, w);
|
329
|
+
flag = 0;
|
336
330
|
} else {
|
337
|
-
|
331
|
+
rb_raise(rb_eTypeError, "Key or Workspace expected");
|
338
332
|
}
|
339
333
|
itmp = get_a_b(argc, argv, 0, &a, &b);
|
340
334
|
} else if (argc == 3) {
|
341
335
|
if (FIXNUM_P(argv[2])) {
|
342
|
-
|
343
|
-
|
344
|
-
|
336
|
+
key = FIX2INT(argv[2]);
|
337
|
+
w = gsl_integration_workspace_alloc(limit);
|
338
|
+
flag = 1;
|
345
339
|
} else if (rb_obj_is_kind_of(argv[2], cgsl_integration_workspace)) {
|
346
|
-
|
347
|
-
|
340
|
+
Data_Get_Struct(argv[2], gsl_integration_workspace, w);
|
341
|
+
flag = 0;
|
348
342
|
} else {
|
349
|
-
|
343
|
+
rb_raise(rb_eTypeError, "Key or Workspace expected");
|
350
344
|
}
|
351
345
|
itmp = get_a_b(argc, argv, 0, &a, &b);
|
352
346
|
} else {
|
@@ -356,14 +350,13 @@ static VALUE rb_gsl_integration_qag(int argc, VALUE *argv, VALUE obj)
|
|
356
350
|
Data_Get_Struct(obj, gsl_function, F);
|
357
351
|
break;
|
358
352
|
}
|
359
|
-
status = gsl_integration_qag(F, a, b, epsabs, epsrel, limit, key, w,
|
360
|
-
|
353
|
+
status = gsl_integration_qag(F, a, b, epsabs, epsrel, limit, key, w,
|
354
|
+
&result, &abserr);
|
361
355
|
intervals = w->size;
|
362
356
|
if (flag == 1) gsl_integration_workspace_free(w);
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
}
|
357
|
+
return rb_ary_new3(4, rb_float_new(result), rb_float_new(abserr),
|
358
|
+
INT2FIX(intervals), INT2FIX(status));
|
359
|
+
}
|
367
360
|
|
368
361
|
static VALUE rb_gsl_integration_qags(int argc, VALUE *argv, VALUE obj)
|
369
362
|
{
|
@@ -385,16 +378,15 @@ static VALUE rb_gsl_integration_qags(int argc, VALUE *argv, VALUE obj)
|
|
385
378
|
break;
|
386
379
|
}
|
387
380
|
flag = get_epsabs_epsrel_limit_workspace(argc, argv, itmp, &epsabs, &epsrel,
|
388
|
-
|
389
|
-
|
390
|
-
status = gsl_integration_qags(F, a, b, epsabs, epsrel, limit, w,
|
391
|
-
|
381
|
+
&limit, &w);
|
382
|
+
|
383
|
+
status = gsl_integration_qags(F, a, b, epsabs, epsrel, limit, w,
|
384
|
+
&result, &abserr);
|
392
385
|
intervals = w->size;
|
393
386
|
if (flag == 1) gsl_integration_workspace_free(w);
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
}
|
387
|
+
return rb_ary_new3(4, rb_float_new(result), rb_float_new(abserr),
|
388
|
+
INT2FIX(intervals), INT2FIX(status));
|
389
|
+
}
|
398
390
|
|
399
391
|
static VALUE rb_gsl_integration_qagp(int argc, VALUE *argv, VALUE obj)
|
400
392
|
{
|
@@ -425,17 +417,16 @@ static VALUE rb_gsl_integration_qagp(int argc, VALUE *argv, VALUE obj)
|
|
425
417
|
}
|
426
418
|
itmp += 1;
|
427
419
|
flag = get_epsabs_epsrel_limit_workspace(argc, argv, itmp, &epsabs, &epsrel,
|
428
|
-
|
420
|
+
&limit, &w);
|
429
421
|
|
430
|
-
status = gsl_integration_qagp(F, v->data, v->size, epsabs, epsrel, limit, w,
|
431
|
-
|
422
|
+
status = gsl_integration_qagp(F, v->data, v->size, epsabs, epsrel, limit, w,
|
423
|
+
&result, &abserr);
|
432
424
|
intervals = w->size;
|
433
425
|
if (flag == 1) gsl_integration_workspace_free(w);
|
434
426
|
if (flag2 == 1) gsl_vector_free(v);
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
}
|
427
|
+
return rb_ary_new3(4, rb_float_new(result), rb_float_new(abserr),
|
428
|
+
INT2FIX(intervals), INT2FIX(status));
|
429
|
+
}
|
439
430
|
|
440
431
|
/* (-infty --- +infty) */
|
441
432
|
static VALUE rb_gsl_integration_qagi(int argc, VALUE *argv, VALUE obj)
|
@@ -458,15 +449,14 @@ static VALUE rb_gsl_integration_qagi(int argc, VALUE *argv, VALUE obj)
|
|
458
449
|
break;
|
459
450
|
}
|
460
451
|
flag = get_epsabs_epsrel_limit_workspace(argc, argv, itmp, &epsabs, &epsrel,
|
461
|
-
|
462
|
-
status = gsl_integration_qagi(F, epsabs, epsrel, limit, w,
|
463
|
-
|
452
|
+
&limit, &w);
|
453
|
+
status = gsl_integration_qagi(F, epsabs, epsrel, limit, w,
|
454
|
+
&result, &abserr);
|
464
455
|
intervals = w->size;
|
465
456
|
if (flag == 1) gsl_integration_workspace_free(w);
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
}
|
457
|
+
return rb_ary_new3(4, rb_float_new(result), rb_float_new(abserr),
|
458
|
+
INT2FIX(intervals), INT2FIX(status));
|
459
|
+
}
|
470
460
|
|
471
461
|
/* (a --- +infty) */
|
472
462
|
static VALUE rb_gsl_integration_qagiu(int argc, VALUE *argv, VALUE obj)
|
@@ -492,15 +482,14 @@ static VALUE rb_gsl_integration_qagiu(int argc, VALUE *argv, VALUE obj)
|
|
492
482
|
a = NUM2DBL(argv[itmp]);
|
493
483
|
itmp += 1;
|
494
484
|
flag = get_epsabs_epsrel_limit_workspace(argc, argv, itmp, &epsabs, &epsrel,
|
495
|
-
|
496
|
-
status = gsl_integration_qagiu(F, a, epsabs, epsrel, limit, w,
|
497
|
-
|
485
|
+
&limit, &w);
|
486
|
+
status = gsl_integration_qagiu(F, a, epsabs, epsrel, limit, w,
|
487
|
+
&result, &abserr);
|
498
488
|
intervals = w->size;
|
499
489
|
if (flag == 1) gsl_integration_workspace_free(w);
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
}
|
490
|
+
return rb_ary_new3(4, rb_float_new(result), rb_float_new(abserr),
|
491
|
+
INT2FIX(intervals), INT2FIX(status));
|
492
|
+
}
|
504
493
|
|
505
494
|
/* (-infty --- b) */
|
506
495
|
static VALUE rb_gsl_integration_qagil(int argc, VALUE *argv, VALUE obj)
|
@@ -525,17 +514,16 @@ static VALUE rb_gsl_integration_qagil(int argc, VALUE *argv, VALUE obj)
|
|
525
514
|
Need_Float(argv[itmp]);
|
526
515
|
b = NUM2DBL(argv[itmp]);
|
527
516
|
flag = get_epsabs_epsrel_limit_workspace(argc, argv, itmp+1, &epsabs, &epsrel,
|
528
|
-
|
517
|
+
&limit, &w);
|
529
518
|
Data_Get_Struct(obj, gsl_function, F);
|
530
519
|
|
531
|
-
status = gsl_integration_qagil(F, b, epsabs, epsrel, limit, w,
|
532
|
-
|
520
|
+
status = gsl_integration_qagil(F, b, epsabs, epsrel, limit, w,
|
521
|
+
&result, &abserr);
|
533
522
|
intervals = w->size;
|
534
523
|
if (flag == 1) gsl_integration_workspace_free(w);
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
}
|
524
|
+
return rb_ary_new3(4, rb_float_new(result), rb_float_new(abserr),
|
525
|
+
INT2FIX(intervals), INT2FIX(status));
|
526
|
+
}
|
539
527
|
|
540
528
|
static VALUE rb_gsl_integration_qawc(int argc, VALUE *argv, VALUE obj)
|
541
529
|
{
|
@@ -561,14 +549,13 @@ static VALUE rb_gsl_integration_qawc(int argc, VALUE *argv, VALUE obj)
|
|
561
549
|
Need_Float(argv[itmp]);
|
562
550
|
c = NUM2DBL(argv[itmp]);
|
563
551
|
flag = get_epsabs_epsrel_limit_workspace(argc, argv, itmp+1, &epsabs, &epsrel,
|
564
|
-
|
552
|
+
&limit, &w);
|
565
553
|
status = gsl_integration_qawc(F, a, b, c, epsabs, epsrel, limit, w, &result, &abserr);
|
566
554
|
intervals = w->size;
|
567
555
|
if (flag == 1) gsl_integration_workspace_free(w);
|
568
|
-
|
569
556
|
return rb_ary_new3(4, rb_float_new(result), rb_float_new(abserr), INT2FIX(intervals),
|
570
|
-
|
571
|
-
}
|
557
|
+
INT2FIX(status));
|
558
|
+
}
|
572
559
|
|
573
560
|
VALUE rb_gsl_integration_qaws_table_alloc(int argc, VALUE *argv, VALUE klass)
|
574
561
|
{
|
@@ -589,7 +576,7 @@ VALUE rb_gsl_integration_qaws_table_alloc(int argc, VALUE *argv, VALUE klass)
|
|
589
576
|
nu = argv[3];
|
590
577
|
}
|
591
578
|
t = gsl_integration_qaws_table_alloc(NUM2DBL(alpha), NUM2DBL(beta),
|
592
|
-
|
579
|
+
FIX2INT(mu), FIX2INT(nu));
|
593
580
|
return Data_Wrap_Struct(klass, 0, gsl_integration_qaws_table_free, t);
|
594
581
|
}
|
595
582
|
|
@@ -616,7 +603,6 @@ static VALUE rb_gsl_integration_qaws_table_set(int argc, VALUE *argv, VALUE obj)
|
|
616
603
|
} else {
|
617
604
|
rb_raise(rb_eTypeError, "wrong argument type %s", rb_class2name(CLASS_OF(argv[0])));
|
618
605
|
}
|
619
|
-
|
620
606
|
gsl_integration_qaws_table_set(t, alpha, beta, mu, nu);
|
621
607
|
return obj;
|
622
608
|
}
|
@@ -639,8 +625,8 @@ static VALUE rb_gsl_ary_to_integration_qaws_table(VALUE ary)
|
|
639
625
|
{
|
640
626
|
gsl_integration_qaws_table *t = NULL;
|
641
627
|
t = make_qaws_table(ary);
|
642
|
-
return Data_Wrap_Struct(cgsl_integration_qaws_table,
|
643
|
-
|
628
|
+
return Data_Wrap_Struct(cgsl_integration_qaws_table,
|
629
|
+
0, gsl_integration_qaws_table_free, t);
|
644
630
|
}
|
645
631
|
|
646
632
|
static gsl_integration_qaws_table* make_qaws_table(VALUE ary)
|
@@ -684,33 +670,30 @@ static VALUE rb_gsl_integration_qaws(int argc, VALUE *argv, VALUE obj)
|
|
684
670
|
} else {
|
685
671
|
flagt = 0;
|
686
672
|
if (!rb_obj_is_kind_of(argv[itmp], cgsl_integration_qaws_table))
|
687
|
-
|
688
|
-
|
673
|
+
rb_raise(rb_eTypeError, "Integration::QAWS_Table expected");
|
689
674
|
Data_Get_Struct(argv[itmp], gsl_integration_qaws_table, t);
|
690
675
|
}
|
691
676
|
flag = get_epsabs_epsrel_limit_workspace(argc, argv, itmp+1, &epsabs, &epsrel,
|
692
|
-
|
677
|
+
&limit, &w);
|
693
678
|
status = gsl_integration_qaws(F, a, b, t, epsabs, epsrel, limit, w, &result, &abserr);
|
694
679
|
intervals = w->size;
|
695
680
|
if (flag == 1) gsl_integration_workspace_free(w);
|
696
681
|
if (flagt == 1) gsl_integration_qaws_table_free(t);
|
697
|
-
|
698
682
|
return rb_ary_new3(4, rb_float_new(result), rb_float_new(abserr), INT2FIX(intervals),
|
699
|
-
|
700
|
-
}
|
683
|
+
INT2FIX(status));
|
684
|
+
}
|
701
685
|
|
702
686
|
static gsl_integration_qawo_table* make_qawo_table(VALUE ary);
|
703
687
|
|
704
688
|
static VALUE rb_gsl_integration_qawo_table_alloc(int argc, VALUE *argv,
|
705
|
-
|
689
|
+
VALUE klass)
|
706
690
|
{
|
707
691
|
gsl_integration_qawo_table *t = NULL;
|
708
692
|
double omega, L;
|
709
693
|
enum gsl_integration_qawo_enum sine;
|
710
694
|
size_t n;
|
711
|
-
if (argc != 1 && argc != 4)
|
695
|
+
if (argc != 1 && argc != 4)
|
712
696
|
rb_raise(rb_eArgError, "wrong nubmer of arguments (%d for 1 or 4)", argc);
|
713
|
-
|
714
697
|
if (TYPE(argv[0]) == T_ARRAY) {
|
715
698
|
omega = NUM2DBL(rb_ary_entry(argv[0], 0));
|
716
699
|
L = NUM2DBL(rb_ary_entry(argv[0], 1));
|
@@ -722,9 +705,8 @@ static VALUE rb_gsl_integration_qawo_table_alloc(int argc, VALUE *argv,
|
|
722
705
|
sine = FIX2INT(argv[2]);
|
723
706
|
n = FIX2INT(argv[3]);
|
724
707
|
}
|
725
|
-
|
726
708
|
t = gsl_integration_qawo_table_alloc(omega, L, sine, n);
|
727
|
-
|
709
|
+
|
728
710
|
return Data_Wrap_Struct(klass, 0, gsl_integration_qawo_table_free, t);
|
729
711
|
}
|
730
712
|
|
@@ -745,8 +727,8 @@ static VALUE rb_gsl_ary_to_integration_qawo_table(VALUE ary)
|
|
745
727
|
{
|
746
728
|
gsl_integration_qawo_table *t = NULL;
|
747
729
|
t = make_qawo_table(ary);
|
748
|
-
return Data_Wrap_Struct(cgsl_integration_qawo_table,
|
749
|
-
|
730
|
+
return Data_Wrap_Struct(cgsl_integration_qawo_table,
|
731
|
+
0, gsl_integration_qawo_table_free, t);
|
750
732
|
}
|
751
733
|
|
752
734
|
static gsl_integration_qawo_table* make_qawo_table(VALUE ary)
|
@@ -808,7 +790,7 @@ static VALUE rb_gsl_integration_qawo(int argc, VALUE *argv, VALUE obj)
|
|
808
790
|
int status, intervals, itmp, flag = 0, flagt = 0;
|
809
791
|
switch (TYPE(obj)) {
|
810
792
|
case T_MODULE: case T_CLASS: case T_OBJECT:
|
811
|
-
|
793
|
+
if (argc < 2) rb_raise(rb_eArgError, "too few arguments");
|
812
794
|
CHECK_FUNCTION(argv[0]);
|
813
795
|
Data_Get_Struct(argv[0], gsl_function, F);
|
814
796
|
itmp = 1;
|
@@ -823,18 +805,17 @@ static VALUE rb_gsl_integration_qawo(int argc, VALUE *argv, VALUE obj)
|
|
823
805
|
a = NUM2DBL(argv[itmp]);
|
824
806
|
flagt = get_qawo_table(argv[argc-1], &t);
|
825
807
|
flag = get_epsabs_epsrel_limit_workspace(argc-1, argv, itmp+1, &epsabs, &epsrel,
|
826
|
-
|
808
|
+
&limit, &w);
|
827
809
|
status = gsl_integration_qawo(F, a, epsabs, epsrel, limit, w, t, &result, &abserr);
|
828
810
|
intervals = w->size;
|
829
811
|
if (flag == 1) gsl_integration_workspace_free(w);
|
830
812
|
if (flagt == 1) gsl_integration_qawo_table_free(t);
|
831
|
-
|
832
813
|
return rb_ary_new3(4, rb_float_new(result), rb_float_new(abserr), INT2FIX(intervals),
|
833
|
-
|
834
|
-
}
|
814
|
+
INT2FIX(status));
|
815
|
+
}
|
835
816
|
|
836
817
|
static int get_qawo_table(VALUE tt,
|
837
|
-
|
818
|
+
gsl_integration_qawo_table **t)
|
838
819
|
{
|
839
820
|
int flagt;
|
840
821
|
|
@@ -881,7 +862,7 @@ static VALUE rb_gsl_integration_qawf(int argc, VALUE *argv, VALUE obj)
|
|
881
862
|
itmp += 1;
|
882
863
|
}
|
883
864
|
vtmp = argv + itmp;
|
884
|
-
flagt = get_qawo_table(argv[argc-1], &t);
|
865
|
+
flagt = get_qawo_table(argv[argc-1], &t);
|
885
866
|
|
886
867
|
switch (argc - 1 - itmp) {
|
887
868
|
case 0:
|
@@ -922,10 +903,9 @@ static VALUE rb_gsl_integration_qawf(int argc, VALUE *argv, VALUE obj)
|
|
922
903
|
gsl_integration_workspace_free(cw);
|
923
904
|
}
|
924
905
|
if (flagt == 1) gsl_integration_qawo_table_free(t);
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
}
|
906
|
+
return rb_ary_new3(4, rb_float_new(result), rb_float_new(abserr),
|
907
|
+
INT2FIX(intervals), INT2FIX(status));
|
908
|
+
}
|
929
909
|
|
930
910
|
|
931
911
|
static void rb_gsl_integration_define_symbols(VALUE module)
|
@@ -941,14 +921,14 @@ static void rb_gsl_integration_define_symbols(VALUE module)
|
|
941
921
|
}
|
942
922
|
|
943
923
|
static VALUE rb_gsl_integration_workspace_alloc(int argc, VALUE *argv,
|
944
|
-
|
924
|
+
VALUE klass)
|
945
925
|
{
|
946
926
|
size_t limit;
|
947
927
|
if (argc == 1) limit = FIX2INT(argv[0]);
|
948
928
|
else limit = LIMIT_DEFAULT;
|
949
|
-
return Data_Wrap_Struct(klass, 0,
|
950
|
-
|
951
|
-
|
929
|
+
return Data_Wrap_Struct(klass, 0,
|
930
|
+
gsl_integration_workspace_free,
|
931
|
+
gsl_integration_workspace_alloc(limit));
|
952
932
|
}
|
953
933
|
|
954
934
|
static VALUE rb_gsl_integration_workspace_limit(VALUE obj)
|
@@ -991,7 +971,7 @@ static VALUE rb_gsl_integration_workspace_to_a(VALUE obj)
|
|
991
971
|
gsl_integration_workspace *w = NULL;
|
992
972
|
Data_Get_Struct(obj, gsl_integration_workspace, w);
|
993
973
|
return rb_ary_new3(5, INT2FIX(w->limit), INT2FIX(w->size), INT2FIX(w->nrmax),
|
994
|
-
|
974
|
+
INT2FIX(w->i), INT2FIX(w->maximum_level));
|
995
975
|
}
|
996
976
|
|
997
977
|
static VALUE rb_gsl_integration_workspace_alist(VALUE obj)
|
@@ -1031,7 +1011,6 @@ static VALUE rb_gsl_integration_workspace_elist(VALUE obj)
|
|
1031
1011
|
return Data_Wrap_Struct(cgsl_vector_view_ro, 0, free, v);
|
1032
1012
|
}
|
1033
1013
|
|
1034
|
-
#ifdef GSL_1_14_LATER
|
1035
1014
|
static VALUE rb_gsl_integration_glfixed_table_alloc(VALUE klass, VALUE n)
|
1036
1015
|
{
|
1037
1016
|
gsl_integration_glfixed_table *t;
|
@@ -1047,7 +1026,7 @@ static VALUE rb_gsl_integration_glfixed(VALUE obj, VALUE aa, VALUE bb, VALUE tt)
|
|
1047
1026
|
double res;
|
1048
1027
|
if (!rb_obj_is_kind_of(tt, cgsl_integration_glfixed_table)) {
|
1049
1028
|
rb_raise(rb_eTypeError, "Wrong arugment type (%s for GSL::Integration::Glfixed_table)",
|
1050
|
-
|
1029
|
+
rb_class2name(CLASS_OF(tt)));
|
1051
1030
|
}
|
1052
1031
|
Data_Get_Struct(tt, gsl_integration_glfixed_table, t);
|
1053
1032
|
a = NUM2DBL(aa);
|
@@ -1056,7 +1035,6 @@ static VALUE rb_gsl_integration_glfixed(VALUE obj, VALUE aa, VALUE bb, VALUE tt)
|
|
1056
1035
|
res = gsl_integration_glfixed(f, a, b, t);
|
1057
1036
|
return rb_float_new(res);
|
1058
1037
|
}
|
1059
|
-
#endif
|
1060
1038
|
|
1061
1039
|
void Init_gsl_integration(VALUE module)
|
1062
1040
|
{
|
@@ -1082,69 +1060,69 @@ void Init_gsl_integration(VALUE module)
|
|
1082
1060
|
rb_define_alias(cgsl_function, "qagil", "integration_qagil");
|
1083
1061
|
rb_define_alias(cgsl_function, "qawc", "integration_qawc");
|
1084
1062
|
|
1085
|
-
cgsl_integration_qaws_table = rb_define_class_under(mgsl_integ, "QAWS_Table",
|
1086
|
-
|
1063
|
+
cgsl_integration_qaws_table = rb_define_class_under(mgsl_integ, "QAWS_Table",
|
1064
|
+
cGSL_Object);
|
1087
1065
|
rb_define_singleton_method(cgsl_integration_qaws_table, "alloc",
|
1088
|
-
|
1066
|
+
rb_gsl_integration_qaws_table_alloc, -1);
|
1089
1067
|
/* rb_define_singleton_method(cgsl_integration_qaws_table, "new",
|
1090
1068
|
rb_gsl_integration_qaws_table_alloc, -1);*/
|
1091
|
-
rb_define_method(cgsl_integration_qaws_table, "to_a",
|
1092
|
-
|
1093
|
-
rb_define_method(cgsl_integration_qaws_table, "set",
|
1094
|
-
|
1095
|
-
rb_define_method(rb_cArray, "to_gsl_integration_qaws_table",
|
1096
|
-
|
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);
|
1097
1075
|
rb_define_alias(rb_cArray, "to_qaws_table", "to_gsl_integration_qaws_table");
|
1098
1076
|
rb_define_method(cgsl_function, "integration_qaws", rb_gsl_integration_qaws, -1);
|
1099
1077
|
rb_define_alias(cgsl_function, "qaws", "integration_qaws");
|
1100
1078
|
|
1101
|
-
cgsl_integration_qawo_table = rb_define_class_under(mgsl_integ, "QAWO_Table",
|
1102
|
-
|
1079
|
+
cgsl_integration_qawo_table = rb_define_class_under(mgsl_integ, "QAWO_Table",
|
1080
|
+
cGSL_Object);
|
1103
1081
|
rb_define_singleton_method(cgsl_integration_qawo_table, "alloc",
|
1104
|
-
|
1082
|
+
rb_gsl_integration_qawo_table_alloc, -1);
|
1105
1083
|
/* rb_define_singleton_method(cgsl_integration_qawo_table, "new",
|
1106
1084
|
rb_gsl_integration_qawo_table_alloc, -1);*/
|
1107
|
-
rb_define_method(cgsl_integration_qawo_table, "to_a",
|
1108
|
-
|
1109
|
-
rb_define_method(rb_cArray, "to_gsl_integration_qawo_table",
|
1110
|
-
|
1111
|
-
rb_define_method(cgsl_integration_qawo_table, "set",
|
1112
|
-
|
1113
|
-
rb_define_method(cgsl_integration_qawo_table, "set_length",
|
1114
|
-
|
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);
|
1115
1093
|
rb_define_method(cgsl_function, "integration_qawo", rb_gsl_integration_qawo, -1);
|
1116
1094
|
rb_define_method(cgsl_function, "integration_qawf", rb_gsl_integration_qawf, -1);
|
1117
1095
|
rb_define_alias(cgsl_function, "qawo", "integration_qawo");
|
1118
1096
|
rb_define_alias(cgsl_function, "qawf", "integration_qawf");
|
1119
1097
|
|
1120
|
-
cgsl_integration_workspace = rb_define_class_under(mgsl_integ,
|
1121
|
-
|
1098
|
+
cgsl_integration_workspace = rb_define_class_under(mgsl_integ,
|
1099
|
+
"Workspace", cGSL_Object);
|
1122
1100
|
|
1123
1101
|
/* rb_define_singleton_method(cgsl_integration_workspace, "new",
|
1124
1102
|
rb_gsl_integration_workspace_alloc, -1);*/
|
1125
1103
|
rb_define_singleton_method(cgsl_integration_workspace, "alloc",
|
1126
|
-
|
1127
|
-
|
1128
|
-
rb_define_method(cgsl_integration_workspace, "limit",
|
1129
|
-
|
1130
|
-
rb_define_method(cgsl_integration_workspace, "size",
|
1131
|
-
|
1132
|
-
rb_define_method(cgsl_integration_workspace, "nrmax",
|
1133
|
-
|
1134
|
-
rb_define_method(cgsl_integration_workspace, "i",
|
1135
|
-
|
1136
|
-
rb_define_method(cgsl_integration_workspace, "maximum_level",
|
1137
|
-
|
1138
|
-
rb_define_method(cgsl_integration_workspace, "to_a",
|
1139
|
-
|
1140
|
-
rb_define_method(cgsl_integration_workspace, "alist",
|
1141
|
-
|
1142
|
-
rb_define_method(cgsl_integration_workspace, "blist",
|
1143
|
-
|
1144
|
-
rb_define_method(cgsl_integration_workspace, "rlist",
|
1145
|
-
|
1146
|
-
rb_define_method(cgsl_integration_workspace, "elist",
|
1147
|
-
|
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);
|
1148
1126
|
|
1149
1127
|
/*****/
|
1150
1128
|
rb_define_module_function(mgsl_integ, "qng", rb_gsl_integration_qng, -1);
|
@@ -1159,13 +1137,10 @@ void Init_gsl_integration(VALUE module)
|
|
1159
1137
|
rb_define_module_function(mgsl_integ, "qawo", rb_gsl_integration_qawo, -1);
|
1160
1138
|
rb_define_module_function(mgsl_integ, "qawf", rb_gsl_integration_qawf, -1);
|
1161
1139
|
|
1162
|
-
#ifdef GSL_1_14_LATER
|
1163
1140
|
cgsl_integration_glfixed_table = rb_define_class_under(mgsl_integ, "Glfixed_table", cGSL_Object);
|
1164
1141
|
rb_define_singleton_method(cgsl_integration_glfixed_table, "alloc",
|
1165
|
-
|
1142
|
+
rb_gsl_integration_glfixed_table_alloc, 1);
|
1166
1143
|
rb_define_method(cgsl_function, "glfixed", rb_gsl_integration_glfixed, 3);
|
1167
|
-
#endif
|
1168
|
-
|
1169
1144
|
}
|
1170
1145
|
|
1171
1146
|
#undef EPSABS_DEFAULT
|