rb-gsl 1.16.0.5 → 1.16.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/rb-gsl.gemspec +5 -10
- metadata +10 -713
- data/.gitignore +0 -12
- data/.travis.yml +0 -24
- data/AUTHORS +0 -12
- data/COPYING +0 -341
- data/ChangeLog +0 -621
- data/Gemfile +0 -4
- data/README.md +0 -77
- data/Rakefile +0 -20
- data/THANKS +0 -17
- data/examples/alf/alf.gp +0 -15
- data/examples/alf/alf.rb +0 -32
- data/examples/blas/blas.rb +0 -13
- data/examples/blas/dnrm2.rb +0 -16
- data/examples/blas/level1.rb +0 -81
- data/examples/blas/level2.rb +0 -11
- data/examples/blas/level3.rb +0 -12
- data/examples/bspline.rb +0 -57
- data/examples/cdf.rb +0 -16
- data/examples/cheb.rb +0 -21
- data/examples/combination.rb +0 -23
- data/examples/complex/RC-lpf.rb +0 -47
- data/examples/complex/add.rb +0 -36
- data/examples/complex/coerce.rb +0 -14
- data/examples/complex/complex.rb +0 -25
- data/examples/complex/fpmi.rb +0 -70
- data/examples/complex/functions.rb +0 -77
- data/examples/complex/michelson.rb +0 -36
- data/examples/complex/mul.rb +0 -28
- data/examples/complex/oscillator.rb +0 -17
- data/examples/complex/set.rb +0 -37
- data/examples/const/physconst.rb +0 -151
- data/examples/const/travel.rb +0 -45
- data/examples/deriv/demo.rb +0 -13
- data/examples/deriv/deriv.rb +0 -36
- data/examples/deriv/diff.rb +0 -35
- data/examples/dht.rb +0 -42
- data/examples/dirac.rb +0 -56
- data/examples/eigen/eigen.rb +0 -34
- data/examples/eigen/herm.rb +0 -22
- data/examples/eigen/narray.rb +0 -9
- data/examples/eigen/nonsymm.rb +0 -37
- data/examples/eigen/nonsymmv.rb +0 -43
- data/examples/eigen/qhoscillator.gp +0 -35
- data/examples/eigen/qhoscillator.rb +0 -90
- data/examples/eigen/vander.rb +0 -41
- data/examples/fft/fft.rb +0 -17
- data/examples/fft/fft2.rb +0 -17
- data/examples/fft/forward.rb +0 -25
- data/examples/fft/forward2.rb +0 -26
- data/examples/fft/radix2.rb +0 -18
- data/examples/fft/real-halfcomplex.rb +0 -33
- data/examples/fft/real-halfcomplex2.rb +0 -30
- data/examples/fft/realradix2.rb +0 -19
- data/examples/fft/sunspot.dat +0 -256
- data/examples/fft/sunspot.rb +0 -16
- data/examples/fit/expdata.dat +0 -20
- data/examples/fit/expfit.rb +0 -31
- data/examples/fit/gaussfit.rb +0 -29
- data/examples/fit/gaussian_2peaks.rb +0 -34
- data/examples/fit/hillfit.rb +0 -40
- data/examples/fit/lognormal.rb +0 -26
- data/examples/fit/lorentzfit.rb +0 -22
- data/examples/fit/multifit.rb +0 -72
- data/examples/fit/ndlinear.rb +0 -133
- data/examples/fit/nonlinearfit.rb +0 -89
- data/examples/fit/plot.gp +0 -36
- data/examples/fit/polyfit.rb +0 -9
- data/examples/fit/powerfit.rb +0 -21
- data/examples/fit/sigmoidfit.rb +0 -40
- data/examples/fit/sinfit.rb +0 -22
- data/examples/fit/wlinear.rb +0 -46
- data/examples/fresnel.rb +0 -11
- data/examples/function/function.rb +0 -36
- data/examples/function/log.rb +0 -7
- data/examples/function/min.rb +0 -33
- data/examples/function/sin.rb +0 -10
- data/examples/function/synchrotron.rb +0 -18
- data/examples/gallery/butterfly.rb +0 -7
- data/examples/gallery/cayley.rb +0 -12
- data/examples/gallery/cornu.rb +0 -23
- data/examples/gallery/eight.rb +0 -11
- data/examples/gallery/koch.rb +0 -40
- data/examples/gallery/lemniscate.rb +0 -11
- data/examples/gallery/polar.rb +0 -11
- data/examples/gallery/rgplot/cossin.rb +0 -35
- data/examples/gallery/rgplot/rgplot.replaced +0 -0
- data/examples/gallery/rgplot/roesller.rb +0 -55
- data/examples/gallery/roesller.rb +0 -39
- data/examples/gallery/scarabaeus.rb +0 -14
- data/examples/histogram/cauchy.rb +0 -27
- data/examples/histogram/cauchy.sh +0 -2
- data/examples/histogram/exponential.rb +0 -19
- data/examples/histogram/gauss.rb +0 -16
- data/examples/histogram/gsl-histogram.rb +0 -40
- data/examples/histogram/histo2d.rb +0 -31
- data/examples/histogram/histo3d.rb +0 -34
- data/examples/histogram/histogram-pdf.rb +0 -27
- data/examples/histogram/histogram.rb +0 -26
- data/examples/histogram/integral.rb +0 -28
- data/examples/histogram/poisson.rb +0 -27
- data/examples/histogram/power.rb +0 -25
- data/examples/histogram/rebin.rb +0 -17
- data/examples/histogram/smp.dat +0 -5
- data/examples/histogram/xexp.rb +0 -21
- data/examples/integration/ahmed.rb +0 -21
- data/examples/integration/cosmology.rb +0 -75
- data/examples/integration/friedmann.gp +0 -16
- data/examples/integration/friedmann.rb +0 -35
- data/examples/integration/gamma-zeta.rb +0 -35
- data/examples/integration/integration.rb +0 -22
- data/examples/integration/qag.rb +0 -8
- data/examples/integration/qag2.rb +0 -14
- data/examples/integration/qag3.rb +0 -8
- data/examples/integration/qagi.rb +0 -28
- data/examples/integration/qagi2.rb +0 -49
- data/examples/integration/qagiu.rb +0 -29
- data/examples/integration/qagp.rb +0 -20
- data/examples/integration/qags.rb +0 -14
- data/examples/integration/qawc.rb +0 -18
- data/examples/integration/qawf.rb +0 -41
- data/examples/integration/qawo.rb +0 -29
- data/examples/integration/qaws.rb +0 -30
- data/examples/integration/qng.rb +0 -17
- data/examples/interp/demo.gp +0 -20
- data/examples/interp/demo.rb +0 -45
- data/examples/interp/interp.rb +0 -37
- data/examples/interp/points +0 -10
- data/examples/interp/spline.rb +0 -20
- data/examples/jacobi/deriv.rb +0 -40
- data/examples/jacobi/integrate.rb +0 -34
- data/examples/jacobi/interp.rb +0 -43
- data/examples/jacobi/jacobi.rb +0 -11
- data/examples/linalg/HH.rb +0 -15
- data/examples/linalg/HH_narray.rb +0 -13
- data/examples/linalg/LQ_solve.rb +0 -73
- data/examples/linalg/LU.rb +0 -84
- data/examples/linalg/LU2.rb +0 -31
- data/examples/linalg/LU_narray.rb +0 -24
- data/examples/linalg/PTLQ.rb +0 -47
- data/examples/linalg/QR.rb +0 -18
- data/examples/linalg/QRPT.rb +0 -47
- data/examples/linalg/QR_solve.rb +0 -78
- data/examples/linalg/QR_solve_narray.rb +0 -13
- data/examples/linalg/SV.rb +0 -16
- data/examples/linalg/SV_narray.rb +0 -12
- data/examples/linalg/SV_solve.rb +0 -49
- data/examples/linalg/chol.rb +0 -29
- data/examples/linalg/chol_narray.rb +0 -15
- data/examples/linalg/complex.rb +0 -57
- data/examples/linalg/invert_narray.rb +0 -10
- data/examples/math/const.rb +0 -67
- data/examples/math/elementary.rb +0 -35
- data/examples/math/functions.rb +0 -41
- data/examples/math/inf_nan.rb +0 -34
- data/examples/math/minmax.rb +0 -22
- data/examples/math/power.rb +0 -18
- data/examples/math/test.rb +0 -31
- data/examples/matrix/a.dat +0 -0
- data/examples/matrix/add.rb +0 -45
- data/examples/matrix/b.dat +0 -4
- data/examples/matrix/cat.rb +0 -31
- data/examples/matrix/colvectors.rb +0 -24
- data/examples/matrix/complex.rb +0 -41
- data/examples/matrix/det.rb +0 -29
- data/examples/matrix/diagonal.rb +0 -23
- data/examples/matrix/get_all.rb +0 -159
- data/examples/matrix/hilbert.rb +0 -31
- data/examples/matrix/iterator.rb +0 -19
- data/examples/matrix/matrix.rb +0 -57
- data/examples/matrix/minmax.rb +0 -53
- data/examples/matrix/mul.rb +0 -39
- data/examples/matrix/rand.rb +0 -20
- data/examples/matrix/read.rb +0 -29
- data/examples/matrix/rowcol.rb +0 -47
- data/examples/matrix/set.rb +0 -41
- data/examples/matrix/set_all.rb +0 -100
- data/examples/matrix/view.rb +0 -32
- data/examples/matrix/view_all.rb +0 -148
- data/examples/matrix/write.rb +0 -23
- data/examples/min.rb +0 -29
- data/examples/monte/miser.rb +0 -47
- data/examples/monte/monte.rb +0 -47
- data/examples/monte/plain.rb +0 -47
- data/examples/monte/vegas.rb +0 -46
- data/examples/multimin/bundle.rb +0 -66
- data/examples/multimin/cqp.rb +0 -109
- data/examples/multimin/fdfminimizer.rb +0 -40
- data/examples/multimin/fminimizer.rb +0 -41
- data/examples/multiroot/demo.rb +0 -36
- data/examples/multiroot/fdfsolver.rb +0 -50
- data/examples/multiroot/fsolver.rb +0 -33
- data/examples/multiroot/fsolver2.rb +0 -32
- data/examples/multiroot/fsolver3.rb +0 -26
- data/examples/narray/histogram.rb +0 -14
- data/examples/narray/mandel.rb +0 -27
- data/examples/narray/narray.rb +0 -28
- data/examples/narray/narray2.rb +0 -44
- data/examples/narray/sf.rb +0 -26
- data/examples/ntuple/create.rb +0 -17
- data/examples/ntuple/project.rb +0 -31
- data/examples/odeiv/binarysystem.gp +0 -23
- data/examples/odeiv/binarysystem.rb +0 -104
- data/examples/odeiv/demo.gp +0 -24
- data/examples/odeiv/demo.rb +0 -69
- data/examples/odeiv/demo2.gp +0 -26
- data/examples/odeiv/duffing.rb +0 -45
- data/examples/odeiv/frei1.rb +0 -109
- data/examples/odeiv/frei2.rb +0 -76
- data/examples/odeiv/legendre.rb +0 -52
- data/examples/odeiv/odeiv.rb +0 -32
- data/examples/odeiv/odeiv2.rb +0 -45
- data/examples/odeiv/oscillator.rb +0 -42
- data/examples/odeiv/sedov.rb +0 -97
- data/examples/odeiv/whitedwarf.gp +0 -40
- data/examples/odeiv/whitedwarf.rb +0 -158
- data/examples/ool/conmin.rb +0 -100
- data/examples/ool/gencan.rb +0 -99
- data/examples/ool/pgrad.rb +0 -100
- data/examples/ool/spg.rb +0 -100
- data/examples/pdf/bernoulli.rb +0 -5
- data/examples/pdf/beta.rb +0 -7
- data/examples/pdf/binomiral.rb +0 -10
- data/examples/pdf/cauchy.rb +0 -6
- data/examples/pdf/chisq.rb +0 -8
- data/examples/pdf/exponential.rb +0 -7
- data/examples/pdf/exppow.rb +0 -6
- data/examples/pdf/fdist.rb +0 -7
- data/examples/pdf/flat.rb +0 -7
- data/examples/pdf/gamma.rb +0 -8
- data/examples/pdf/gauss-tail.rb +0 -5
- data/examples/pdf/gauss.rb +0 -6
- data/examples/pdf/geometric.rb +0 -5
- data/examples/pdf/gumbel.rb +0 -6
- data/examples/pdf/hypergeometric.rb +0 -11
- data/examples/pdf/landau.rb +0 -5
- data/examples/pdf/laplace.rb +0 -7
- data/examples/pdf/logarithmic.rb +0 -5
- data/examples/pdf/logistic.rb +0 -6
- data/examples/pdf/lognormal.rb +0 -6
- data/examples/pdf/neg-binomiral.rb +0 -10
- data/examples/pdf/pareto.rb +0 -7
- data/examples/pdf/pascal.rb +0 -10
- data/examples/pdf/poisson.rb +0 -5
- data/examples/pdf/rayleigh-tail.rb +0 -6
- data/examples/pdf/rayleigh.rb +0 -6
- data/examples/pdf/tdist.rb +0 -6
- data/examples/pdf/weibull.rb +0 -8
- data/examples/permutation/ex1.rb +0 -22
- data/examples/permutation/permutation.rb +0 -16
- data/examples/poly/bell.rb +0 -6
- data/examples/poly/bessel.rb +0 -6
- data/examples/poly/cheb.rb +0 -6
- data/examples/poly/cheb_II.rb +0 -6
- data/examples/poly/cubic.rb +0 -9
- data/examples/poly/demo.rb +0 -20
- data/examples/poly/eval.rb +0 -28
- data/examples/poly/eval_derivs.rb +0 -14
- data/examples/poly/fit.rb +0 -21
- data/examples/poly/hermite.rb +0 -6
- data/examples/poly/poly.rb +0 -13
- data/examples/poly/quadratic.rb +0 -25
- data/examples/random/diffusion.rb +0 -34
- data/examples/random/gaussian.rb +0 -9
- data/examples/random/generator.rb +0 -27
- data/examples/random/hdsobol.rb +0 -21
- data/examples/random/poisson.rb +0 -9
- data/examples/random/qrng.rb +0 -19
- data/examples/random/randomwalk.rb +0 -37
- data/examples/random/randomwalk2d.rb +0 -19
- data/examples/random/rayleigh.rb +0 -36
- data/examples/random/rng.rb +0 -33
- data/examples/random/rngextra.rb +0 -14
- data/examples/roots/bisection.rb +0 -25
- data/examples/roots/brent.rb +0 -43
- data/examples/roots/demo.rb +0 -30
- data/examples/roots/newton.rb +0 -46
- data/examples/roots/recombination.gp +0 -11
- data/examples/roots/recombination.rb +0 -61
- data/examples/roots/steffenson.rb +0 -48
- data/examples/sf/ShiChi.rb +0 -6
- data/examples/sf/SiCi.rb +0 -6
- data/examples/sf/airy_Ai.rb +0 -8
- data/examples/sf/airy_Bi.rb +0 -8
- data/examples/sf/bessel_IK.rb +0 -12
- data/examples/sf/bessel_JY.rb +0 -13
- data/examples/sf/beta_inc.rb +0 -9
- data/examples/sf/clausen.rb +0 -6
- data/examples/sf/dawson.rb +0 -5
- data/examples/sf/debye.rb +0 -9
- data/examples/sf/dilog.rb +0 -6
- data/examples/sf/ellint.rb +0 -6
- data/examples/sf/expint.rb +0 -8
- data/examples/sf/fermi.rb +0 -10
- data/examples/sf/gamma_inc_P.rb +0 -9
- data/examples/sf/gegenbauer.rb +0 -8
- data/examples/sf/hyperg.rb +0 -7
- data/examples/sf/laguerre.rb +0 -19
- data/examples/sf/lambertW.rb +0 -5
- data/examples/sf/legendre_P.rb +0 -10
- data/examples/sf/lngamma.rb +0 -5
- data/examples/sf/psi.rb +0 -54
- data/examples/sf/sphbessel.gp +0 -27
- data/examples/sf/sphbessel.rb +0 -30
- data/examples/sf/synchrotron.rb +0 -5
- data/examples/sf/transport.rb +0 -10
- data/examples/sf/zetam1.rb +0 -5
- data/examples/siman.rb +0 -44
- data/examples/sort/heapsort.rb +0 -23
- data/examples/sort/heapsort_vector_complex.rb +0 -21
- data/examples/sort/sort.rb +0 -23
- data/examples/sort/sort2.rb +0 -16
- data/examples/stats/mean.rb +0 -17
- data/examples/stats/statistics.rb +0 -18
- data/examples/stats/test.rb +0 -9
- data/examples/sum.rb +0 -34
- data/examples/tamu_anova.rb +0 -18
- data/examples/vector/a.dat +0 -0
- data/examples/vector/add.rb +0 -56
- data/examples/vector/b.dat +0 -4
- data/examples/vector/c.dat +0 -3
- data/examples/vector/collect.rb +0 -26
- data/examples/vector/compare.rb +0 -28
- data/examples/vector/complex.rb +0 -51
- data/examples/vector/complex_get_all.rb +0 -85
- data/examples/vector/complex_set_all.rb +0 -131
- data/examples/vector/complex_view_all.rb +0 -77
- data/examples/vector/connect.rb +0 -22
- data/examples/vector/decimate.rb +0 -38
- data/examples/vector/diff.rb +0 -31
- data/examples/vector/filescan.rb +0 -17
- data/examples/vector/floor.rb +0 -23
- data/examples/vector/get_all.rb +0 -82
- data/examples/vector/gnuplot.rb +0 -38
- data/examples/vector/graph.rb +0 -28
- data/examples/vector/histogram.rb +0 -22
- data/examples/vector/linspace.rb +0 -24
- data/examples/vector/log.rb +0 -17
- data/examples/vector/logic.rb +0 -33
- data/examples/vector/logspace.rb +0 -25
- data/examples/vector/minmax.rb +0 -47
- data/examples/vector/mul.rb +0 -49
- data/examples/vector/narray.rb +0 -46
- data/examples/vector/read.rb +0 -29
- data/examples/vector/set.rb +0 -35
- data/examples/vector/set_all.rb +0 -121
- data/examples/vector/smpv.dat +0 -15
- data/examples/vector/test.rb +0 -43
- data/examples/vector/test_gslblock.rb +0 -58
- data/examples/vector/vector.rb +0 -110
- data/examples/vector/view.rb +0 -35
- data/examples/vector/view_all.rb +0 -73
- data/examples/vector/where.rb +0 -29
- data/examples/vector/write.rb +0 -24
- data/examples/vector/zip.rb +0 -34
- data/examples/wavelet/ecg.dat +0 -256
- data/examples/wavelet/wavelet1.rb +0 -50
- data/ext/gsl_native/alf.c +0 -206
- data/ext/gsl_native/array.c +0 -553
- data/ext/gsl_native/array_complex.c +0 -245
- data/ext/gsl_native/blas.c +0 -28
- data/ext/gsl_native/blas1.c +0 -733
- data/ext/gsl_native/blas2.c +0 -1088
- data/ext/gsl_native/blas3.c +0 -880
- data/ext/gsl_native/block.c +0 -40
- data/ext/gsl_native/block_source.h +0 -885
- data/ext/gsl_native/bspline.c +0 -122
- data/ext/gsl_native/bundle.c +0 -3
- data/ext/gsl_native/cdf.c +0 -740
- data/ext/gsl_native/cheb.c +0 -531
- data/ext/gsl_native/combination.c +0 -275
- data/ext/gsl_native/common.c +0 -293
- data/ext/gsl_native/complex.c +0 -1002
- data/ext/gsl_native/const.c +0 -331
- data/ext/gsl_native/const_additional.c +0 -99
- data/ext/gsl_native/cqp.c +0 -283
- data/ext/gsl_native/deriv.c +0 -187
- data/ext/gsl_native/dht.c +0 -353
- data/ext/gsl_native/diff.c +0 -164
- data/ext/gsl_native/dirac.c +0 -388
- data/ext/gsl_native/eigen.c +0 -2322
- data/ext/gsl_native/error.c +0 -193
- data/ext/gsl_native/extconf.rb +0 -118
- data/ext/gsl_native/fft.c +0 -1095
- data/ext/gsl_native/fit.c +0 -204
- data/ext/gsl_native/fresnel.c +0 -312
- data/ext/gsl_native/function.c +0 -518
- data/ext/gsl_native/geometry.c +0 -139
- data/ext/gsl_native/graph.c +0 -1590
- data/ext/gsl_native/gsl.c +0 -259
- data/ext/gsl_native/gsl_narray.c +0 -794
- data/ext/gsl_native/histogram.c +0 -1964
- data/ext/gsl_native/histogram2d.c +0 -1042
- data/ext/gsl_native/histogram3d.c +0 -884
- data/ext/gsl_native/histogram3d_source.c +0 -749
- data/ext/gsl_native/histogram_find.c +0 -99
- data/ext/gsl_native/histogram_oper.c +0 -150
- data/ext/gsl_native/ieee.c +0 -88
- data/ext/gsl_native/include/rb_gsl.h +0 -136
- data/ext/gsl_native/include/rb_gsl_array.h +0 -214
- data/ext/gsl_native/include/rb_gsl_cheb.h +0 -19
- data/ext/gsl_native/include/rb_gsl_common.h +0 -348
- data/ext/gsl_native/include/rb_gsl_complex.h +0 -25
- data/ext/gsl_native/include/rb_gsl_const.h +0 -23
- data/ext/gsl_native/include/rb_gsl_dirac.h +0 -6
- data/ext/gsl_native/include/rb_gsl_eigen.h +0 -17
- data/ext/gsl_native/include/rb_gsl_fft.h +0 -49
- data/ext/gsl_native/include/rb_gsl_fit.h +0 -23
- data/ext/gsl_native/include/rb_gsl_function.h +0 -23
- data/ext/gsl_native/include/rb_gsl_graph.h +0 -68
- data/ext/gsl_native/include/rb_gsl_histogram.h +0 -63
- data/ext/gsl_native/include/rb_gsl_histogram3d.h +0 -97
- data/ext/gsl_native/include/rb_gsl_integration.h +0 -17
- data/ext/gsl_native/include/rb_gsl_interp.h +0 -41
- data/ext/gsl_native/include/rb_gsl_linalg.h +0 -21
- data/ext/gsl_native/include/rb_gsl_math.h +0 -20
- data/ext/gsl_native/include/rb_gsl_odeiv.h +0 -18
- data/ext/gsl_native/include/rb_gsl_poly.h +0 -67
- data/ext/gsl_native/include/rb_gsl_rational.h +0 -30
- data/ext/gsl_native/include/rb_gsl_rng.h +0 -20
- data/ext/gsl_native/include/rb_gsl_root.h +0 -22
- data/ext/gsl_native/include/rb_gsl_sf.h +0 -110
- data/ext/gsl_native/include/rb_gsl_statistics.h +0 -17
- data/ext/gsl_native/include/rb_gsl_tensor.h +0 -43
- data/ext/gsl_native/include/rb_gsl_with_narray.h +0 -31
- data/ext/gsl_native/include/templates_off.h +0 -87
- data/ext/gsl_native/include/templates_on.h +0 -241
- data/ext/gsl_native/integration.c +0 -1154
- data/ext/gsl_native/interp.c +0 -499
- data/ext/gsl_native/jacobi.c +0 -733
- data/ext/gsl_native/linalg.c +0 -3915
- data/ext/gsl_native/linalg_complex.c +0 -726
- data/ext/gsl_native/math.c +0 -706
- data/ext/gsl_native/matrix.c +0 -36
- data/ext/gsl_native/matrix_complex.c +0 -1733
- data/ext/gsl_native/matrix_double.c +0 -557
- data/ext/gsl_native/matrix_int.c +0 -255
- data/ext/gsl_native/matrix_source.h +0 -2708
- data/ext/gsl_native/min.c +0 -219
- data/ext/gsl_native/monte.c +0 -978
- data/ext/gsl_native/multifit.c +0 -1862
- data/ext/gsl_native/multimin.c +0 -778
- data/ext/gsl_native/multimin_fsdf.c +0 -156
- data/ext/gsl_native/multiroots.c +0 -952
- data/ext/gsl_native/multiset.c +0 -210
- data/ext/gsl_native/ndlinear.c +0 -320
- data/ext/gsl_native/nmf.c +0 -171
- data/ext/gsl_native/nmf_wrap.c +0 -75
- data/ext/gsl_native/ntuple.c +0 -469
- data/ext/gsl_native/odeiv.c +0 -947
- data/ext/gsl_native/ool.c +0 -879
- data/ext/gsl_native/permutation.c +0 -598
- data/ext/gsl_native/poly.c +0 -39
- data/ext/gsl_native/poly2.c +0 -265
- data/ext/gsl_native/poly_source.h +0 -1871
- data/ext/gsl_native/qrng.c +0 -160
- data/ext/gsl_native/randist.c +0 -1848
- data/ext/gsl_native/rational.c +0 -480
- data/ext/gsl_native/rng.c +0 -595
- data/ext/gsl_native/root.c +0 -407
- data/ext/gsl_native/sf.c +0 -1446
- data/ext/gsl_native/sf_airy.c +0 -200
- data/ext/gsl_native/sf_bessel.c +0 -871
- data/ext/gsl_native/sf_clausen.c +0 -28
- data/ext/gsl_native/sf_coulomb.c +0 -206
- data/ext/gsl_native/sf_coupling.c +0 -121
- data/ext/gsl_native/sf_dawson.c +0 -29
- data/ext/gsl_native/sf_debye.c +0 -148
- data/ext/gsl_native/sf_dilog.c +0 -43
- data/ext/gsl_native/sf_elementary.c +0 -46
- data/ext/gsl_native/sf_ellint.c +0 -206
- data/ext/gsl_native/sf_elljac.c +0 -30
- data/ext/gsl_native/sf_erfc.c +0 -89
- data/ext/gsl_native/sf_exp.c +0 -169
- data/ext/gsl_native/sf_expint.c +0 -201
- data/ext/gsl_native/sf_fermi_dirac.c +0 -148
- data/ext/gsl_native/sf_gamma.c +0 -343
- data/ext/gsl_native/sf_gegenbauer.c +0 -97
- data/ext/gsl_native/sf_hyperg.c +0 -203
- data/ext/gsl_native/sf_laguerre.c +0 -113
- data/ext/gsl_native/sf_lambert.c +0 -47
- data/ext/gsl_native/sf_legendre.c +0 -368
- data/ext/gsl_native/sf_log.c +0 -105
- data/ext/gsl_native/sf_mathieu.c +0 -235
- data/ext/gsl_native/sf_power.c +0 -47
- data/ext/gsl_native/sf_psi.c +0 -89
- data/ext/gsl_native/sf_synchrotron.c +0 -48
- data/ext/gsl_native/sf_transport.c +0 -76
- data/ext/gsl_native/sf_trigonometric.c +0 -210
- data/ext/gsl_native/sf_zeta.c +0 -115
- data/ext/gsl_native/signal.c +0 -303
- data/ext/gsl_native/siman.c +0 -713
- data/ext/gsl_native/sort.c +0 -207
- data/ext/gsl_native/spline.c +0 -377
- data/ext/gsl_native/stats.c +0 -787
- data/ext/gsl_native/sum.c +0 -168
- data/ext/gsl_native/tamu_anova.c +0 -56
- data/ext/gsl_native/tensor.c +0 -35
- data/ext/gsl_native/tensor_source.h +0 -1122
- data/ext/gsl_native/vector.c +0 -35
- data/ext/gsl_native/vector_complex.c +0 -2241
- data/ext/gsl_native/vector_double.c +0 -1433
- data/ext/gsl_native/vector_int.c +0 -202
- data/ext/gsl_native/vector_source.h +0 -3321
- data/ext/gsl_native/wavelet.c +0 -923
- data/lib/gsl.rb +0 -8
- data/lib/gsl/gnuplot.rb +0 -41
- data/lib/gsl/oper.rb +0 -43
- data/lib/gsl/version.rb +0 -3
- data/lib/ool.rb +0 -22
- data/lib/ool/conmin.rb +0 -30
- data/lib/rbgsl.rb +0 -1
- data/rdoc/alf.rdoc +0 -77
- data/rdoc/blas.rdoc +0 -269
- data/rdoc/bspline.rdoc +0 -42
- data/rdoc/changes.rdoc +0 -159
- data/rdoc/cheb.rdoc +0 -99
- data/rdoc/cholesky_complex.rdoc +0 -46
- data/rdoc/combi.rdoc +0 -125
- data/rdoc/complex.rdoc +0 -210
- data/rdoc/const.rdoc +0 -546
- data/rdoc/dht.rdoc +0 -122
- data/rdoc/diff.rdoc +0 -133
- data/rdoc/ehandling.rdoc +0 -50
- data/rdoc/eigen.rdoc +0 -401
- data/rdoc/fft.rdoc +0 -535
- data/rdoc/fit.rdoc +0 -284
- data/rdoc/function.rdoc +0 -94
- data/rdoc/graph.rdoc +0 -137
- data/rdoc/hist.rdoc +0 -409
- data/rdoc/hist2d.rdoc +0 -279
- data/rdoc/hist3d.rdoc +0 -112
- data/rdoc/integration.rdoc +0 -398
- data/rdoc/interp.rdoc +0 -231
- data/rdoc/intro.rdoc +0 -27
- data/rdoc/linalg.rdoc +0 -681
- data/rdoc/linalg_complex.rdoc +0 -88
- data/rdoc/math.rdoc +0 -276
- data/rdoc/matrix.rdoc +0 -1093
- data/rdoc/min.rdoc +0 -189
- data/rdoc/monte.rdoc +0 -234
- data/rdoc/multimin.rdoc +0 -312
- data/rdoc/multiroot.rdoc +0 -293
- data/rdoc/narray.rdoc +0 -177
- data/rdoc/ndlinear.rdoc +0 -250
- data/rdoc/nonlinearfit.rdoc +0 -348
- data/rdoc/ntuple.rdoc +0 -88
- data/rdoc/odeiv.rdoc +0 -378
- data/rdoc/perm.rdoc +0 -221
- data/rdoc/poly.rdoc +0 -335
- data/rdoc/qrng.rdoc +0 -90
- data/rdoc/randist.rdoc +0 -233
- data/rdoc/ref.rdoc +0 -93
- data/rdoc/rng.rdoc +0 -203
- data/rdoc/roots.rdoc +0 -305
- data/rdoc/sf.rdoc +0 -1622
- data/rdoc/siman.rdoc +0 -89
- data/rdoc/sort.rdoc +0 -94
- data/rdoc/start.rdoc +0 -16
- data/rdoc/stats.rdoc +0 -219
- data/rdoc/sum.rdoc +0 -65
- data/rdoc/tensor.rdoc +0 -251
- data/rdoc/tut.rdoc +0 -5
- data/rdoc/use.rdoc +0 -177
- data/rdoc/vector.rdoc +0 -1243
- data/rdoc/vector_complex.rdoc +0 -347
- data/rdoc/wavelet.rdoc +0 -218
- data/test/gsl/blas_test.rb +0 -79
- data/test/gsl/bspline_test.rb +0 -63
- data/test/gsl/cdf_test.rb +0 -1512
- data/test/gsl/cheb_test.rb +0 -80
- data/test/gsl/combination_test.rb +0 -100
- data/test/gsl/complex_test.rb +0 -20
- data/test/gsl/const_test.rb +0 -29
- data/test/gsl/deriv_test.rb +0 -62
- data/test/gsl/dht_test.rb +0 -79
- data/test/gsl/diff_test.rb +0 -53
- data/test/gsl/eigen_test.rb +0 -563
- data/test/gsl/err_test.rb +0 -23
- data/test/gsl/fit_test.rb +0 -101
- data/test/gsl/histo_test.rb +0 -14
- data/test/gsl/index_test.rb +0 -61
- data/test/gsl/integration_test.rb +0 -274
- data/test/gsl/interp_test.rb +0 -27
- data/test/gsl/linalg_test.rb +0 -463
- data/test/gsl/matrix_nmf_test.rb +0 -37
- data/test/gsl/matrix_test.rb +0 -98
- data/test/gsl/min_test.rb +0 -89
- data/test/gsl/monte_test.rb +0 -77
- data/test/gsl/multifit_test.rb +0 -753
- data/test/gsl/multimin_test.rb +0 -157
- data/test/gsl/multiroot_test.rb +0 -135
- data/test/gsl/multiset_test.rb +0 -52
- data/test/gsl/odeiv_test.rb +0 -275
- data/test/gsl/oper_test.rb +0 -98
- data/test/gsl/poly_test.rb +0 -338
- data/test/gsl/qrng_test.rb +0 -94
- data/test/gsl/quartic_test.rb +0 -28
- data/test/gsl/randist_test.rb +0 -122
- data/test/gsl/rng_test.rb +0 -303
- data/test/gsl/roots_test.rb +0 -78
- data/test/gsl/sf_test.rb +0 -2079
- data/test/gsl/stats_test.rb +0 -122
- data/test/gsl/sum_test.rb +0 -69
- data/test/gsl/tensor_test.rb +0 -396
- data/test/gsl/vector_test.rb +0 -223
- data/test/gsl/wavelet_test.rb +0 -130
- data/test/gsl_test.rb +0 -321
- data/test/test_helper.rb +0 -42
- data/uncrustify.cfg +0 -1693
@@ -1,241 +0,0 @@
|
|
1
|
-
/* If BASE is undefined we use function names like gsl_name()
|
2
|
-
and assume that we are using doubles.
|
3
|
-
|
4
|
-
If BASE is defined we used function names like gsl_BASE_name()
|
5
|
-
and use BASE as the base datatype */
|
6
|
-
|
7
|
-
#if defined(BASE_GSL_COMPLEX_LONG)
|
8
|
-
#define BASE gsl_complex_long_double
|
9
|
-
#define SHORT complex_long_double
|
10
|
-
#define SHORT_REAL long_double
|
11
|
-
#define ATOMIC long double
|
12
|
-
#define USES_LONGDOUBLE 1
|
13
|
-
#define MULTIPLICITY 2
|
14
|
-
#define IN_FORMAT "%Lg"
|
15
|
-
#define OUT_FORMAT "%Lg"
|
16
|
-
#define ATOMIC_IO ATOMIC
|
17
|
-
#define ZERO {{0.0L,0.0L}}
|
18
|
-
#define ONE {{1.0L,0.0L}}
|
19
|
-
#define BASE_EPSILON GSL_DBL_EPSILON
|
20
|
-
|
21
|
-
#elif defined(BASE_GSL_COMPLEX)
|
22
|
-
#define BASE gsl_complex
|
23
|
-
#define SHORT complex
|
24
|
-
#define SHORT_REAL
|
25
|
-
#define ATOMIC double
|
26
|
-
#define MULTIPLICITY 2
|
27
|
-
#define IN_FORMAT "%lg"
|
28
|
-
#define OUT_FORMAT "%g"
|
29
|
-
#define ATOMIC_IO ATOMIC
|
30
|
-
#define ZERO {{0.0,0.0}}
|
31
|
-
#define ONE {{1.0,0.0}}
|
32
|
-
#define BASE_EPSILON GSL_DBL_EPSILON
|
33
|
-
|
34
|
-
#elif defined(BASE_GSL_COMPLEX_FLOAT)
|
35
|
-
#define BASE gsl_complex_float
|
36
|
-
#define SHORT complex_float
|
37
|
-
#define SHORT_REAL float
|
38
|
-
#define ATOMIC float
|
39
|
-
#define MULTIPLICITY 2
|
40
|
-
#define IN_FORMAT "%g"
|
41
|
-
#define OUT_FORMAT "%g"
|
42
|
-
#define ATOMIC_IO ATOMIC
|
43
|
-
#define ZERO {{0.0F,0.0F}}
|
44
|
-
#define ONE {{1.0F,0.0F}}
|
45
|
-
#define BASE_EPSILON GSL_FLT_EPSILON
|
46
|
-
|
47
|
-
#elif defined(BASE_LONG_DOUBLE)
|
48
|
-
#define BASE long double
|
49
|
-
#define SHORT long_double
|
50
|
-
#define ATOMIC long double
|
51
|
-
#define USES_LONGDOUBLE 1
|
52
|
-
#define MULTIPLICITY 1
|
53
|
-
#define IN_FORMAT "%Lg"
|
54
|
-
#define OUT_FORMAT "%Lg"
|
55
|
-
#define ATOMIC_IO ATOMIC
|
56
|
-
#define ZERO 0.0L
|
57
|
-
#define ONE 1.0L
|
58
|
-
#define BASE_EPSILON GSL_DBL_EPSILON
|
59
|
-
|
60
|
-
#elif defined(BASE_DOUBLE)
|
61
|
-
#define BASE double
|
62
|
-
#define SHORT
|
63
|
-
#define ATOMIC double
|
64
|
-
#define MULTIPLICITY 1
|
65
|
-
#define IN_FORMAT "%lg"
|
66
|
-
#define OUT_FORMAT "%g"
|
67
|
-
#define ATOMIC_IO ATOMIC
|
68
|
-
#define ZERO 0.0
|
69
|
-
#define ONE 1.0
|
70
|
-
#define BASE_EPSILON GSL_DBL_EPSILON
|
71
|
-
|
72
|
-
#elif defined(BASE_FLOAT)
|
73
|
-
#define BASE float
|
74
|
-
#define SHORT float
|
75
|
-
#define ATOMIC float
|
76
|
-
#define MULTIPLICITY 1
|
77
|
-
#define IN_FORMAT "%g"
|
78
|
-
#define OUT_FORMAT "%g"
|
79
|
-
#define ATOMIC_IO ATOMIC
|
80
|
-
#define ZERO 0.0F
|
81
|
-
#define ONE 1.0F
|
82
|
-
#define BASE_EPSILON GSL_FLT_EPSILON
|
83
|
-
|
84
|
-
#elif defined(BASE_ULONG)
|
85
|
-
#define BASE unsigned long
|
86
|
-
#define SHORT ulong
|
87
|
-
#define ATOMIC unsigned long
|
88
|
-
#define MULTIPLICITY 1
|
89
|
-
#define IN_FORMAT "%lu"
|
90
|
-
#define OUT_FORMAT "%lu"
|
91
|
-
#define ATOMIC_IO ATOMIC
|
92
|
-
#define ZERO 0UL
|
93
|
-
#define ONE 1UL
|
94
|
-
|
95
|
-
#elif defined(BASE_LONG)
|
96
|
-
#define BASE long
|
97
|
-
#define SHORT long
|
98
|
-
#define ATOMIC long
|
99
|
-
#define MULTIPLICITY 1
|
100
|
-
#define IN_FORMAT "%ld"
|
101
|
-
#define OUT_FORMAT "%ld"
|
102
|
-
#define ATOMIC_IO ATOMIC
|
103
|
-
#define ZERO 0L
|
104
|
-
#define ONE 1L
|
105
|
-
|
106
|
-
#elif defined(BASE_UINT)
|
107
|
-
#define BASE unsigned int
|
108
|
-
#define SHORT uint
|
109
|
-
#define ATOMIC unsigned int
|
110
|
-
#define MULTIPLICITY 1
|
111
|
-
#define IN_FORMAT "%u"
|
112
|
-
#define OUT_FORMAT "%u"
|
113
|
-
#define ATOMIC_IO ATOMIC
|
114
|
-
#define ZERO 0U
|
115
|
-
#define ONE 1U
|
116
|
-
|
117
|
-
#elif defined(BASE_INT)
|
118
|
-
#define BASE int
|
119
|
-
#define SHORT int
|
120
|
-
#define ATOMIC int
|
121
|
-
#define MULTIPLICITY 1
|
122
|
-
#define IN_FORMAT "%d"
|
123
|
-
#define OUT_FORMAT "%d"
|
124
|
-
#define ATOMIC_IO ATOMIC
|
125
|
-
#define ZERO 0
|
126
|
-
#define ONE 1
|
127
|
-
|
128
|
-
#elif defined(BASE_USHORT)
|
129
|
-
#define BASE unsigned short
|
130
|
-
#define SHORT ushort
|
131
|
-
#define ATOMIC unsigned short
|
132
|
-
#define MULTIPLICITY 1
|
133
|
-
#define IN_FORMAT "%hu"
|
134
|
-
#define OUT_FORMAT "%hu"
|
135
|
-
#define ATOMIC_IO ATOMIC
|
136
|
-
#define ZERO 0U
|
137
|
-
#define ONE 1U
|
138
|
-
|
139
|
-
#elif defined(BASE_SHORT)
|
140
|
-
#define BASE short
|
141
|
-
#define SHORT short
|
142
|
-
#define ATOMIC short
|
143
|
-
#define MULTIPLICITY 1
|
144
|
-
#define IN_FORMAT "%hd"
|
145
|
-
#define OUT_FORMAT "%hd"
|
146
|
-
#define ATOMIC_IO ATOMIC
|
147
|
-
#define ZERO 0
|
148
|
-
#define ONE 1
|
149
|
-
|
150
|
-
#elif defined(BASE_UCHAR)
|
151
|
-
#define BASE unsigned char
|
152
|
-
#define SHORT uchar
|
153
|
-
#define ATOMIC unsigned char
|
154
|
-
#define MULTIPLICITY 1
|
155
|
-
#define IN_FORMAT "%u"
|
156
|
-
#define OUT_FORMAT "%u"
|
157
|
-
#define ATOMIC_IO unsigned int
|
158
|
-
#define ZERO 0U
|
159
|
-
#define ONE 1U
|
160
|
-
|
161
|
-
#elif defined(BASE_CHAR)
|
162
|
-
#define BASE char
|
163
|
-
#define SHORT char
|
164
|
-
#define ATOMIC char
|
165
|
-
#define MULTIPLICITY 1
|
166
|
-
#define IN_FORMAT "%d"
|
167
|
-
#define OUT_FORMAT "%d"
|
168
|
-
#define ATOMIC_IO int
|
169
|
-
#define ZERO 0
|
170
|
-
#define ONE 1
|
171
|
-
|
172
|
-
#else
|
173
|
-
#error unknown BASE_ directive in source.h
|
174
|
-
#endif
|
175
|
-
|
176
|
-
#define CONCAT2x(a,b) a ## _ ## b
|
177
|
-
#define CONCAT2(a,b) CONCAT2x(a,b)
|
178
|
-
#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
|
179
|
-
#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
|
180
|
-
#define CONCAT4x(a,b,c,d) a ## _ ## b ## _ ## c ## _ ## d
|
181
|
-
#define CONCAT4(a,b,c,d) CONCAT4x(a,b,c,d)
|
182
|
-
|
183
|
-
#ifndef USE_QUALIFIER
|
184
|
-
#define QUALIFIER
|
185
|
-
#endif
|
186
|
-
|
187
|
-
#ifdef USE_QUALIFIER
|
188
|
-
#if defined(BASE_DOUBLE)
|
189
|
-
#define FUNCTION(dir,name) CONCAT3(dir,QUALIFIER,name)
|
190
|
-
#define GSL_TYPE(dir) dir
|
191
|
-
#define VIEW(dir,name) CONCAT2(dir,name)
|
192
|
-
#define QUALIFIED_GSL_TYPE(dir) QUALIFIER dir
|
193
|
-
#define QUALIFIED_VIEW(dir,name) CONCAT3(dir,QUALIFIER,name)
|
194
|
-
#else
|
195
|
-
#define FUNCTION(a,c) CONCAT4(a,SHORT,QUALIFIER,c)
|
196
|
-
#define GSL_TYPE(dir) CONCAT2(dir,SHORT)
|
197
|
-
#define VIEW(dir,name) CONCAT3(dir,SHORT,name)
|
198
|
-
#define QUALIFIED_GSL_TYPE(dir) QUALIFIER CONCAT2(dir,SHORT)
|
199
|
-
#define QUALIFIED_VIEW(dir,name) CONCAT4(dir,SHORT,QUALIFIER,name)
|
200
|
-
#endif
|
201
|
-
#if defined(BASE_GSL_COMPLEX)
|
202
|
-
#define REAL_GSL_TYPE(dir) dir
|
203
|
-
#define REAL_VIEW(dir,name) CONCAT2(dir,name)
|
204
|
-
#define QUALIFIED_REAL_GSL_TYPE(dir) QUALIFIER dir
|
205
|
-
#define QUALIFIED_REAL_VIEW(dir,name) CONCAT3(dir,QUALIFIER,name)
|
206
|
-
#else
|
207
|
-
#define REAL_GSL_TYPE(dir) CONCAT2(dir,SHORT_REAL)
|
208
|
-
#define REAL_VIEW(dir,name) CONCAT3(dir,SHORT_REAL,name)
|
209
|
-
#define QUALIFIED_REAL_GSL_TYPE(dir) QUALIFIER CONCAT2(dir,SHORT_REAL)
|
210
|
-
#define QUALIFIED_REAL_VIEW(dir,name) CONCAT4(dir,SHORT_REAL,QUALIFIER,name)
|
211
|
-
#endif
|
212
|
-
#else
|
213
|
-
#if defined(BASE_DOUBLE)
|
214
|
-
#define FUNCTION(dir,name) CONCAT2(dir,name)
|
215
|
-
#define GSL_TYPE(dir) dir
|
216
|
-
#define VIEW(dir,name) CONCAT2(dir,name)
|
217
|
-
#define QUALIFIED_GSL_TYPE(dir) GSL_TYPE(dir)
|
218
|
-
#define QUALIFIED_VIEW(dir,name) CONCAT2(dir,name)
|
219
|
-
#else
|
220
|
-
#define FUNCTION(a,c) CONCAT3(a,SHORT,c)
|
221
|
-
#define GSL_TYPE(dir) CONCAT2(dir,SHORT)
|
222
|
-
#define VIEW(dir,name) CONCAT3(dir,SHORT,name)
|
223
|
-
#define QUALIFIED_GSL_TYPE(dir) GSL_TYPE(dir)
|
224
|
-
#define QUALIFIED_VIEW(dir,name) CONCAT3(dir,SHORT,name)
|
225
|
-
#endif
|
226
|
-
#if defined(BASE_GSL_COMPLEX)
|
227
|
-
#define REAL_GSL_TYPE(dir) dir
|
228
|
-
#define REAL_VIEW(dir,name) CONCAT2(dir,name)
|
229
|
-
#define QUALIFIED_REAL_GSL_TYPE(dir) dir
|
230
|
-
#define QUALIFIED_REAL_VIEW(dir,name) CONCAT2(dir,name)
|
231
|
-
#else
|
232
|
-
#define REAL_GSL_TYPE(dir) CONCAT2(dir,SHORT_REAL)
|
233
|
-
#define REAL_VIEW(dir,name) CONCAT3(dir,SHORT_REAL,name)
|
234
|
-
#define QUALIFIED_REAL_GSL_TYPE(dir) CONCAT2(dir,SHORT_REAL)
|
235
|
-
#define QUALIFIED_REAL_VIEW(dir,name) CONCAT3(dir,SHORT_REAL,name)
|
236
|
-
#endif
|
237
|
-
#endif
|
238
|
-
|
239
|
-
#define STRING(x) #x
|
240
|
-
#define EXPAND(x) STRING(x)
|
241
|
-
#define NAME(x) EXPAND(GSL_TYPE(x))
|
@@ -1,1154 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
integration.c
|
3
|
-
Ruby/GSL: Ruby extension library for GSL (GNU Scientific Library)
|
4
|
-
(C) Copyright 2001-2006 by Yoshiki Tsunesada
|
5
|
-
|
6
|
-
Ruby/GSL is free software: you can redistribute it and/or modify it
|
7
|
-
under the terms of the GNU General Public License.
|
8
|
-
This library is distributed in the hope that it will be useful, but
|
9
|
-
WITHOUT ANY WARRANTY.
|
10
|
-
*/
|
11
|
-
|
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"
|
16
|
-
|
17
|
-
#ifndef CHECK_WORKSPACE
|
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
|
-
#endif
|
23
|
-
|
24
|
-
#define EPSABS_DEFAULT 0.0
|
25
|
-
#define EPSREL_DEFAULT 1e-10
|
26
|
-
#define LIMIT_DEFAULT 1000
|
27
|
-
#define KEY_DEFAULT GSL_INTEG_GAUSS61
|
28
|
-
|
29
|
-
static VALUE cgsl_integration_qaws_table, cgsl_integration_qawo_table;
|
30
|
-
|
31
|
-
static VALUE cgsl_integration_workspace;
|
32
|
-
|
33
|
-
static VALUE cgsl_integration_glfixed_table;
|
34
|
-
|
35
|
-
static int get_a_b(int argc, VALUE *argv, int argstart, double *a, double *b);
|
36
|
-
static int get_epsabs_epsrel(int argc, VALUE *argv, int argstart,
|
37
|
-
double *epsabs, double *epsrel);
|
38
|
-
static int get_a_b_epsabs_epsrel(int argc, VALUE *argv, int argstart,
|
39
|
-
double *a, double *b, double *epsabs,
|
40
|
-
double *epsrel);
|
41
|
-
static int get_limit_key_workspace(int argc, VALUE *argv, int argstart,
|
42
|
-
size_t *limit, int *key,
|
43
|
-
gsl_integration_workspace **w);
|
44
|
-
static int get_limit_workspace(int argc, VALUE *argv, int argstart,
|
45
|
-
size_t *limit,
|
46
|
-
gsl_integration_workspace **w);
|
47
|
-
static int get_epsabs_epsrel_limit_workspace(int argc, VALUE *argv, int argstart,
|
48
|
-
double *epsabs, double *epsrel,
|
49
|
-
size_t *limit,
|
50
|
-
gsl_integration_workspace **w);
|
51
|
-
|
52
|
-
static int get_a_b(int argc, VALUE *argv, int argstart, double *a, double *b)
|
53
|
-
{
|
54
|
-
int itmp;
|
55
|
-
VALUE aa, bb;
|
56
|
-
if (argstart >= argc) return argstart;
|
57
|
-
if (TYPE(argv[argstart]) == T_ARRAY) {
|
58
|
-
aa = rb_ary_entry(argv[argstart], 0);
|
59
|
-
bb = rb_ary_entry(argv[argstart], 1);
|
60
|
-
Need_Float(aa); Need_Float(bb);
|
61
|
-
// *a = RFLOAT(aa)->value;
|
62
|
-
// *b = RFLOAT(bb)->value;
|
63
|
-
*a = NUM2DBL(aa);
|
64
|
-
*b = NUM2DBL(bb);
|
65
|
-
itmp = argstart + 1;
|
66
|
-
} else {
|
67
|
-
Need_Float(argv[argstart]); Need_Float(argv[argstart+1]);
|
68
|
-
*a = NUM2DBL(argv[argstart]);
|
69
|
-
*b = NUM2DBL(argv[argstart+1]);
|
70
|
-
itmp = argstart + 2;
|
71
|
-
}
|
72
|
-
return itmp;
|
73
|
-
}
|
74
|
-
|
75
|
-
static int get_epsabs_epsrel(int argc, VALUE *argv, int argstart,
|
76
|
-
double *epsabs, double *epsrel)
|
77
|
-
{
|
78
|
-
int itmp;
|
79
|
-
VALUE aa, bb;
|
80
|
-
*epsabs = EPSABS_DEFAULT;
|
81
|
-
*epsrel = EPSREL_DEFAULT;
|
82
|
-
if (argstart >= argc) return argstart;
|
83
|
-
if (TYPE(argv[argstart]) == T_ARRAY) {
|
84
|
-
aa = rb_ary_entry(argv[argstart], 0);
|
85
|
-
bb = rb_ary_entry(argv[argstart], 1);
|
86
|
-
Need_Float(aa); Need_Float(bb);
|
87
|
-
*epsabs = NUM2DBL(aa);
|
88
|
-
*epsrel = NUM2DBL(bb);
|
89
|
-
itmp = 1;
|
90
|
-
} else {
|
91
|
-
Need_Float(argv[argstart]); Need_Float(argv[argstart+1]);
|
92
|
-
*epsabs = NUM2DBL(argv[argstart]);
|
93
|
-
*epsrel = NUM2DBL(argv[argstart+1]);
|
94
|
-
itmp = 2;
|
95
|
-
}
|
96
|
-
return argstart + itmp;
|
97
|
-
}
|
98
|
-
|
99
|
-
static int get_a_b_epsabs_epsrel(int argc, VALUE *argv, int argstart,
|
100
|
-
double *a, double *b, double *epsabs,
|
101
|
-
double *epsrel)
|
102
|
-
{
|
103
|
-
int itmp;
|
104
|
-
*epsabs = EPSABS_DEFAULT;
|
105
|
-
*epsrel = EPSREL_DEFAULT;
|
106
|
-
itmp = get_a_b(argc, argv, argstart, a, b);
|
107
|
-
itmp = get_epsabs_epsrel(argc, argv, itmp, epsabs, epsrel);
|
108
|
-
return itmp;
|
109
|
-
}
|
110
|
-
|
111
|
-
static int get_limit_key_workspace(int argc, VALUE *argv, int argstart,
|
112
|
-
size_t *limit, int *key,
|
113
|
-
gsl_integration_workspace **w)
|
114
|
-
{
|
115
|
-
int flag = 0;
|
116
|
-
switch (argc-argstart) {
|
117
|
-
case 3:
|
118
|
-
CHECK_FIXNUM(argv[argstart]);
|
119
|
-
CHECK_FIXNUM(argv[argstart+1]);
|
120
|
-
CHECK_WORKSPACE(argv[argstart+2]);
|
121
|
-
*limit = FIX2INT(argv[argstart]);
|
122
|
-
*key = FIX2INT(argv[argstart+1]);
|
123
|
-
Data_Get_Struct(argv[argstart+2], gsl_integration_workspace, *w);
|
124
|
-
flag = 0;
|
125
|
-
break;
|
126
|
-
case 1:
|
127
|
-
CHECK_FIXNUM(argv[argstart]);
|
128
|
-
*key = FIX2INT(argv[argstart]);
|
129
|
-
*limit = LIMIT_DEFAULT;
|
130
|
-
*w = gsl_integration_workspace_alloc(*limit);
|
131
|
-
flag = 1;
|
132
|
-
break;
|
133
|
-
case 2:
|
134
|
-
if (TYPE(argv[argc-1]) == T_FIXNUM) {
|
135
|
-
CHECK_FIXNUM(argv[argc-2]);
|
136
|
-
*limit = FIX2INT(argv[argc-2]);
|
137
|
-
*key = FIX2INT(argv[argc-1]);
|
138
|
-
*w = gsl_integration_workspace_alloc(*limit);
|
139
|
-
flag = 1;
|
140
|
-
} else {
|
141
|
-
CHECK_FIXNUM(argv[argc-2]);
|
142
|
-
CHECK_WORKSPACE(argv[argc-1]);
|
143
|
-
*key = FIX2INT(argv[argc-2]);
|
144
|
-
Data_Get_Struct(argv[argc-1], gsl_integration_workspace, *w);
|
145
|
-
*limit = (*w)->limit;
|
146
|
-
flag = 0;
|
147
|
-
}
|
148
|
-
break;
|
149
|
-
case 0:
|
150
|
-
*key = KEY_DEFAULT;
|
151
|
-
*limit = LIMIT_DEFAULT;
|
152
|
-
*w = gsl_integration_workspace_alloc(*limit);
|
153
|
-
flag = 1;
|
154
|
-
break;
|
155
|
-
default:
|
156
|
-
rb_raise(rb_eArgError, "wrong number of arguments");
|
157
|
-
break;
|
158
|
-
}
|
159
|
-
if (*w == NULL) rb_raise(rb_eRuntimeError, "something wrong with workspace");
|
160
|
-
return flag;
|
161
|
-
}
|
162
|
-
|
163
|
-
static int get_limit_workspace(int argc, VALUE *argv, int argstart,
|
164
|
-
size_t *limit,
|
165
|
-
gsl_integration_workspace **w)
|
166
|
-
{
|
167
|
-
int flag = 0;
|
168
|
-
|
169
|
-
switch (argc-argstart) {
|
170
|
-
case 2:
|
171
|
-
CHECK_FIXNUM(argv[argstart]);
|
172
|
-
*limit = FIX2INT(argv[argstart]);
|
173
|
-
CHECK_WORKSPACE(argv[argstart+1]);
|
174
|
-
Data_Get_Struct(argv[argstart+1], gsl_integration_workspace, *w);
|
175
|
-
flag = 0;
|
176
|
-
break;
|
177
|
-
case 0:
|
178
|
-
*limit = LIMIT_DEFAULT;
|
179
|
-
*w = gsl_integration_workspace_alloc(*limit);
|
180
|
-
flag = 1;
|
181
|
-
break;
|
182
|
-
case 1:
|
183
|
-
switch (TYPE(argv[argstart])) {
|
184
|
-
case T_FIXNUM:
|
185
|
-
case T_BIGNUM:
|
186
|
-
CHECK_FIXNUM(argv[argstart]);
|
187
|
-
*limit = FIX2INT(argv[argstart]);
|
188
|
-
*w = gsl_integration_workspace_alloc(*limit);
|
189
|
-
flag = 1;
|
190
|
-
break;
|
191
|
-
default:
|
192
|
-
CHECK_WORKSPACE(argv[argc-1]);
|
193
|
-
Data_Get_Struct(argv[argc-1], gsl_integration_workspace, *w);
|
194
|
-
*limit = (*w)->limit;
|
195
|
-
flag = 0;
|
196
|
-
break;
|
197
|
-
}
|
198
|
-
break;
|
199
|
-
default:
|
200
|
-
rb_raise(rb_eArgError, "wrong number of arguments");
|
201
|
-
break;
|
202
|
-
}
|
203
|
-
if (*w == NULL) rb_raise(rb_eRuntimeError, "something wrong with workspace");
|
204
|
-
return flag;
|
205
|
-
}
|
206
|
-
|
207
|
-
static int get_epsabs_epsrel_limit_workspace(int argc, VALUE *argv, int argstart,
|
208
|
-
double *epsabs, double *epsrel,
|
209
|
-
size_t *limit,
|
210
|
-
gsl_integration_workspace **w)
|
211
|
-
{
|
212
|
-
int flag = 0, itmp;
|
213
|
-
itmp = argstart;
|
214
|
-
*epsabs = EPSABS_DEFAULT;
|
215
|
-
*epsrel = EPSREL_DEFAULT;
|
216
|
-
*limit = LIMIT_DEFAULT;
|
217
|
-
switch (argc-itmp) {
|
218
|
-
case 0:
|
219
|
-
*w = gsl_integration_workspace_alloc(*limit);
|
220
|
-
flag = 1;
|
221
|
-
break;
|
222
|
-
case 1:
|
223
|
-
if (TYPE(argv[itmp]) == T_ARRAY) {
|
224
|
-
get_epsabs_epsrel(argc, argv, itmp, epsabs, epsrel);
|
225
|
-
*w = gsl_integration_workspace_alloc(*limit);
|
226
|
-
flag = 1;
|
227
|
-
} else {
|
228
|
-
flag = get_limit_workspace(argc, argv, itmp, limit, w);
|
229
|
-
}
|
230
|
-
break;
|
231
|
-
case 2:
|
232
|
-
case 3:
|
233
|
-
switch (TYPE(argv[itmp])) {
|
234
|
-
case T_ARRAY:
|
235
|
-
itmp = get_epsabs_epsrel(argc, argv, itmp, epsabs, epsrel);
|
236
|
-
flag = get_limit_workspace(argc, argv, itmp, limit, w);
|
237
|
-
break;
|
238
|
-
case T_FLOAT:
|
239
|
-
get_epsabs_epsrel(argc, argv, itmp, epsabs, epsrel);
|
240
|
-
*w = gsl_integration_workspace_alloc(*limit);
|
241
|
-
flag = 1;
|
242
|
-
break;
|
243
|
-
default:
|
244
|
-
flag = get_limit_workspace(argc, argv, itmp, limit, w);
|
245
|
-
break;
|
246
|
-
}
|
247
|
-
break;
|
248
|
-
case 4:
|
249
|
-
itmp = get_epsabs_epsrel(argc, argv, itmp, epsabs, epsrel);
|
250
|
-
flag = get_limit_workspace(argc, argv, itmp, limit, w);
|
251
|
-
break;
|
252
|
-
default:
|
253
|
-
rb_raise(rb_eArgError, "wrong number of arguments");
|
254
|
-
break;
|
255
|
-
}
|
256
|
-
if (*w == NULL) rb_raise(rb_eRuntimeError, "something wrong with workspace");
|
257
|
-
return flag;
|
258
|
-
}
|
259
|
-
|
260
|
-
static VALUE rb_gsl_integration_qng(int argc, VALUE *argv, VALUE obj)
|
261
|
-
{
|
262
|
-
double a, b, epsabs = EPSABS_DEFAULT, epsrel = EPSREL_DEFAULT;
|
263
|
-
double result, abserr;
|
264
|
-
size_t neval;
|
265
|
-
gsl_function *F = NULL;
|
266
|
-
int status;
|
267
|
-
// local variable 'itmp' declared and set, but never used
|
268
|
-
//int itmp;
|
269
|
-
|
270
|
-
if (argc < 1) rb_raise(rb_eArgError,
|
271
|
-
"wrong number of arguments (%d for >= 1)", argc);
|
272
|
-
switch (TYPE(obj)) {
|
273
|
-
case T_MODULE: case T_CLASS: case T_OBJECT:
|
274
|
-
CHECK_FUNCTION(argv[0]);
|
275
|
-
Data_Get_Struct(argv[0], gsl_function, F);
|
276
|
-
/*itmp =*/ get_a_b_epsabs_epsrel(argc, argv, 1, &a, &b, &epsabs, &epsrel);
|
277
|
-
break;
|
278
|
-
default:
|
279
|
-
/*itmp =*/ get_a_b_epsabs_epsrel(argc, argv, 0, &a, &b, &epsabs, &epsrel);
|
280
|
-
Data_Get_Struct(obj, gsl_function, F);
|
281
|
-
break;
|
282
|
-
}
|
283
|
-
status = gsl_integration_qng(F, a, b, epsabs, epsrel,
|
284
|
-
&result, &abserr, &neval);
|
285
|
-
|
286
|
-
return rb_ary_new3(4, rb_float_new(result), rb_float_new(abserr),
|
287
|
-
INT2FIX(neval), INT2FIX(status));
|
288
|
-
}
|
289
|
-
|
290
|
-
static VALUE rb_gsl_integration_qag(int argc, VALUE *argv, VALUE obj)
|
291
|
-
{
|
292
|
-
double a, b, epsabs = EPSABS_DEFAULT, epsrel = EPSREL_DEFAULT;
|
293
|
-
double result, abserr;
|
294
|
-
size_t limit = LIMIT_DEFAULT;
|
295
|
-
gsl_function *F = NULL;
|
296
|
-
gsl_integration_workspace *w = NULL;
|
297
|
-
int key = KEY_DEFAULT, status, intervals, itmp, flag = 0;
|
298
|
-
if (argc < 1) rb_raise(rb_eArgError,
|
299
|
-
"wrong number of arguments (%d for >= 1)", argc);
|
300
|
-
switch (TYPE(obj)) {
|
301
|
-
case T_MODULE: case T_CLASS: case T_OBJECT:
|
302
|
-
CHECK_FUNCTION(argv[0]);
|
303
|
-
Data_Get_Struct(argv[0], gsl_function, F);
|
304
|
-
if (argc == 3) {
|
305
|
-
CHECK_FIXNUM(argv[2]);
|
306
|
-
get_a_b(argc, argv, 1, &a, &b);
|
307
|
-
key = FIX2INT(argv[2]);
|
308
|
-
w = gsl_integration_workspace_alloc(limit);
|
309
|
-
flag = 1;
|
310
|
-
} else if (argc == 4) {
|
311
|
-
CHECK_FIXNUM(argv[3]);
|
312
|
-
get_a_b(argc, argv, 1, &a, &b);
|
313
|
-
key = FIX2INT(argv[3]);
|
314
|
-
w = gsl_integration_workspace_alloc(limit);
|
315
|
-
flag = 1;
|
316
|
-
} else {
|
317
|
-
itmp = get_a_b_epsabs_epsrel(argc, argv, 1, &a, &b, &epsabs, &epsrel);
|
318
|
-
flag = get_limit_key_workspace(argc, argv, itmp, &limit, &key, &w);
|
319
|
-
}
|
320
|
-
break;
|
321
|
-
default:
|
322
|
-
if (argc == 2) {
|
323
|
-
if (FIXNUM_P(argv[1])) {
|
324
|
-
key = FIX2INT(argv[1]);
|
325
|
-
w = gsl_integration_workspace_alloc(limit);
|
326
|
-
flag = 1;
|
327
|
-
} else if (rb_obj_is_kind_of(argv[1], cgsl_integration_workspace)) {
|
328
|
-
Data_Get_Struct(argv[1], gsl_integration_workspace, w);
|
329
|
-
flag = 0;
|
330
|
-
} else {
|
331
|
-
rb_raise(rb_eTypeError, "Key or Workspace expected");
|
332
|
-
}
|
333
|
-
itmp = get_a_b(argc, argv, 0, &a, &b);
|
334
|
-
} else if (argc == 3) {
|
335
|
-
if (FIXNUM_P(argv[2])) {
|
336
|
-
key = FIX2INT(argv[2]);
|
337
|
-
w = gsl_integration_workspace_alloc(limit);
|
338
|
-
flag = 1;
|
339
|
-
} else if (rb_obj_is_kind_of(argv[2], cgsl_integration_workspace)) {
|
340
|
-
Data_Get_Struct(argv[2], gsl_integration_workspace, w);
|
341
|
-
flag = 0;
|
342
|
-
} else {
|
343
|
-
rb_raise(rb_eTypeError, "Key or Workspace expected");
|
344
|
-
}
|
345
|
-
itmp = get_a_b(argc, argv, 0, &a, &b);
|
346
|
-
} else {
|
347
|
-
itmp = get_a_b_epsabs_epsrel(argc, argv, 0, &a, &b, &epsabs, &epsrel);
|
348
|
-
flag = get_limit_key_workspace(argc, argv, itmp, &limit, &key, &w);
|
349
|
-
}
|
350
|
-
Data_Get_Struct(obj, gsl_function, F);
|
351
|
-
break;
|
352
|
-
}
|
353
|
-
status = gsl_integration_qag(F, a, b, epsabs, epsrel, limit, key, w,
|
354
|
-
&result, &abserr);
|
355
|
-
intervals = w->size;
|
356
|
-
if (flag == 1) gsl_integration_workspace_free(w);
|
357
|
-
return rb_ary_new3(4, rb_float_new(result), rb_float_new(abserr),
|
358
|
-
INT2FIX(intervals), INT2FIX(status));
|
359
|
-
}
|
360
|
-
|
361
|
-
static VALUE rb_gsl_integration_qags(int argc, VALUE *argv, VALUE obj)
|
362
|
-
{
|
363
|
-
double a, b, epsabs = EPSABS_DEFAULT, epsrel = EPSREL_DEFAULT;
|
364
|
-
double result, abserr;
|
365
|
-
size_t limit = LIMIT_DEFAULT;
|
366
|
-
gsl_function *F = NULL;
|
367
|
-
gsl_integration_workspace *w = NULL;
|
368
|
-
int status, intervals, flag = 0, itmp;
|
369
|
-
switch (TYPE(obj)) {
|
370
|
-
case T_MODULE: case T_CLASS: case T_OBJECT:
|
371
|
-
CHECK_FUNCTION(argv[0]);
|
372
|
-
Data_Get_Struct(argv[0], gsl_function, F);
|
373
|
-
itmp = get_a_b(argc, argv, 1, &a, &b);
|
374
|
-
break;
|
375
|
-
default:
|
376
|
-
Data_Get_Struct(obj, gsl_function, F);
|
377
|
-
itmp = get_a_b(argc, argv, 0, &a, &b);
|
378
|
-
break;
|
379
|
-
}
|
380
|
-
flag = get_epsabs_epsrel_limit_workspace(argc, argv, itmp, &epsabs, &epsrel,
|
381
|
-
&limit, &w);
|
382
|
-
|
383
|
-
status = gsl_integration_qags(F, a, b, epsabs, epsrel, limit, w,
|
384
|
-
&result, &abserr);
|
385
|
-
intervals = w->size;
|
386
|
-
if (flag == 1) gsl_integration_workspace_free(w);
|
387
|
-
return rb_ary_new3(4, rb_float_new(result), rb_float_new(abserr),
|
388
|
-
INT2FIX(intervals), INT2FIX(status));
|
389
|
-
}
|
390
|
-
|
391
|
-
static VALUE rb_gsl_integration_qagp(int argc, VALUE *argv, VALUE obj)
|
392
|
-
{
|
393
|
-
double epsabs, epsrel;
|
394
|
-
double result, abserr;
|
395
|
-
size_t limit;
|
396
|
-
gsl_function *F = NULL;
|
397
|
-
gsl_vector *v = NULL;
|
398
|
-
gsl_integration_workspace *w = NULL;
|
399
|
-
int status, intervals, flag = 0, flag2 = 0, itmp;
|
400
|
-
switch (TYPE(obj)) {
|
401
|
-
case T_MODULE: case T_CLASS: case T_OBJECT:
|
402
|
-
CHECK_FUNCTION(argv[0]);
|
403
|
-
Data_Get_Struct(argv[0], gsl_function, F);
|
404
|
-
itmp = 1;
|
405
|
-
break;
|
406
|
-
default:
|
407
|
-
Data_Get_Struct(obj, gsl_function, F);
|
408
|
-
itmp = 0;
|
409
|
-
break;
|
410
|
-
}
|
411
|
-
if (TYPE(argv[itmp]) == T_ARRAY) {
|
412
|
-
v = make_cvector_from_rarray(argv[itmp]);
|
413
|
-
flag2 = 1;
|
414
|
-
} else {
|
415
|
-
Data_Get_Vector(argv[itmp], v);
|
416
|
-
flag2 = 0;
|
417
|
-
}
|
418
|
-
itmp += 1;
|
419
|
-
flag = get_epsabs_epsrel_limit_workspace(argc, argv, itmp, &epsabs, &epsrel,
|
420
|
-
&limit, &w);
|
421
|
-
|
422
|
-
status = gsl_integration_qagp(F, v->data, v->size, epsabs, epsrel, limit, w,
|
423
|
-
&result, &abserr);
|
424
|
-
intervals = w->size;
|
425
|
-
if (flag == 1) gsl_integration_workspace_free(w);
|
426
|
-
if (flag2 == 1) gsl_vector_free(v);
|
427
|
-
return rb_ary_new3(4, rb_float_new(result), rb_float_new(abserr),
|
428
|
-
INT2FIX(intervals), INT2FIX(status));
|
429
|
-
}
|
430
|
-
|
431
|
-
/* (-infty --- +infty) */
|
432
|
-
static VALUE rb_gsl_integration_qagi(int argc, VALUE *argv, VALUE obj)
|
433
|
-
{
|
434
|
-
double epsabs, epsrel;
|
435
|
-
double result, abserr;
|
436
|
-
size_t limit;
|
437
|
-
gsl_function *F = NULL;
|
438
|
-
gsl_integration_workspace *w = NULL;
|
439
|
-
int status, intervals, flag = 0, itmp;
|
440
|
-
switch (TYPE(obj)) {
|
441
|
-
case T_MODULE: case T_CLASS: case T_OBJECT:
|
442
|
-
CHECK_FUNCTION(argv[0]);
|
443
|
-
Data_Get_Struct(argv[0], gsl_function, F);
|
444
|
-
itmp = 1;
|
445
|
-
break;
|
446
|
-
default:
|
447
|
-
Data_Get_Struct(obj, gsl_function, F);
|
448
|
-
itmp = 0;
|
449
|
-
break;
|
450
|
-
}
|
451
|
-
flag = get_epsabs_epsrel_limit_workspace(argc, argv, itmp, &epsabs, &epsrel,
|
452
|
-
&limit, &w);
|
453
|
-
status = gsl_integration_qagi(F, epsabs, epsrel, limit, w,
|
454
|
-
&result, &abserr);
|
455
|
-
intervals = w->size;
|
456
|
-
if (flag == 1) gsl_integration_workspace_free(w);
|
457
|
-
return rb_ary_new3(4, rb_float_new(result), rb_float_new(abserr),
|
458
|
-
INT2FIX(intervals), INT2FIX(status));
|
459
|
-
}
|
460
|
-
|
461
|
-
/* (a --- +infty) */
|
462
|
-
static VALUE rb_gsl_integration_qagiu(int argc, VALUE *argv, VALUE obj)
|
463
|
-
{
|
464
|
-
double a, epsabs, epsrel;
|
465
|
-
double result, abserr;
|
466
|
-
size_t limit;
|
467
|
-
gsl_function *F = NULL;
|
468
|
-
gsl_integration_workspace *w = NULL;
|
469
|
-
int status, intervals, flag = 0, itmp;
|
470
|
-
switch (TYPE(obj)) {
|
471
|
-
case T_MODULE: case T_CLASS: case T_OBJECT:
|
472
|
-
CHECK_FUNCTION(argv[0]);
|
473
|
-
Data_Get_Struct(argv[0], gsl_function, F);
|
474
|
-
itmp = 1;
|
475
|
-
break;
|
476
|
-
default:
|
477
|
-
Data_Get_Struct(obj, gsl_function, F);
|
478
|
-
itmp = 0;
|
479
|
-
break;
|
480
|
-
}
|
481
|
-
Need_Float(argv[itmp]);
|
482
|
-
a = NUM2DBL(argv[itmp]);
|
483
|
-
itmp += 1;
|
484
|
-
flag = get_epsabs_epsrel_limit_workspace(argc, argv, itmp, &epsabs, &epsrel,
|
485
|
-
&limit, &w);
|
486
|
-
status = gsl_integration_qagiu(F, a, epsabs, epsrel, limit, w,
|
487
|
-
&result, &abserr);
|
488
|
-
intervals = w->size;
|
489
|
-
if (flag == 1) gsl_integration_workspace_free(w);
|
490
|
-
return rb_ary_new3(4, rb_float_new(result), rb_float_new(abserr),
|
491
|
-
INT2FIX(intervals), INT2FIX(status));
|
492
|
-
}
|
493
|
-
|
494
|
-
/* (-infty --- b) */
|
495
|
-
static VALUE rb_gsl_integration_qagil(int argc, VALUE *argv, VALUE obj)
|
496
|
-
{
|
497
|
-
double b, epsabs, epsrel;
|
498
|
-
double result, abserr;
|
499
|
-
size_t limit;
|
500
|
-
gsl_function *F = NULL;
|
501
|
-
gsl_integration_workspace *w = NULL;
|
502
|
-
int status, intervals, flag = 0, itmp;
|
503
|
-
switch (TYPE(obj)) {
|
504
|
-
case T_MODULE: case T_CLASS: case T_OBJECT:
|
505
|
-
CHECK_FUNCTION(argv[0]);
|
506
|
-
Data_Get_Struct(argv[0], gsl_function, F);
|
507
|
-
itmp = 1;
|
508
|
-
break;
|
509
|
-
default:
|
510
|
-
Data_Get_Struct(obj, gsl_function, F);
|
511
|
-
itmp = 0;
|
512
|
-
break;
|
513
|
-
}
|
514
|
-
Need_Float(argv[itmp]);
|
515
|
-
b = NUM2DBL(argv[itmp]);
|
516
|
-
flag = get_epsabs_epsrel_limit_workspace(argc, argv, itmp+1, &epsabs, &epsrel,
|
517
|
-
&limit, &w);
|
518
|
-
Data_Get_Struct(obj, gsl_function, F);
|
519
|
-
|
520
|
-
status = gsl_integration_qagil(F, b, epsabs, epsrel, limit, w,
|
521
|
-
&result, &abserr);
|
522
|
-
intervals = w->size;
|
523
|
-
if (flag == 1) gsl_integration_workspace_free(w);
|
524
|
-
return rb_ary_new3(4, rb_float_new(result), rb_float_new(abserr),
|
525
|
-
INT2FIX(intervals), INT2FIX(status));
|
526
|
-
}
|
527
|
-
|
528
|
-
static VALUE rb_gsl_integration_qawc(int argc, VALUE *argv, VALUE obj)
|
529
|
-
{
|
530
|
-
double a, b, c, epsabs, epsrel;
|
531
|
-
double result, abserr;
|
532
|
-
size_t limit;
|
533
|
-
gsl_function *F = NULL;
|
534
|
-
gsl_integration_workspace *w = NULL;
|
535
|
-
int status, intervals, itmp, flag = 0;
|
536
|
-
switch (TYPE(obj)) {
|
537
|
-
case T_MODULE: case T_CLASS: case T_OBJECT:
|
538
|
-
CHECK_FUNCTION(argv[0]);
|
539
|
-
Data_Get_Struct(argv[0], gsl_function, F);
|
540
|
-
itmp = 1;
|
541
|
-
break;
|
542
|
-
default:
|
543
|
-
Data_Get_Struct(obj, gsl_function, F);
|
544
|
-
itmp = 0;
|
545
|
-
break;
|
546
|
-
}
|
547
|
-
itmp = get_a_b(argc, argv, itmp, &a, &b);
|
548
|
-
if (argc-itmp <= 0) rb_raise(rb_eArgError, "The pole is not given");
|
549
|
-
Need_Float(argv[itmp]);
|
550
|
-
c = NUM2DBL(argv[itmp]);
|
551
|
-
flag = get_epsabs_epsrel_limit_workspace(argc, argv, itmp+1, &epsabs, &epsrel,
|
552
|
-
&limit, &w);
|
553
|
-
status = gsl_integration_qawc(F, a, b, c, epsabs, epsrel, limit, w, &result, &abserr);
|
554
|
-
intervals = w->size;
|
555
|
-
if (flag == 1) gsl_integration_workspace_free(w);
|
556
|
-
return rb_ary_new3(4, rb_float_new(result), rb_float_new(abserr), INT2FIX(intervals),
|
557
|
-
INT2FIX(status));
|
558
|
-
}
|
559
|
-
|
560
|
-
VALUE rb_gsl_integration_qaws_table_alloc(int argc, VALUE *argv, VALUE klass)
|
561
|
-
{
|
562
|
-
gsl_integration_qaws_table *t = NULL;
|
563
|
-
VALUE alpha, beta, mu, nu;
|
564
|
-
|
565
|
-
if (TYPE(argv[0]) == T_ARRAY) {
|
566
|
-
alpha = rb_ary_entry(argv[0], 0);
|
567
|
-
beta = rb_ary_entry(argv[0], 1);
|
568
|
-
mu = rb_ary_entry(argv[0], 2);
|
569
|
-
nu = rb_ary_entry(argv[0], 3);
|
570
|
-
} else {
|
571
|
-
Need_Float(argv[0]); Need_Float(argv[1]);
|
572
|
-
CHECK_FIXNUM(argv[2]); CHECK_FIXNUM(argv[3]);
|
573
|
-
alpha = argv[0];
|
574
|
-
beta = argv[1];
|
575
|
-
mu = argv[2];
|
576
|
-
nu = argv[3];
|
577
|
-
}
|
578
|
-
t = gsl_integration_qaws_table_alloc(NUM2DBL(alpha), NUM2DBL(beta),
|
579
|
-
FIX2INT(mu), FIX2INT(nu));
|
580
|
-
return Data_Wrap_Struct(klass, 0, gsl_integration_qaws_table_free, t);
|
581
|
-
}
|
582
|
-
|
583
|
-
static VALUE rb_gsl_integration_qaws_table_set(int argc, VALUE *argv, VALUE obj)
|
584
|
-
{
|
585
|
-
gsl_integration_qaws_table *t = NULL;
|
586
|
-
double alpha, beta;
|
587
|
-
int mu, nu, type;
|
588
|
-
if (argc != 1 && argc != 4)
|
589
|
-
rb_raise(rb_eArgError, "wrong number of argument (%d for 1 or 3)", argc);
|
590
|
-
type = TYPE(argv[0]);
|
591
|
-
Data_Get_Struct(obj, gsl_integration_qaws_table, t);
|
592
|
-
|
593
|
-
if (type == T_FIXNUM || type == T_BIGNUM || type == T_FLOAT) {
|
594
|
-
alpha = NUM2DBL(argv[0]);
|
595
|
-
beta = NUM2DBL(argv[1]);
|
596
|
-
mu = FIX2INT(argv[2]);
|
597
|
-
nu = FIX2INT(argv[3]);
|
598
|
-
} else if (type == T_ARRAY) {
|
599
|
-
alpha = NUM2DBL(rb_ary_entry(argv[0], 0));
|
600
|
-
beta = NUM2DBL(rb_ary_entry(argv[0], 1));
|
601
|
-
mu = FIX2INT(rb_ary_entry(argv[0], 2));
|
602
|
-
nu = FIX2INT(rb_ary_entry(argv[0], 3));
|
603
|
-
} else {
|
604
|
-
rb_raise(rb_eTypeError, "wrong argument type %s", rb_class2name(CLASS_OF(argv[0])));
|
605
|
-
}
|
606
|
-
gsl_integration_qaws_table_set(t, alpha, beta, mu, nu);
|
607
|
-
return obj;
|
608
|
-
}
|
609
|
-
|
610
|
-
static VALUE rb_gsl_integration_qaws_table_to_a(VALUE obj)
|
611
|
-
{
|
612
|
-
gsl_integration_qaws_table *t = NULL;
|
613
|
-
VALUE ary;
|
614
|
-
Data_Get_Struct(obj, gsl_integration_qaws_table, t);
|
615
|
-
ary = rb_ary_new2(4);
|
616
|
-
rb_ary_store(ary, 0, rb_float_new(t->alpha));
|
617
|
-
rb_ary_store(ary, 1, rb_float_new(t->beta));
|
618
|
-
rb_ary_store(ary, 2, INT2FIX(t->mu));
|
619
|
-
rb_ary_store(ary, 3, INT2FIX(t->nu));
|
620
|
-
return ary;
|
621
|
-
}
|
622
|
-
|
623
|
-
static gsl_integration_qaws_table* make_qaws_table(VALUE ary);
|
624
|
-
static VALUE rb_gsl_ary_to_integration_qaws_table(VALUE ary)
|
625
|
-
{
|
626
|
-
gsl_integration_qaws_table *t = NULL;
|
627
|
-
t = make_qaws_table(ary);
|
628
|
-
return Data_Wrap_Struct(cgsl_integration_qaws_table,
|
629
|
-
0, gsl_integration_qaws_table_free, t);
|
630
|
-
}
|
631
|
-
|
632
|
-
static gsl_integration_qaws_table* make_qaws_table(VALUE ary)
|
633
|
-
{
|
634
|
-
double alpha, beta;
|
635
|
-
int mu, nu;
|
636
|
-
alpha = NUM2DBL(rb_ary_entry(ary, 0));
|
637
|
-
beta = NUM2DBL(rb_ary_entry(ary, 1));
|
638
|
-
mu = FIX2INT(rb_ary_entry(ary, 2));
|
639
|
-
nu = FIX2INT(rb_ary_entry(ary, 3));
|
640
|
-
return gsl_integration_qaws_table_alloc(alpha, beta, mu, nu);
|
641
|
-
}
|
642
|
-
|
643
|
-
static VALUE rb_gsl_integration_qaws(int argc, VALUE *argv, VALUE obj)
|
644
|
-
{
|
645
|
-
double a, b, epsabs, epsrel;
|
646
|
-
double result, abserr;
|
647
|
-
size_t limit;
|
648
|
-
gsl_function *F = NULL;
|
649
|
-
gsl_integration_workspace *w = NULL;
|
650
|
-
gsl_integration_qaws_table *t = NULL;
|
651
|
-
int status, intervals, itmp, flag = 0, flagt = 0;
|
652
|
-
switch (TYPE(obj)) {
|
653
|
-
case T_MODULE: case T_CLASS: case T_OBJECT:
|
654
|
-
if (argc < 2) rb_raise(rb_eArgError, "too few arguments");
|
655
|
-
CHECK_FUNCTION(argv[0]);
|
656
|
-
Data_Get_Struct(argv[0], gsl_function, F);
|
657
|
-
itmp = 1;
|
658
|
-
break;
|
659
|
-
default:
|
660
|
-
if (argc < 1) rb_raise(rb_eArgError, "too few arguments");
|
661
|
-
Data_Get_Struct(obj, gsl_function, F);
|
662
|
-
itmp = 0;
|
663
|
-
break;
|
664
|
-
}
|
665
|
-
itmp = get_a_b(argc, argv, itmp, &a, &b);
|
666
|
-
|
667
|
-
if (TYPE(argv[itmp]) == T_ARRAY) {
|
668
|
-
flagt = 1;
|
669
|
-
t = make_qaws_table(argv[itmp]);
|
670
|
-
} else {
|
671
|
-
flagt = 0;
|
672
|
-
if (!rb_obj_is_kind_of(argv[itmp], cgsl_integration_qaws_table))
|
673
|
-
rb_raise(rb_eTypeError, "Integration::QAWS_Table expected");
|
674
|
-
Data_Get_Struct(argv[itmp], gsl_integration_qaws_table, t);
|
675
|
-
}
|
676
|
-
flag = get_epsabs_epsrel_limit_workspace(argc, argv, itmp+1, &epsabs, &epsrel,
|
677
|
-
&limit, &w);
|
678
|
-
status = gsl_integration_qaws(F, a, b, t, epsabs, epsrel, limit, w, &result, &abserr);
|
679
|
-
intervals = w->size;
|
680
|
-
if (flag == 1) gsl_integration_workspace_free(w);
|
681
|
-
if (flagt == 1) gsl_integration_qaws_table_free(t);
|
682
|
-
return rb_ary_new3(4, rb_float_new(result), rb_float_new(abserr), INT2FIX(intervals),
|
683
|
-
INT2FIX(status));
|
684
|
-
}
|
685
|
-
|
686
|
-
static gsl_integration_qawo_table* make_qawo_table(VALUE ary);
|
687
|
-
|
688
|
-
static VALUE rb_gsl_integration_qawo_table_alloc(int argc, VALUE *argv,
|
689
|
-
VALUE klass)
|
690
|
-
{
|
691
|
-
gsl_integration_qawo_table *t = NULL;
|
692
|
-
double omega, L;
|
693
|
-
enum gsl_integration_qawo_enum sine;
|
694
|
-
size_t n;
|
695
|
-
if (argc != 1 && argc != 4)
|
696
|
-
rb_raise(rb_eArgError, "wrong nubmer of arguments (%d for 1 or 4)", argc);
|
697
|
-
if (TYPE(argv[0]) == T_ARRAY) {
|
698
|
-
omega = NUM2DBL(rb_ary_entry(argv[0], 0));
|
699
|
-
L = NUM2DBL(rb_ary_entry(argv[0], 1));
|
700
|
-
sine = FIX2INT(rb_ary_entry(argv[0], 2));
|
701
|
-
n = FIX2INT(rb_ary_entry(argv[0], 3));
|
702
|
-
} else {
|
703
|
-
omega = NUM2DBL(argv[0]);
|
704
|
-
L = NUM2DBL(argv[1]);
|
705
|
-
sine = FIX2INT(argv[2]);
|
706
|
-
n = FIX2INT(argv[3]);
|
707
|
-
}
|
708
|
-
t = gsl_integration_qawo_table_alloc(omega, L, sine, n);
|
709
|
-
|
710
|
-
return Data_Wrap_Struct(klass, 0, gsl_integration_qawo_table_free, t);
|
711
|
-
}
|
712
|
-
|
713
|
-
static VALUE rb_gsl_integration_qawo_table_to_a(VALUE obj)
|
714
|
-
{
|
715
|
-
gsl_integration_qawo_table *t = NULL;
|
716
|
-
VALUE ary;
|
717
|
-
Data_Get_Struct(obj, gsl_integration_qawo_table, t);
|
718
|
-
ary = rb_ary_new2(4);
|
719
|
-
rb_ary_store(ary, 0, rb_float_new(t->omega));
|
720
|
-
rb_ary_store(ary, 1, rb_float_new(t->L));
|
721
|
-
rb_ary_store(ary, 2, INT2FIX(t->sine));
|
722
|
-
rb_ary_store(ary, 3, INT2FIX(t->n));
|
723
|
-
return ary;
|
724
|
-
}
|
725
|
-
|
726
|
-
static VALUE rb_gsl_ary_to_integration_qawo_table(VALUE ary)
|
727
|
-
{
|
728
|
-
gsl_integration_qawo_table *t = NULL;
|
729
|
-
t = make_qawo_table(ary);
|
730
|
-
return Data_Wrap_Struct(cgsl_integration_qawo_table,
|
731
|
-
0, gsl_integration_qawo_table_free, t);
|
732
|
-
}
|
733
|
-
|
734
|
-
static gsl_integration_qawo_table* make_qawo_table(VALUE ary)
|
735
|
-
{
|
736
|
-
double omega, L;
|
737
|
-
enum gsl_integration_qawo_enum sine;
|
738
|
-
size_t n;
|
739
|
-
omega = NUM2DBL(rb_ary_entry(ary, 0));
|
740
|
-
L = NUM2DBL(rb_ary_entry(ary, 1));
|
741
|
-
sine = FIX2INT(rb_ary_entry(ary, 2));
|
742
|
-
n = FIX2INT(rb_ary_entry(ary, 3));
|
743
|
-
return gsl_integration_qawo_table_alloc(omega, L, sine, n);
|
744
|
-
}
|
745
|
-
|
746
|
-
static VALUE rb_gsl_integration_qawo_table_set(int argc, VALUE *argv, VALUE obj)
|
747
|
-
{
|
748
|
-
gsl_integration_qawo_table *t = NULL;
|
749
|
-
double omega, L;
|
750
|
-
enum gsl_integration_qawo_enum sine;
|
751
|
-
int type;
|
752
|
-
if (argc != 1 && argc != 3)
|
753
|
-
rb_raise(rb_eArgError, "wrong number of argument (%d for 1 or 3)", argc);
|
754
|
-
type = TYPE(argv[0]);
|
755
|
-
Data_Get_Struct(obj, gsl_integration_qawo_table, t);
|
756
|
-
if (type == T_FIXNUM || type == T_BIGNUM || type == T_FLOAT) {
|
757
|
-
omega = NUM2DBL(argv[0]);
|
758
|
-
L = NUM2DBL(argv[1]);
|
759
|
-
sine = FIX2INT(argv[2]);
|
760
|
-
} else if (type == T_ARRAY) {
|
761
|
-
omega = NUM2DBL(rb_ary_entry(argv[0], 0));
|
762
|
-
L = NUM2DBL(rb_ary_entry(argv[0], 1));
|
763
|
-
sine = FIX2INT(rb_ary_entry(argv[0], 2));
|
764
|
-
} else {
|
765
|
-
rb_raise(rb_eTypeError, "wrong argument type %s", rb_class2name(CLASS_OF(argv[0])));
|
766
|
-
}
|
767
|
-
gsl_integration_qawo_table_set(t, omega, L, sine);
|
768
|
-
return obj;
|
769
|
-
}
|
770
|
-
|
771
|
-
static VALUE rb_gsl_integration_qawo_table_set_length(VALUE obj, VALUE L)
|
772
|
-
{
|
773
|
-
gsl_integration_qawo_table *t = NULL;
|
774
|
-
Need_Float(L);
|
775
|
-
Data_Get_Struct(obj, gsl_integration_qawo_table, t);
|
776
|
-
gsl_integration_qawo_table_set_length(t, NUM2DBL(L));
|
777
|
-
return obj;
|
778
|
-
}
|
779
|
-
|
780
|
-
static int get_qawo_table(VALUE tt, gsl_integration_qawo_table **t);
|
781
|
-
|
782
|
-
static VALUE rb_gsl_integration_qawo(int argc, VALUE *argv, VALUE obj)
|
783
|
-
{
|
784
|
-
double a, epsabs, epsrel;
|
785
|
-
double result, abserr;
|
786
|
-
size_t limit;
|
787
|
-
gsl_function *F = NULL;
|
788
|
-
gsl_integration_workspace *w = NULL;
|
789
|
-
gsl_integration_qawo_table *t = NULL;
|
790
|
-
int status, intervals, itmp, flag = 0, flagt = 0;
|
791
|
-
switch (TYPE(obj)) {
|
792
|
-
case T_MODULE: case T_CLASS: case T_OBJECT:
|
793
|
-
if (argc < 2) rb_raise(rb_eArgError, "too few arguments");
|
794
|
-
CHECK_FUNCTION(argv[0]);
|
795
|
-
Data_Get_Struct(argv[0], gsl_function, F);
|
796
|
-
itmp = 1;
|
797
|
-
break;
|
798
|
-
default:
|
799
|
-
if (argc < 1) rb_raise(rb_eArgError, "too few arguments");
|
800
|
-
Data_Get_Struct(obj, gsl_function, F);
|
801
|
-
itmp = 0;
|
802
|
-
break;
|
803
|
-
}
|
804
|
-
Need_Float(argv[itmp]);
|
805
|
-
a = NUM2DBL(argv[itmp]);
|
806
|
-
flagt = get_qawo_table(argv[argc-1], &t);
|
807
|
-
flag = get_epsabs_epsrel_limit_workspace(argc-1, argv, itmp+1, &epsabs, &epsrel,
|
808
|
-
&limit, &w);
|
809
|
-
status = gsl_integration_qawo(F, a, epsabs, epsrel, limit, w, t, &result, &abserr);
|
810
|
-
intervals = w->size;
|
811
|
-
if (flag == 1) gsl_integration_workspace_free(w);
|
812
|
-
if (flagt == 1) gsl_integration_qawo_table_free(t);
|
813
|
-
return rb_ary_new3(4, rb_float_new(result), rb_float_new(abserr), INT2FIX(intervals),
|
814
|
-
INT2FIX(status));
|
815
|
-
}
|
816
|
-
|
817
|
-
static int get_qawo_table(VALUE tt,
|
818
|
-
gsl_integration_qawo_table **t)
|
819
|
-
{
|
820
|
-
int flagt;
|
821
|
-
|
822
|
-
if (TYPE(tt) == T_ARRAY) {
|
823
|
-
flagt = 1;
|
824
|
-
*t = make_qawo_table(tt);
|
825
|
-
} else {
|
826
|
-
flagt = 0;
|
827
|
-
if (!rb_obj_is_kind_of(tt, cgsl_integration_qawo_table))
|
828
|
-
rb_raise(rb_eTypeError, "Integration::QAWO_Table expected");
|
829
|
-
Data_Get_Struct(tt, gsl_integration_qawo_table, *t);
|
830
|
-
}
|
831
|
-
return flagt;
|
832
|
-
}
|
833
|
-
|
834
|
-
static VALUE rb_gsl_integration_qawf(int argc, VALUE *argv, VALUE obj)
|
835
|
-
{
|
836
|
-
double a, epsabs = EPSREL_DEFAULT;
|
837
|
-
double result, abserr;
|
838
|
-
size_t limit = LIMIT_DEFAULT;
|
839
|
-
gsl_function *F = NULL;
|
840
|
-
gsl_integration_workspace *w = NULL, *cw = NULL;
|
841
|
-
gsl_integration_qawo_table *t = NULL;
|
842
|
-
int status, intervals, flag = 0, flagt = 0, itmp;
|
843
|
-
VALUE *vtmp;
|
844
|
-
switch (TYPE(obj)) {
|
845
|
-
case T_MODULE: case T_CLASS: case T_OBJECT:
|
846
|
-
if (argc < 2) rb_raise(rb_eArgError, "too few arguments");
|
847
|
-
CHECK_FUNCTION(argv[0]);
|
848
|
-
Data_Get_Struct(argv[0], gsl_function, F);
|
849
|
-
itmp = 1;
|
850
|
-
break;
|
851
|
-
default:
|
852
|
-
if (argc < 1) rb_raise(rb_eArgError, "too few arguments");
|
853
|
-
Data_Get_Struct(obj, gsl_function, F);
|
854
|
-
itmp = 0;
|
855
|
-
break;
|
856
|
-
}
|
857
|
-
Need_Float(argv[itmp]);
|
858
|
-
a = NUM2DBL(argv[itmp]);
|
859
|
-
itmp += 1;
|
860
|
-
if (TYPE(argv[itmp]) == T_FLOAT) {
|
861
|
-
epsabs = NUM2DBL(argv[itmp]);
|
862
|
-
itmp += 1;
|
863
|
-
}
|
864
|
-
vtmp = argv + itmp;
|
865
|
-
flagt = get_qawo_table(argv[argc-1], &t);
|
866
|
-
|
867
|
-
switch (argc - 1 - itmp) {
|
868
|
-
case 0:
|
869
|
-
w = gsl_integration_workspace_alloc(limit);
|
870
|
-
cw = gsl_integration_workspace_alloc(limit);
|
871
|
-
flag = 1;
|
872
|
-
break;
|
873
|
-
case 1:
|
874
|
-
CHECK_FIXNUM(vtmp[0]);
|
875
|
-
limit = FIX2INT(vtmp[0]);
|
876
|
-
w = gsl_integration_workspace_alloc(limit);
|
877
|
-
cw = gsl_integration_workspace_alloc(limit);
|
878
|
-
flag = 1;
|
879
|
-
break;
|
880
|
-
case 2:
|
881
|
-
CHECK_WORKSPACE(vtmp[0]); CHECK_WORKSPACE(vtmp[1]);
|
882
|
-
Data_Get_Struct(vtmp[0], gsl_integration_workspace, w);
|
883
|
-
Data_Get_Struct(vtmp[1], gsl_integration_workspace, cw);
|
884
|
-
flag = 0;
|
885
|
-
break;
|
886
|
-
case 3:
|
887
|
-
CHECK_FIXNUM(vtmp[0]);
|
888
|
-
CHECK_WORKSPACE(vtmp[1]); CHECK_WORKSPACE(vtmp[2]);
|
889
|
-
limit = FIX2INT(vtmp[0]);
|
890
|
-
Data_Get_Struct(vtmp[1], gsl_integration_workspace, w);
|
891
|
-
Data_Get_Struct(vtmp[2], gsl_integration_workspace, cw);
|
892
|
-
flag = 0;
|
893
|
-
break;
|
894
|
-
default:
|
895
|
-
rb_raise(rb_eArgError, "wrong number of arguments");
|
896
|
-
break;
|
897
|
-
}
|
898
|
-
|
899
|
-
status = gsl_integration_qawf(F, a, epsabs, limit, w, cw, t, &result, &abserr);
|
900
|
-
intervals = w->size;
|
901
|
-
if (flag == 1) {
|
902
|
-
gsl_integration_workspace_free(w);
|
903
|
-
gsl_integration_workspace_free(cw);
|
904
|
-
}
|
905
|
-
if (flagt == 1) gsl_integration_qawo_table_free(t);
|
906
|
-
return rb_ary_new3(4, rb_float_new(result), rb_float_new(abserr),
|
907
|
-
INT2FIX(intervals), INT2FIX(status));
|
908
|
-
}
|
909
|
-
|
910
|
-
|
911
|
-
static void rb_gsl_integration_define_symbols(VALUE module)
|
912
|
-
{
|
913
|
-
rb_define_const(module, "GAUSS15", INT2FIX(GSL_INTEG_GAUSS15));
|
914
|
-
rb_define_const(module, "GAUSS21", INT2FIX(GSL_INTEG_GAUSS21));
|
915
|
-
rb_define_const(module, "GAUSS31", INT2FIX(GSL_INTEG_GAUSS31));
|
916
|
-
rb_define_const(module, "GAUSS41", INT2FIX(GSL_INTEG_GAUSS41));
|
917
|
-
rb_define_const(module, "GAUSS51", INT2FIX(GSL_INTEG_GAUSS51));
|
918
|
-
rb_define_const(module, "GAUSS61", INT2FIX(GSL_INTEG_GAUSS61));
|
919
|
-
rb_define_const(module, "COSINE", INT2FIX(GSL_INTEG_COSINE));
|
920
|
-
rb_define_const(module, "SINE", INT2FIX(GSL_INTEG_SINE));
|
921
|
-
}
|
922
|
-
|
923
|
-
static VALUE rb_gsl_integration_workspace_alloc(int argc, VALUE *argv,
|
924
|
-
VALUE klass)
|
925
|
-
{
|
926
|
-
size_t limit;
|
927
|
-
if (argc == 1) limit = FIX2INT(argv[0]);
|
928
|
-
else limit = LIMIT_DEFAULT;
|
929
|
-
return Data_Wrap_Struct(klass, 0,
|
930
|
-
gsl_integration_workspace_free,
|
931
|
-
gsl_integration_workspace_alloc(limit));
|
932
|
-
}
|
933
|
-
|
934
|
-
static VALUE rb_gsl_integration_workspace_limit(VALUE obj)
|
935
|
-
{
|
936
|
-
gsl_integration_workspace *w = NULL;
|
937
|
-
Data_Get_Struct(obj, gsl_integration_workspace, w);
|
938
|
-
return INT2FIX(w->limit);
|
939
|
-
}
|
940
|
-
|
941
|
-
static VALUE rb_gsl_integration_workspace_size(VALUE obj)
|
942
|
-
{
|
943
|
-
gsl_integration_workspace *w = NULL;
|
944
|
-
Data_Get_Struct(obj, gsl_integration_workspace, w);
|
945
|
-
return INT2FIX(w->size);
|
946
|
-
}
|
947
|
-
|
948
|
-
static VALUE rb_gsl_integration_workspace_nrmax(VALUE obj)
|
949
|
-
{
|
950
|
-
gsl_integration_workspace *w = NULL;
|
951
|
-
Data_Get_Struct(obj, gsl_integration_workspace, w);
|
952
|
-
return INT2FIX(w->nrmax);
|
953
|
-
}
|
954
|
-
|
955
|
-
static VALUE rb_gsl_integration_workspace_i(VALUE obj)
|
956
|
-
{
|
957
|
-
gsl_integration_workspace *w = NULL;
|
958
|
-
Data_Get_Struct(obj, gsl_integration_workspace, w);
|
959
|
-
return INT2FIX(w->i);
|
960
|
-
}
|
961
|
-
|
962
|
-
static VALUE rb_gsl_integration_workspace_maximum_level(VALUE obj)
|
963
|
-
{
|
964
|
-
gsl_integration_workspace *w = NULL;
|
965
|
-
Data_Get_Struct(obj, gsl_integration_workspace, w);
|
966
|
-
return INT2FIX(w->maximum_level);
|
967
|
-
}
|
968
|
-
|
969
|
-
static VALUE rb_gsl_integration_workspace_to_a(VALUE obj)
|
970
|
-
{
|
971
|
-
gsl_integration_workspace *w = NULL;
|
972
|
-
Data_Get_Struct(obj, gsl_integration_workspace, w);
|
973
|
-
return rb_ary_new3(5, INT2FIX(w->limit), INT2FIX(w->size), INT2FIX(w->nrmax),
|
974
|
-
INT2FIX(w->i), INT2FIX(w->maximum_level));
|
975
|
-
}
|
976
|
-
|
977
|
-
static VALUE rb_gsl_integration_workspace_alist(VALUE obj)
|
978
|
-
{
|
979
|
-
gsl_integration_workspace *w = NULL;
|
980
|
-
gsl_vector_view *v = NULL;
|
981
|
-
Data_Get_Struct(obj, gsl_integration_workspace, w);
|
982
|
-
v = rb_gsl_make_vector_view(w->alist, w->limit, 1);
|
983
|
-
return Data_Wrap_Struct(cgsl_vector_view_ro, 0, free, v);
|
984
|
-
}
|
985
|
-
|
986
|
-
static VALUE rb_gsl_integration_workspace_blist(VALUE obj)
|
987
|
-
{
|
988
|
-
gsl_integration_workspace *w = NULL;
|
989
|
-
gsl_vector_view *v = NULL;
|
990
|
-
|
991
|
-
Data_Get_Struct(obj, gsl_integration_workspace, w);
|
992
|
-
v = rb_gsl_make_vector_view(w->blist, w->limit, 1);
|
993
|
-
return Data_Wrap_Struct(cgsl_vector_view_ro, 0, free, v);
|
994
|
-
}
|
995
|
-
|
996
|
-
static VALUE rb_gsl_integration_workspace_rlist(VALUE obj)
|
997
|
-
{
|
998
|
-
gsl_integration_workspace *w = NULL;
|
999
|
-
gsl_vector_view *v = NULL;
|
1000
|
-
Data_Get_Struct(obj, gsl_integration_workspace, w);
|
1001
|
-
v = rb_gsl_make_vector_view(w->rlist, w->limit, 1);
|
1002
|
-
return Data_Wrap_Struct(cgsl_vector_view_ro, 0, free, v);
|
1003
|
-
}
|
1004
|
-
|
1005
|
-
static VALUE rb_gsl_integration_workspace_elist(VALUE obj)
|
1006
|
-
{
|
1007
|
-
gsl_integration_workspace *w = NULL;
|
1008
|
-
gsl_vector_view *v = NULL;
|
1009
|
-
Data_Get_Struct(obj, gsl_integration_workspace, w);
|
1010
|
-
v = rb_gsl_make_vector_view(w->elist, w->limit, 1);
|
1011
|
-
return Data_Wrap_Struct(cgsl_vector_view_ro, 0, free, v);
|
1012
|
-
}
|
1013
|
-
|
1014
|
-
static VALUE rb_gsl_integration_glfixed_table_alloc(VALUE klass, VALUE n)
|
1015
|
-
{
|
1016
|
-
gsl_integration_glfixed_table *t;
|
1017
|
-
t = gsl_integration_glfixed_table_alloc(FIX2INT(n));
|
1018
|
-
return Data_Wrap_Struct(cgsl_integration_glfixed_table, 0, gsl_integration_glfixed_table_free, t);
|
1019
|
-
}
|
1020
|
-
|
1021
|
-
static VALUE rb_gsl_integration_glfixed(VALUE obj, VALUE aa, VALUE bb, VALUE tt)
|
1022
|
-
{
|
1023
|
-
gsl_function *f;
|
1024
|
-
double a, b;
|
1025
|
-
gsl_integration_glfixed_table *t;
|
1026
|
-
double res;
|
1027
|
-
if (!rb_obj_is_kind_of(tt, cgsl_integration_glfixed_table)) {
|
1028
|
-
rb_raise(rb_eTypeError, "Wrong arugment type (%s for GSL::Integration::Glfixed_table)",
|
1029
|
-
rb_class2name(CLASS_OF(tt)));
|
1030
|
-
}
|
1031
|
-
Data_Get_Struct(tt, gsl_integration_glfixed_table, t);
|
1032
|
-
a = NUM2DBL(aa);
|
1033
|
-
b = NUM2DBL(bb);
|
1034
|
-
Data_Get_Struct(obj, gsl_function, f);
|
1035
|
-
res = gsl_integration_glfixed(f, a, b, t);
|
1036
|
-
return rb_float_new(res);
|
1037
|
-
}
|
1038
|
-
|
1039
|
-
void Init_gsl_integration(VALUE module)
|
1040
|
-
{
|
1041
|
-
VALUE mgsl_integ;
|
1042
|
-
|
1043
|
-
mgsl_integ = rb_define_module_under(module, "Integration");
|
1044
|
-
rb_gsl_integration_define_symbols(mgsl_integ);
|
1045
|
-
|
1046
|
-
rb_define_method(cgsl_function, "integration_qng", rb_gsl_integration_qng, -1);
|
1047
|
-
rb_define_method(cgsl_function, "integration_qag", rb_gsl_integration_qag, -1);
|
1048
|
-
rb_define_method(cgsl_function, "integration_qags", rb_gsl_integration_qags, -1);
|
1049
|
-
rb_define_method(cgsl_function, "integration_qagp", rb_gsl_integration_qagp, -1);
|
1050
|
-
rb_define_method(cgsl_function, "integration_qagi", rb_gsl_integration_qagi, -1);
|
1051
|
-
rb_define_method(cgsl_function, "integration_qagiu", rb_gsl_integration_qagiu, -1);
|
1052
|
-
rb_define_method(cgsl_function, "integration_qagil", rb_gsl_integration_qagil, -1);
|
1053
|
-
rb_define_method(cgsl_function, "integration_qawc", rb_gsl_integration_qawc, -1);
|
1054
|
-
rb_define_alias(cgsl_function, "qng", "integration_qng");
|
1055
|
-
rb_define_alias(cgsl_function, "qag", "integration_qag");
|
1056
|
-
rb_define_alias(cgsl_function, "qags", "integration_qags");
|
1057
|
-
rb_define_alias(cgsl_function, "qagp", "integration_qagp");
|
1058
|
-
rb_define_alias(cgsl_function, "qagi", "integration_qagi");
|
1059
|
-
rb_define_alias(cgsl_function, "qagiu", "integration_qagiu");
|
1060
|
-
rb_define_alias(cgsl_function, "qagil", "integration_qagil");
|
1061
|
-
rb_define_alias(cgsl_function, "qawc", "integration_qawc");
|
1062
|
-
|
1063
|
-
cgsl_integration_qaws_table = rb_define_class_under(mgsl_integ, "QAWS_Table",
|
1064
|
-
cGSL_Object);
|
1065
|
-
rb_define_singleton_method(cgsl_integration_qaws_table, "alloc",
|
1066
|
-
rb_gsl_integration_qaws_table_alloc, -1);
|
1067
|
-
/* rb_define_singleton_method(cgsl_integration_qaws_table, "new",
|
1068
|
-
rb_gsl_integration_qaws_table_alloc, -1);*/
|
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);
|
1075
|
-
rb_define_alias(rb_cArray, "to_qaws_table", "to_gsl_integration_qaws_table");
|
1076
|
-
rb_define_method(cgsl_function, "integration_qaws", rb_gsl_integration_qaws, -1);
|
1077
|
-
rb_define_alias(cgsl_function, "qaws", "integration_qaws");
|
1078
|
-
|
1079
|
-
cgsl_integration_qawo_table = rb_define_class_under(mgsl_integ, "QAWO_Table",
|
1080
|
-
cGSL_Object);
|
1081
|
-
rb_define_singleton_method(cgsl_integration_qawo_table, "alloc",
|
1082
|
-
rb_gsl_integration_qawo_table_alloc, -1);
|
1083
|
-
/* rb_define_singleton_method(cgsl_integration_qawo_table, "new",
|
1084
|
-
rb_gsl_integration_qawo_table_alloc, -1);*/
|
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);
|
1093
|
-
rb_define_method(cgsl_function, "integration_qawo", rb_gsl_integration_qawo, -1);
|
1094
|
-
rb_define_method(cgsl_function, "integration_qawf", rb_gsl_integration_qawf, -1);
|
1095
|
-
rb_define_alias(cgsl_function, "qawo", "integration_qawo");
|
1096
|
-
rb_define_alias(cgsl_function, "qawf", "integration_qawf");
|
1097
|
-
|
1098
|
-
cgsl_integration_workspace = rb_define_class_under(mgsl_integ,
|
1099
|
-
"Workspace", cGSL_Object);
|
1100
|
-
|
1101
|
-
/* rb_define_singleton_method(cgsl_integration_workspace, "new",
|
1102
|
-
rb_gsl_integration_workspace_alloc, -1);*/
|
1103
|
-
rb_define_singleton_method(cgsl_integration_workspace, "alloc",
|
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);
|
1126
|
-
|
1127
|
-
/*****/
|
1128
|
-
rb_define_module_function(mgsl_integ, "qng", rb_gsl_integration_qng, -1);
|
1129
|
-
rb_define_module_function(mgsl_integ, "qag", rb_gsl_integration_qag, -1);
|
1130
|
-
rb_define_module_function(mgsl_integ, "qags", rb_gsl_integration_qags, -1);
|
1131
|
-
rb_define_module_function(mgsl_integ, "qagp", rb_gsl_integration_qagp, -1);
|
1132
|
-
rb_define_module_function(mgsl_integ, "qagi", rb_gsl_integration_qagi, -1);
|
1133
|
-
rb_define_module_function(mgsl_integ, "qagiu", rb_gsl_integration_qagiu, -1);
|
1134
|
-
rb_define_module_function(mgsl_integ, "qagil", rb_gsl_integration_qagil, -1);
|
1135
|
-
rb_define_module_function(mgsl_integ, "qawc", rb_gsl_integration_qawc, -1);
|
1136
|
-
rb_define_module_function(mgsl_integ, "qaws", rb_gsl_integration_qaws, -1);
|
1137
|
-
rb_define_module_function(mgsl_integ, "qawo", rb_gsl_integration_qawo, -1);
|
1138
|
-
rb_define_module_function(mgsl_integ, "qawf", rb_gsl_integration_qawf, -1);
|
1139
|
-
|
1140
|
-
cgsl_integration_glfixed_table = rb_define_class_under(mgsl_integ, "Glfixed_table", cGSL_Object);
|
1141
|
-
rb_define_singleton_method(cgsl_integration_glfixed_table, "alloc",
|
1142
|
-
rb_gsl_integration_glfixed_table_alloc, 1);
|
1143
|
-
rb_define_method(cgsl_function, "glfixed", rb_gsl_integration_glfixed, 3);
|
1144
|
-
}
|
1145
|
-
|
1146
|
-
#undef EPSABS_DEFAULT
|
1147
|
-
#undef EPSREL_DEFAULT
|
1148
|
-
#undef LIMIT_DEFAULT
|
1149
|
-
#undef KEY_DEFAULT
|
1150
|
-
|
1151
|
-
#ifdef CHECK_WORKSPACE
|
1152
|
-
#undef CHECK_WORKSPACE
|
1153
|
-
#endif
|
1154
|
-
|