rb-gsl 1.16.0.4 → 1.16.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +12 -0
- data/.travis.yml +24 -0
- data/AUTHORS +6 -0
- data/COPYING +341 -339
- data/ChangeLog +608 -587
- data/Gemfile +4 -0
- data/README.md +77 -0
- data/Rakefile +14 -33
- data/THANKS +1 -1
- data/examples/blas/blas.rb +1 -1
- data/examples/bspline.rb +3 -3
- data/examples/complex/functions.rb +4 -4
- data/examples/complex/mul.rb +1 -1
- data/examples/const/physconst.rb +4 -4
- data/examples/const/travel.rb +4 -4
- data/examples/eigen/nonsymmv.rb +1 -1
- data/examples/eigen/qhoscillator.rb +3 -3
- data/examples/fft/radix2.rb +1 -1
- data/examples/fft/real-halfcomplex.rb +3 -3
- data/examples/fft/real-halfcomplex2.rb +3 -3
- data/examples/fit/expfit.rb +1 -1
- data/examples/fit/multifit.rb +1 -1
- data/examples/fit/ndlinear.rb +44 -44
- data/examples/fit/nonlinearfit.rb +1 -1
- data/examples/fit/wlinear.rb +3 -3
- data/examples/function/function.rb +1 -1
- data/examples/function/min.rb +1 -1
- data/examples/function/synchrotron.rb +2 -2
- data/examples/gallery/koch.rb +1 -1
- data/examples/histogram/cauchy.rb +2 -2
- data/examples/histogram/exponential.rb +1 -1
- data/examples/histogram/histo3d.rb +1 -1
- data/examples/histogram/histogram-pdf.rb +2 -2
- data/examples/histogram/xexp.rb +1 -1
- data/examples/integration/ahmed.rb +2 -2
- data/examples/integration/cosmology.rb +7 -7
- data/examples/integration/friedmann.rb +4 -4
- data/examples/integration/qng.rb +1 -1
- data/examples/interp/demo.rb +2 -2
- data/examples/linalg/LQ_solve.rb +1 -1
- data/examples/linalg/LU.rb +1 -1
- data/examples/linalg/LU2.rb +1 -1
- data/examples/linalg/LU_narray.rb +1 -1
- data/examples/linalg/PTLQ.rb +1 -1
- data/examples/linalg/QRPT.rb +1 -1
- data/examples/linalg/chol.rb +1 -1
- data/examples/linalg/chol_narray.rb +1 -1
- data/examples/linalg/complex.rb +1 -1
- data/examples/math/elementary.rb +1 -1
- data/examples/math/functions.rb +1 -1
- data/examples/math/inf_nan.rb +1 -1
- data/examples/math/minmax.rb +1 -1
- data/examples/math/power.rb +1 -1
- data/examples/math/test.rb +1 -1
- data/examples/min.rb +1 -1
- data/examples/multimin/bundle.rb +1 -1
- data/examples/multimin/cqp.rb +17 -17
- data/examples/multiroot/fsolver3.rb +1 -1
- data/examples/odeiv/binarysystem.rb +12 -12
- data/examples/odeiv/demo.rb +3 -3
- data/examples/odeiv/frei1.rb +7 -7
- data/examples/odeiv/frei2.rb +4 -4
- data/examples/odeiv/oscillator.rb +1 -1
- data/examples/odeiv/sedov.rb +3 -3
- data/examples/odeiv/whitedwarf.rb +11 -11
- data/examples/permutation/ex1.rb +2 -2
- data/examples/permutation/permutation.rb +1 -1
- data/examples/poly/demo.rb +1 -1
- data/examples/random/diffusion.rb +1 -1
- data/examples/random/generator.rb +2 -2
- data/examples/random/randomwalk.rb +3 -3
- data/examples/random/rng.rb +1 -1
- data/examples/roots/bisection.rb +1 -1
- data/examples/roots/brent.rb +1 -1
- data/examples/roots/demo.rb +1 -1
- data/examples/roots/newton.rb +2 -2
- data/examples/roots/recombination.gp +0 -1
- data/examples/sf/hyperg.rb +1 -1
- data/examples/sf/sphbessel.rb +1 -1
- data/examples/sort/sort.rb +1 -1
- data/examples/tamu_anova.rb +4 -4
- data/examples/vector/add.rb +1 -1
- data/examples/vector/decimate.rb +1 -1
- data/examples/vector/gnuplot.rb +8 -8
- data/examples/vector/vector.rb +2 -2
- data/examples/wavelet/wavelet1.rb +1 -1
- data/ext/{gsl → gsl_native}/alf.c +9 -9
- data/ext/{gsl → gsl_native}/array.c +64 -151
- data/ext/{gsl → gsl_native}/array_complex.c +61 -63
- data/ext/{gsl → gsl_native}/blas.c +0 -0
- data/ext/{gsl → gsl_native}/blas1.c +32 -32
- data/ext/{gsl → gsl_native}/blas2.c +54 -58
- data/ext/{gsl → gsl_native}/blas3.c +54 -54
- data/ext/{gsl → gsl_native}/block.c +3 -6
- data/ext/{gsl/block_source.c → gsl_native/block_source.h} +109 -111
- data/ext/gsl_native/bspline.c +122 -0
- data/ext/{gsl → gsl_native}/bundle.c +0 -0
- data/ext/{gsl → gsl_native}/cdf.c +76 -88
- data/ext/{gsl → gsl_native}/cheb.c +74 -85
- data/ext/{gsl → gsl_native}/combination.c +9 -16
- data/ext/{gsl → gsl_native}/common.c +7 -37
- data/ext/{gsl → gsl_native}/complex.c +113 -115
- data/ext/gsl_native/const.c +331 -0
- data/ext/{gsl → gsl_native}/const_additional.c +12 -33
- data/ext/gsl_native/cqp.c +283 -0
- data/ext/{gsl → gsl_native}/deriv.c +22 -30
- data/ext/{gsl → gsl_native}/dht.c +20 -28
- data/ext/{gsl → gsl_native}/diff.c +23 -25
- data/ext/{gsl → gsl_native}/dirac.c +44 -45
- data/ext/{gsl → gsl_native}/eigen.c +1031 -1082
- data/ext/{gsl → gsl_native}/error.c +13 -13
- data/ext/{gsl → gsl_native}/extconf.rb +5 -13
- data/ext/{gsl → gsl_native}/fft.c +192 -198
- data/ext/{gsl → gsl_native}/fit.c +16 -16
- data/ext/gsl_native/fresnel.c +312 -0
- data/ext/{gsl → gsl_native}/function.c +29 -35
- data/ext/{gsl → gsl_native}/geometry.c +15 -15
- data/ext/{gsl → gsl_native}/graph.c +37 -87
- data/ext/{gsl → gsl_native}/gsl.c +10 -23
- data/ext/{gsl → gsl_native}/gsl_narray.c +15 -24
- data/ext/{gsl → gsl_native}/histogram.c +123 -150
- data/ext/{gsl → gsl_native}/histogram2d.c +71 -96
- data/ext/{gsl → gsl_native}/histogram3d.c +72 -72
- data/ext/{gsl → gsl_native}/histogram3d_source.c +195 -196
- data/ext/{gsl → gsl_native}/histogram_find.c +31 -33
- data/ext/{gsl → gsl_native}/histogram_oper.c +43 -52
- data/ext/{gsl → gsl_native}/ieee.c +7 -15
- data/ext/{gsl → gsl_native}/include/rb_gsl.h +0 -7
- data/ext/{gsl → gsl_native}/include/rb_gsl_array.h +15 -25
- data/ext/{gsl → gsl_native}/include/rb_gsl_cheb.h +0 -0
- data/ext/{gsl → gsl_native}/include/rb_gsl_common.h +44 -52
- data/ext/{gsl → gsl_native}/include/rb_gsl_complex.h +0 -0
- data/ext/{gsl → gsl_native}/include/rb_gsl_const.h +0 -5
- data/ext/{gsl → gsl_native}/include/rb_gsl_dirac.h +0 -0
- data/ext/{gsl → gsl_native}/include/rb_gsl_eigen.h +0 -0
- data/ext/{gsl → gsl_native}/include/rb_gsl_fft.h +0 -3
- data/ext/{gsl → gsl_native}/include/rb_gsl_fit.h +0 -0
- data/ext/{gsl → gsl_native}/include/rb_gsl_function.h +0 -0
- data/ext/{gsl → gsl_native}/include/rb_gsl_graph.h +2 -2
- data/ext/{gsl → gsl_native}/include/rb_gsl_histogram.h +8 -8
- data/ext/{gsl → gsl_native}/include/rb_gsl_histogram3d.h +50 -50
- data/ext/{gsl → gsl_native}/include/rb_gsl_integration.h +0 -0
- data/ext/{gsl → gsl_native}/include/rb_gsl_interp.h +0 -0
- data/ext/{gsl → gsl_native}/include/rb_gsl_linalg.h +0 -1
- data/ext/{gsl → gsl_native}/include/rb_gsl_math.h +0 -4
- data/ext/{gsl → gsl_native}/include/rb_gsl_odeiv.h +0 -0
- data/ext/{gsl → gsl_native}/include/rb_gsl_poly.h +3 -3
- data/ext/{gsl → gsl_native}/include/rb_gsl_rational.h +1 -1
- data/ext/{gsl → gsl_native}/include/rb_gsl_rng.h +0 -0
- data/ext/{gsl → gsl_native}/include/rb_gsl_root.h +0 -0
- data/ext/{gsl → gsl_native}/include/rb_gsl_sf.h +39 -43
- data/ext/{gsl → gsl_native}/include/rb_gsl_statistics.h +0 -0
- data/ext/{gsl → gsl_native}/include/rb_gsl_tensor.h +0 -0
- data/ext/{gsl → gsl_native}/include/rb_gsl_with_narray.h +0 -0
- data/ext/{gsl → gsl_native}/include/templates_off.h +0 -0
- data/ext/{gsl → gsl_native}/include/templates_on.h +1 -1
- data/ext/{gsl → gsl_native}/integration.c +160 -183
- data/ext/{gsl → gsl_native}/interp.c +23 -31
- data/ext/gsl_native/jacobi.c +733 -0
- data/ext/{gsl → gsl_native}/linalg.c +448 -576
- data/ext/{gsl → gsl_native}/linalg_complex.c +84 -98
- data/ext/{gsl → gsl_native}/math.c +45 -63
- data/ext/{gsl → gsl_native}/matrix.c +4 -6
- data/ext/{gsl → gsl_native}/matrix_complex.c +111 -114
- data/ext/{gsl → gsl_native}/matrix_double.c +74 -77
- data/ext/{gsl → gsl_native}/matrix_int.c +49 -50
- data/ext/{gsl/matrix_source.c → gsl_native/matrix_source.h} +280 -302
- data/ext/{gsl → gsl_native}/min.c +43 -74
- data/ext/{gsl → gsl_native}/monte.c +45 -59
- data/ext/{gsl → gsl_native}/multifit.c +138 -147
- data/ext/{gsl → gsl_native}/multimin.c +55 -83
- data/ext/{gsl → gsl_native}/multimin_fsdf.c +15 -15
- data/ext/{gsl → gsl_native}/multiroots.c +61 -64
- data/ext/{gsl → gsl_native}/multiset.c +3 -7
- data/ext/{gsl → gsl_native}/ndlinear.c +320 -321
- data/ext/{gsl → gsl_native}/nmf.c +11 -11
- data/ext/{gsl → gsl_native}/nmf_wrap.c +1 -1
- data/ext/{gsl → gsl_native}/ntuple.c +13 -13
- data/ext/{gsl → gsl_native}/odeiv.c +95 -106
- data/ext/gsl_native/ool.c +879 -0
- data/ext/{gsl → gsl_native}/permutation.c +36 -34
- data/ext/{gsl → gsl_native}/poly.c +2 -5
- data/ext/{gsl → gsl_native}/poly2.c +6 -6
- data/ext/{gsl/poly_source.c → gsl_native/poly_source.h} +232 -275
- data/ext/{gsl → gsl_native}/qrng.c +6 -17
- data/ext/{gsl → gsl_native}/randist.c +218 -243
- data/ext/{gsl → gsl_native}/rational.c +9 -9
- data/ext/{gsl → gsl_native}/rng.c +29 -45
- data/ext/{gsl → gsl_native}/root.c +43 -43
- data/ext/{gsl → gsl_native}/sf.c +163 -197
- data/ext/{gsl → gsl_native}/sf_airy.c +0 -0
- data/ext/{gsl → gsl_native}/sf_bessel.c +6 -6
- data/ext/{gsl → gsl_native}/sf_clausen.c +0 -0
- data/ext/{gsl → gsl_native}/sf_coulomb.c +39 -39
- data/ext/{gsl → gsl_native}/sf_coupling.c +29 -29
- data/ext/{gsl → gsl_native}/sf_dawson.c +0 -0
- data/ext/{gsl → gsl_native}/sf_debye.c +0 -9
- data/ext/{gsl → gsl_native}/sf_dilog.c +0 -0
- data/ext/{gsl → gsl_native}/sf_elementary.c +2 -2
- data/ext/{gsl → gsl_native}/sf_ellint.c +42 -42
- data/ext/{gsl → gsl_native}/sf_elljac.c +2 -2
- data/ext/{gsl → gsl_native}/sf_erfc.c +0 -4
- data/ext/{gsl → gsl_native}/sf_exp.c +2 -2
- data/ext/{gsl → gsl_native}/sf_expint.c +1 -11
- data/ext/{gsl → gsl_native}/sf_fermi_dirac.c +0 -0
- data/ext/{gsl → gsl_native}/sf_gamma.c +1 -5
- data/ext/{gsl → gsl_native}/sf_gegenbauer.c +0 -0
- data/ext/{gsl → gsl_native}/sf_hyperg.c +0 -0
- data/ext/{gsl → gsl_native}/sf_laguerre.c +3 -3
- data/ext/{gsl → gsl_native}/sf_lambert.c +0 -0
- data/ext/{gsl → gsl_native}/sf_legendre.c +0 -0
- data/ext/{gsl → gsl_native}/sf_log.c +3 -3
- data/ext/gsl_native/sf_mathieu.c +235 -0
- data/ext/{gsl → gsl_native}/sf_power.c +0 -0
- data/ext/{gsl → gsl_native}/sf_psi.c +2 -11
- data/ext/{gsl → gsl_native}/sf_synchrotron.c +0 -0
- data/ext/{gsl → gsl_native}/sf_transport.c +0 -0
- data/ext/{gsl → gsl_native}/sf_trigonometric.c +3 -3
- data/ext/{gsl → gsl_native}/sf_zeta.c +0 -4
- data/ext/{gsl → gsl_native}/signal.c +60 -64
- data/ext/{gsl → gsl_native}/siman.c +36 -40
- data/ext/{gsl → gsl_native}/sort.c +3 -4
- data/ext/{gsl → gsl_native}/spline.c +25 -43
- data/ext/{gsl → gsl_native}/stats.c +102 -115
- data/ext/{gsl → gsl_native}/sum.c +32 -32
- data/ext/{gsl → gsl_native}/tamu_anova.c +0 -0
- data/ext/{gsl → gsl_native}/tensor.c +2 -4
- data/ext/{gsl/tensor_source.c → gsl_native/tensor_source.h} +144 -144
- data/ext/{gsl → gsl_native}/vector.c +2 -4
- data/ext/{gsl → gsl_native}/vector_complex.c +165 -171
- data/ext/{gsl → gsl_native}/vector_double.c +167 -174
- data/ext/{gsl → gsl_native}/vector_int.c +23 -25
- data/ext/{gsl/vector_source.c → gsl_native/vector_source.h} +400 -414
- data/ext/{gsl → gsl_native}/wavelet.c +215 -236
- data/lib/gsl.rb +1 -7
- data/lib/gsl/gnuplot.rb +2 -2
- data/lib/gsl/version.rb +1 -3
- data/rb-gsl.gemspec +29 -0
- data/rdoc/blas.rdoc +3 -3
- data/rdoc/bspline.rdoc +7 -7
- data/rdoc/cheb.rdoc +8 -8
- data/rdoc/cholesky_complex.rdoc +1 -1
- data/rdoc/combi.rdoc +9 -9
- data/rdoc/complex.rdoc +11 -11
- data/rdoc/const.rdoc +20 -20
- data/rdoc/dht.rdoc +6 -6
- data/rdoc/diff.rdoc +6 -6
- data/rdoc/ehandling.rdoc +3 -3
- data/rdoc/eigen.rdoc +11 -11
- data/rdoc/fft.rdoc +26 -26
- data/rdoc/fit.rdoc +18 -18
- data/rdoc/graph.rdoc +2 -2
- data/rdoc/hist.rdoc +16 -16
- data/rdoc/hist2d.rdoc +4 -4
- data/rdoc/hist3d.rdoc +3 -3
- data/rdoc/integration.rdoc +16 -16
- data/rdoc/interp.rdoc +11 -11
- data/rdoc/intro.rdoc +3 -3
- data/rdoc/linalg.rdoc +20 -20
- data/rdoc/linalg_complex.rdoc +1 -1
- data/rdoc/math.rdoc +13 -13
- data/rdoc/matrix.rdoc +22 -22
- data/rdoc/min.rdoc +9 -9
- data/rdoc/monte.rdoc +3 -3
- data/rdoc/multimin.rdoc +12 -12
- data/rdoc/multiroot.rdoc +12 -12
- data/rdoc/narray.rdoc +9 -9
- data/rdoc/ndlinear.rdoc +4 -4
- data/rdoc/nonlinearfit.rdoc +17 -17
- data/rdoc/ntuple.rdoc +5 -5
- data/rdoc/odeiv.rdoc +12 -12
- data/rdoc/perm.rdoc +11 -11
- data/rdoc/poly.rdoc +17 -17
- data/rdoc/qrng.rdoc +9 -9
- data/rdoc/randist.rdoc +10 -10
- data/rdoc/ref.rdoc +49 -49
- data/rdoc/rng.rdoc +9 -9
- data/rdoc/roots.rdoc +12 -12
- data/rdoc/sf.rdoc +35 -35
- data/rdoc/siman.rdoc +3 -3
- data/rdoc/sort.rdoc +6 -6
- data/rdoc/start.rdoc +2 -2
- data/rdoc/stats.rdoc +13 -13
- data/rdoc/sum.rdoc +4 -4
- data/rdoc/tensor.rdoc +3 -3
- data/rdoc/tut.rdoc +1 -1
- data/rdoc/use.rdoc +3 -3
- data/rdoc/vector.rdoc +28 -28
- data/rdoc/vector_complex.rdoc +6 -6
- data/rdoc/wavelet.rdoc +8 -8
- data/test/gsl/blas_test.rb +1 -1
- data/test/gsl/index_test.rb +61 -0
- data/test/gsl/matrix_test.rb +21 -0
- data/uncrustify.cfg +1693 -0
- metadata +212 -243
- data/README +0 -28
- data/ext/gsl/bspline.c +0 -130
- data/ext/gsl/const.c +0 -672
- data/ext/gsl/cqp.c +0 -283
- data/ext/gsl/fcmp.c +0 -64
- data/ext/gsl/fresnel.c +0 -312
- data/ext/gsl/jacobi.c +0 -739
- data/ext/gsl/ool.c +0 -879
- data/ext/gsl/oper_complex_source.c +0 -251
- data/ext/gsl/sf_mathieu.c +0 -238
- data/rdoc/index.rdoc +0 -50
data/README
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
== Description
|
2
|
-
|
3
|
-
Ruby/GSL, a ruby interface to GSL (GNU Scientific library)
|
4
|
-
|
5
|
-
== Installation
|
6
|
-
|
7
|
-
See http://blackwinter.github.com/rb-gsl.
|
8
|
-
|
9
|
-
== Reference
|
10
|
-
|
11
|
-
See http://blackwinter.github.com/rb-gsl/rdoc/ref_rdoc.
|
12
|
-
|
13
|
-
== Licence
|
14
|
-
|
15
|
-
Ruby/GSL is free software: you can redistribute it and/or modify it
|
16
|
-
under the terms of the GNU General Public License.
|
17
|
-
This library is distributed in the hope that it will be useful, but
|
18
|
-
WITHOUT ANY WARRANTY.
|
19
|
-
|
20
|
-
== Bug Reports
|
21
|
-
|
22
|
-
Any bug reports are welcome. If you encounter bugs in Ruby/GSL, please
|
23
|
-
report them on GitHub: https://github.com/blackwinter/rb-gsl/issues.
|
24
|
-
|
25
|
-
== Authors
|
26
|
-
|
27
|
-
* Yoshiki Tsunesada <y-tsunesada at mm dot em-net dot ne dot jp> (Original author)
|
28
|
-
* Jens Wille <mailto:jens.wille@gmail.com>
|
data/ext/gsl/bspline.c
DELETED
@@ -1,130 +0,0 @@
|
|
1
|
-
|
2
|
-
#include "include/rb_gsl.h"
|
3
|
-
#ifdef GSL_1_9_LATER
|
4
|
-
#include "gsl/gsl_bspline.h"
|
5
|
-
|
6
|
-
static VALUE cBSWS;
|
7
|
-
|
8
|
-
static VALUE rb_gsl_bspline_alloc(VALUE klass, VALUE k, VALUE n)
|
9
|
-
{
|
10
|
-
gsl_bspline_workspace *w;
|
11
|
-
w = gsl_bspline_alloc(FIX2INT(k), FIX2INT(n));
|
12
|
-
return Data_Wrap_Struct(klass, 0, gsl_bspline_free, w);
|
13
|
-
}
|
14
|
-
|
15
|
-
static VALUE rb_gsl_bspline_ncoeffs(VALUE obj)
|
16
|
-
{
|
17
|
-
gsl_bspline_workspace *w;
|
18
|
-
Data_Get_Struct(obj, gsl_bspline_workspace, w);
|
19
|
-
return INT2FIX((int)gsl_bspline_ncoeffs(w));
|
20
|
-
}
|
21
|
-
static VALUE rb_gsl_bspline_order(VALUE obj)
|
22
|
-
{
|
23
|
-
gsl_bspline_workspace *w;
|
24
|
-
Data_Get_Struct(obj, gsl_bspline_workspace, w);
|
25
|
-
return INT2FIX((int)gsl_bspline_order(w));
|
26
|
-
}
|
27
|
-
static VALUE rb_gsl_bspline_nbreak(VALUE obj)
|
28
|
-
{
|
29
|
-
gsl_bspline_workspace *w;
|
30
|
-
Data_Get_Struct(obj, gsl_bspline_workspace, w);
|
31
|
-
return INT2FIX((int)gsl_bspline_nbreak(w));
|
32
|
-
}
|
33
|
-
static VALUE rb_gsl_bspline_breakpoint(VALUE obj, VALUE i)
|
34
|
-
{
|
35
|
-
gsl_bspline_workspace *w;
|
36
|
-
Data_Get_Struct(obj, gsl_bspline_workspace, w);
|
37
|
-
return rb_float_new(gsl_bspline_breakpoint(FIX2INT(i), w));
|
38
|
-
}
|
39
|
-
static VALUE rb_gsl_bspline_knots(VALUE obj, VALUE b)
|
40
|
-
{
|
41
|
-
gsl_bspline_workspace *w;
|
42
|
-
gsl_vector *bpts;
|
43
|
-
CHECK_VECTOR(b);
|
44
|
-
Data_Get_Struct(obj, gsl_bspline_workspace, w);
|
45
|
-
Data_Get_Struct(b, gsl_vector, bpts);
|
46
|
-
gsl_bspline_knots(bpts, w);
|
47
|
-
return Data_Wrap_Struct(cgsl_vector_view_ro, 0, NULL, w->knots);
|
48
|
-
}
|
49
|
-
static VALUE rb_gsl_bspline_knots_uniform(int argc, VALUE *argv, VALUE obj)
|
50
|
-
{
|
51
|
-
gsl_bspline_workspace *w;
|
52
|
-
int argc2;
|
53
|
-
switch (TYPE(obj)) {
|
54
|
-
case T_MODULE:
|
55
|
-
case T_CLASS:
|
56
|
-
case T_OBJECT:
|
57
|
-
if (!rb_obj_is_kind_of(argv[argc-1], cBSWS)) {
|
58
|
-
rb_raise(rb_eTypeError, "Wrong argument type %s (GSL::BSpline expected)",
|
59
|
-
rb_class2name(CLASS_OF(argv[argc-1])));
|
60
|
-
}
|
61
|
-
Data_Get_Struct(argv[argc-1], gsl_bspline_workspace, w);
|
62
|
-
argc2 = argc-1;
|
63
|
-
break;
|
64
|
-
default:
|
65
|
-
Data_Get_Struct(obj, gsl_bspline_workspace, w);
|
66
|
-
argc2 = argc;
|
67
|
-
}
|
68
|
-
if (argc2 != 2) rb_raise(rb_eArgError, "Wrong number of arguments.");
|
69
|
-
gsl_bspline_knots_uniform(NUM2DBL(argv[0]), NUM2DBL(argv[1]), w);
|
70
|
-
return Data_Wrap_Struct(cgsl_vector_view_ro, 0, NULL, w->knots);
|
71
|
-
}
|
72
|
-
static VALUE rb_gsl_bspline_eval(int argc, VALUE *argv, VALUE obj)
|
73
|
-
{
|
74
|
-
gsl_bspline_workspace *w;
|
75
|
-
double x;
|
76
|
-
gsl_vector *B;
|
77
|
-
VALUE vB;
|
78
|
-
|
79
|
-
Data_Get_Struct(obj, gsl_bspline_workspace, w);
|
80
|
-
|
81
|
-
switch (argc) {
|
82
|
-
case 2:
|
83
|
-
CHECK_VECTOR(argv[1]);
|
84
|
-
Data_Get_Struct(argv[1], gsl_vector, B);
|
85
|
-
vB = argv[1];
|
86
|
-
x = NUM2DBL(argv[0]);
|
87
|
-
break;
|
88
|
-
case 1:
|
89
|
-
x = NUM2DBL(argv[0]);
|
90
|
-
B = gsl_vector_alloc(w->nbreak+w->k-2);
|
91
|
-
vB = Data_Wrap_Struct(cgsl_vector, 0, gsl_vector_free, B);
|
92
|
-
break;
|
93
|
-
default:
|
94
|
-
rb_raise(rb_eArgError, "Wrong number of arguments (%d for 1 or 2)", argc);
|
95
|
-
}
|
96
|
-
|
97
|
-
gsl_bspline_eval(x, B, w);
|
98
|
-
|
99
|
-
return vB;
|
100
|
-
}
|
101
|
-
#ifdef GSL_1_13_LATER
|
102
|
-
static VALUE rb_gsl_bspline_greville_abscissa(VALUE obj, VALUE i)
|
103
|
-
{
|
104
|
-
gsl_bspline_workspace *w;
|
105
|
-
Data_Get_Struct(obj, gsl_bspline_workspace, w);
|
106
|
-
return rb_float_new(gsl_bspline_greville_abscissa(i, w));
|
107
|
-
}
|
108
|
-
#endif
|
109
|
-
|
110
|
-
void Init_bspline(VALUE module)
|
111
|
-
{
|
112
|
-
cBSWS = rb_define_class_under(module, "BSpline", cGSL_Object);
|
113
|
-
|
114
|
-
rb_define_singleton_method(cBSWS, "alloc", rb_gsl_bspline_alloc, 2);
|
115
|
-
|
116
|
-
rb_define_method(cBSWS, "ncoeffs", rb_gsl_bspline_ncoeffs, 0);
|
117
|
-
rb_define_method(cBSWS, "order", rb_gsl_bspline_order, 0);
|
118
|
-
rb_define_method(cBSWS, "nbreak", rb_gsl_bspline_nbreak, 0);
|
119
|
-
rb_define_method(cBSWS, "breakpoint", rb_gsl_bspline_breakpoint, 1);
|
120
|
-
rb_define_method(cBSWS, "knots", rb_gsl_bspline_knots, 1);
|
121
|
-
rb_define_method(cBSWS, "knots_uniform", rb_gsl_bspline_knots_uniform, -1);
|
122
|
-
rb_define_singleton_method(cBSWS, "knots_uniform", rb_gsl_bspline_knots_uniform, -1);
|
123
|
-
rb_define_method(cBSWS, "eval", rb_gsl_bspline_eval, -1);
|
124
|
-
|
125
|
-
#ifdef GSL_1_13_LATER
|
126
|
-
rb_define_method(cBSWS, "greville_abscissa", rb_gsl_bspline_greville_abscissa, 1);
|
127
|
-
#endif
|
128
|
-
|
129
|
-
}
|
130
|
-
#endif
|
data/ext/gsl/const.c
DELETED
@@ -1,672 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
const.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_const.h"
|
13
|
-
|
14
|
-
static void rb_gsl_const_mks(VALUE module);
|
15
|
-
static void rb_gsl_const_cgs(VALUE module);
|
16
|
-
static void rb_gsl_const_num(VALUE module);
|
17
|
-
void Init_gsl_const_additional(VALUE mmks, VALUE mcgs, VALUE mnum);
|
18
|
-
|
19
|
-
#ifndef GSL_1_4_LATER
|
20
|
-
static void rb_gsl_const_mks(VALUE module)
|
21
|
-
{
|
22
|
-
rb_define_const(module, "SPEED_OF_LIGHT",
|
23
|
-
rb_float_new(GSL_CONST_MKS_SPEED_OF_LIGHT));
|
24
|
-
rb_define_const(module, "GRAVITATIONAL_CONSTANT",
|
25
|
-
rb_float_new(GSL_CONST_MKS_GRAVITATIONAL_CONSTANT));
|
26
|
-
rb_define_const(module, "PLANCKS_CONSTANT_H",
|
27
|
-
rb_float_new(GSL_CONST_MKS_PLANCKS_CONSTANT_H));
|
28
|
-
rb_define_const(module, "PLANCKS_CONSTANT_HBAR",
|
29
|
-
rb_float_new(GSL_CONST_MKS_PLANCKS_CONSTANT_HBAR));
|
30
|
-
rb_define_const(module, "VACUUM_PERMEABILITY",
|
31
|
-
rb_float_new(GSL_CONST_MKS_VACUUM_PERMEABILITY));
|
32
|
-
rb_define_const(module, "ASTRONOMICAL_UNIT",
|
33
|
-
rb_float_new(GSL_CONST_MKS_ASTRONOMICAL_UNIT));
|
34
|
-
rb_define_const(module, "LIGHT_YEAR", rb_float_new(GSL_CONST_MKS_LIGHT_YEAR));
|
35
|
-
rb_define_const(module, "PARSEC", rb_float_new(GSL_CONST_MKS_PARSEC));
|
36
|
-
rb_define_const(module, "GRAV_ACCEL", rb_float_new(GSL_CONST_MKS_GRAV_ACCEL));
|
37
|
-
rb_define_const(module, "ELECTRON_VOLT",
|
38
|
-
rb_float_new(GSL_CONST_MKS_ELECTRON_VOLT));
|
39
|
-
rb_define_const(module, "MASS_ELECTRON",
|
40
|
-
rb_float_new(GSL_CONST_MKS_MASS_ELECTRON));
|
41
|
-
rb_define_const(module, "MASS_MUON", rb_float_new(GSL_CONST_MKS_MASS_MUON));
|
42
|
-
rb_define_const(module, "MASS_PROTON", rb_float_new(GSL_CONST_MKS_MASS_PROTON));
|
43
|
-
rb_define_const(module, "MASS_NEUTRON", rb_float_new(GSL_CONST_MKS_MASS_NEUTRON));
|
44
|
-
rb_define_const(module, "RYDBERG", rb_float_new(GSL_CONST_MKS_RYDBERG));
|
45
|
-
rb_define_const(module, "BOLTZMANN", rb_float_new(GSL_CONST_MKS_BOLTZMANN));
|
46
|
-
rb_define_const(module, "MOLAR_GAS", rb_float_new(GSL_CONST_MKS_MOLAR_GAS));
|
47
|
-
rb_define_const(module, "BOHR_MAGNETON",
|
48
|
-
rb_float_new(GSL_CONST_MKS_BOHR_MAGNETON));
|
49
|
-
rb_define_const(module, "NUCLEAR_MAGNETON",
|
50
|
-
rb_float_new(GSL_CONST_MKS_NUCLEAR_MAGNETON));
|
51
|
-
rb_define_const(module, "ELECTRON_MAGNETIC_MOMENT",
|
52
|
-
rb_float_new(GSL_CONST_MKS_ELECTRON_MAGNETIC_MOMENT));
|
53
|
-
rb_define_const(module, "PROTON_MAGNETIC_MOMENT",
|
54
|
-
rb_float_new(GSL_CONST_MKS_PROTON_MAGNETIC_MOMENT));
|
55
|
-
rb_define_const(module, "STANDARD_GAS_VOLUME",
|
56
|
-
rb_float_new(GSL_CONST_MKS_STANDARD_GAS_VOLUME));
|
57
|
-
|
58
|
-
rb_define_const(module, "MINUTE", rb_float_new(GSL_CONST_MKS_MINUTE));
|
59
|
-
rb_define_const(module, "HOUR", rb_float_new(GSL_CONST_MKS_HOUR));
|
60
|
-
rb_define_const(module, "DAY", rb_float_new(GSL_CONST_MKS_DAY));
|
61
|
-
rb_define_const(module, "WEEK", rb_float_new(GSL_CONST_MKS_WEEK));
|
62
|
-
rb_define_const(module, "INCH", rb_float_new(GSL_CONST_MKS_INCH));
|
63
|
-
rb_define_const(module, "FOOT", rb_float_new(GSL_CONST_MKS_FOOT));
|
64
|
-
rb_define_const(module, "YARD", rb_float_new(GSL_CONST_MKS_YARD));
|
65
|
-
rb_define_const(module, "MILE", rb_float_new(GSL_CONST_MKS_MILE));
|
66
|
-
rb_define_const(module, "NAUTICAL_MILE", rb_float_new(GSL_CONST_MKS_NAUTICAL_MILE));
|
67
|
-
rb_define_const(module, "FATHOM", rb_float_new(GSL_CONST_MKS_FATHOM));
|
68
|
-
rb_define_const(module, "MIL", rb_float_new(GSL_CONST_MKS_MIL));
|
69
|
-
rb_define_const(module, "POINT", rb_float_new(GSL_CONST_MKS_POINT));
|
70
|
-
rb_define_const(module, "TEXPOINT", rb_float_new(GSL_CONST_MKS_TEXPOINT));
|
71
|
-
rb_define_const(module, "MICRON", rb_float_new(GSL_CONST_MKS_MICRON));
|
72
|
-
rb_define_const(module, "ANGSTROM", rb_float_new(GSL_CONST_MKS_ANGSTROM));
|
73
|
-
rb_define_const(module, "HECTARE", rb_float_new(GSL_CONST_MKS_HECTARE));
|
74
|
-
rb_define_const(module, "ACRE", rb_float_new(GSL_CONST_MKS_ACRE));
|
75
|
-
#ifdef GSL_0_9_4_LATER
|
76
|
-
rb_define_const(module, "BARN", rb_float_new(GSL_CONST_MKS_BARN));
|
77
|
-
rb_define_const(module, "BTU", rb_float_new(GSL_CONST_MKS_BTU));
|
78
|
-
rb_define_const(module, "SOLAR_MASS", rb_float_new(GSL_CONST_MKS_SOLAR_MASS));
|
79
|
-
#else
|
80
|
-
rb_define_const(module, "BARN", rb_float_new(1.0e-28));
|
81
|
-
rb_define_const(module, "BTU", rb_float_new(1.05505585262e3));
|
82
|
-
#endif
|
83
|
-
rb_define_const(module, "LITER", rb_float_new(GSL_CONST_MKS_LITER));
|
84
|
-
rb_define_const(module, "US_GALLON", rb_float_new(GSL_CONST_MKS_US_GALLON));
|
85
|
-
rb_define_const(module, "QUART", rb_float_new(GSL_CONST_MKS_QUART));
|
86
|
-
rb_define_const(module, "PINT", rb_float_new(GSL_CONST_MKS_PINT));
|
87
|
-
rb_define_const(module, "CUP", rb_float_new(GSL_CONST_MKS_CUP));
|
88
|
-
rb_define_const(module, "FLUID_OUNCE", rb_float_new(GSL_CONST_MKS_FLUID_OUNCE));
|
89
|
-
rb_define_const(module, "TABLESPOON", rb_float_new(GSL_CONST_MKS_TABLESPOON));
|
90
|
-
rb_define_const(module, "CANADIAN_GALLON",
|
91
|
-
rb_float_new(GSL_CONST_MKS_CANADIAN_GALLON));
|
92
|
-
|
93
|
-
rb_define_const(module, "UK_GALLON", rb_float_new(GSL_CONST_MKS_UK_GALLON));
|
94
|
-
rb_define_const(module, "KILOMETERS_PER_HOUR",
|
95
|
-
rb_float_new(GSL_CONST_MKS_MILES_PER_HOUR));
|
96
|
-
rb_define_const(module, "MILES_PER_HOUR",
|
97
|
-
rb_float_new(GSL_CONST_MKS_KILOMETERS_PER_HOUR));
|
98
|
-
rb_define_const(module, "KNOT", rb_float_new(GSL_CONST_MKS_KNOT));
|
99
|
-
rb_define_const(module, "POUND_MASS", rb_float_new(GSL_CONST_MKS_POUND_MASS));
|
100
|
-
rb_define_const(module, "POUND_OUNCE", rb_float_new(GSL_CONST_MKS_OUNCE_MASS));
|
101
|
-
rb_define_const(module, "POUND_TON", rb_float_new(GSL_CONST_MKS_TON));
|
102
|
-
rb_define_const(module, "POUND_METRIC_TON",
|
103
|
-
rb_float_new(GSL_CONST_MKS_METRIC_TON));
|
104
|
-
rb_define_const(module, "POUND_UK_TON", rb_float_new(GSL_CONST_MKS_UK_TON));
|
105
|
-
rb_define_const(module, "POUND_TROY_OUNCE",
|
106
|
-
rb_float_new(GSL_CONST_MKS_TROY_OUNCE));
|
107
|
-
rb_define_const(module, "CARAT", rb_float_new(GSL_CONST_MKS_CARAT));
|
108
|
-
rb_define_const(module, "UNIFIED_ATOMIC_MASS",
|
109
|
-
rb_float_new(GSL_CONST_MKS_UNIFIED_ATOMIC_MASS));
|
110
|
-
rb_define_const(module, "GRAM_FORCE", rb_float_new(GSL_CONST_MKS_GRAM_FORCE));
|
111
|
-
rb_define_const(module, "POUND_FORCE", rb_float_new(GSL_CONST_MKS_POUND_FORCE));
|
112
|
-
rb_define_const(module, "KILOPOUND_FORCE",
|
113
|
-
rb_float_new(GSL_CONST_MKS_KILOPOUND_FORCE));
|
114
|
-
rb_define_const(module, "POUNDAL", rb_float_new(GSL_CONST_MKS_POUNDAL));
|
115
|
-
rb_define_const(module, "CALORIE", rb_float_new(GSL_CONST_MKS_CALORIE));
|
116
|
-
rb_define_const(module, "THERM", rb_float_new(GSL_CONST_MKS_THERM));
|
117
|
-
rb_define_const(module, "HORSEPOWER", rb_float_new(GSL_CONST_MKS_HORSEPOWER));
|
118
|
-
rb_define_const(module, "BAR", rb_float_new(GSL_CONST_MKS_BAR));
|
119
|
-
rb_define_const(module, "STD_ATMOSPHERE",
|
120
|
-
rb_float_new(GSL_CONST_MKS_STD_ATMOSPHERE));
|
121
|
-
rb_define_const(module, "TORR", rb_float_new(GSL_CONST_MKS_TORR));
|
122
|
-
rb_define_const(module, "METER_OF_MERCURY",
|
123
|
-
rb_float_new(GSL_CONST_MKS_METER_OF_MERCURY));
|
124
|
-
rb_define_const(module, "INCH_OF_MERCURY",
|
125
|
-
rb_float_new(GSL_CONST_MKS_INCH_OF_MERCURY));
|
126
|
-
rb_define_const(module, "INCH_OF_WATER",
|
127
|
-
rb_float_new(GSL_CONST_MKS_INCH_OF_WATER));
|
128
|
-
rb_define_const(module, "PSI", rb_float_new(GSL_CONST_MKS_PSI));
|
129
|
-
rb_define_const(module, "POISE", rb_float_new(GSL_CONST_MKS_POISE));
|
130
|
-
rb_define_const(module, "STOKES", rb_float_new(GSL_CONST_MKS_STOKES));
|
131
|
-
rb_define_const(module, "FARADAY", rb_float_new(GSL_CONST_MKS_FARADAY));
|
132
|
-
rb_define_const(module, "ELECTRON_CHARGE",
|
133
|
-
rb_float_new(GSL_CONST_MKS_ELECTRON_CHARGE));
|
134
|
-
rb_define_const(module, "GAUSS", rb_float_new(GSL_CONST_MKS_GAUSS));
|
135
|
-
rb_define_const(module, "STILB", rb_float_new(GSL_CONST_MKS_STILB));
|
136
|
-
rb_define_const(module, "LUMEN", rb_float_new(GSL_CONST_MKS_LUMEN));
|
137
|
-
rb_define_const(module, "LUX", rb_float_new(GSL_CONST_MKS_LUX));
|
138
|
-
rb_define_const(module, "PHOT", rb_float_new(GSL_CONST_MKS_PHOT));
|
139
|
-
rb_define_const(module, "FOOTCANDLE", rb_float_new(GSL_CONST_MKS_FOOTCANDLE));
|
140
|
-
rb_define_const(module, "LAMBERT", rb_float_new(GSL_CONST_MKS_LAMBERT));
|
141
|
-
rb_define_const(module, "CURIE", rb_float_new(GSL_CONST_MKS_CURIE));
|
142
|
-
rb_define_const(module, "ROENTGEN", rb_float_new(GSL_CONST_MKS_ROENTGEN));
|
143
|
-
rb_define_const(module, "RAD", rb_float_new(GSL_CONST_MKS_RAD));
|
144
|
-
|
145
|
-
#ifdef GSL_1_1_LATER
|
146
|
-
rb_define_const(module, "VACUUM_PERMITTIVITY",
|
147
|
-
rb_float_new(GSL_CONST_MKS_VACUUM_PERMITTIVITY));
|
148
|
-
rb_define_const(module, "BOHR_RADIUS", rb_float_new(GSL_CONST_MKS_BOHR_RADIUS));
|
149
|
-
#endif
|
150
|
-
|
151
|
-
#ifdef GSL_1_2_LATER
|
152
|
-
rb_define_const(module, "NEWTON", rb_float_new(GSL_CONST_MKS_NEWTON));
|
153
|
-
rb_define_const(module, "DYNE", rb_float_new(GSL_CONST_MKS_DYNE));
|
154
|
-
rb_define_const(module, "JOULE", rb_float_new(GSL_CONST_MKS_JOULE));
|
155
|
-
rb_define_const(module, "ERG", rb_float_new(GSL_CONST_MKS_ERG));
|
156
|
-
#endif
|
157
|
-
|
158
|
-
#ifdef GSL_1_8_LATER
|
159
|
-
rb_define_const(module, "DEBYE", rb_float_new(GSL_CONST_MKS_DEBYE));
|
160
|
-
#endif
|
161
|
-
|
162
|
-
}
|
163
|
-
|
164
|
-
static void rb_gsl_const_cgs(VALUE module)
|
165
|
-
{
|
166
|
-
rb_define_const(module, "SPEED_OF_LIGHT",
|
167
|
-
rb_float_new(GSL_CONST_CGS_SPEED_OF_LIGHT));
|
168
|
-
rb_define_const(module, "GRAVITATIONAL_CONSTANT",
|
169
|
-
rb_float_new(GSL_CONST_CGS_GRAVITATIONAL_CONSTANT));
|
170
|
-
rb_define_const(module, "PLANCKS_CONSTANT_H",
|
171
|
-
rb_float_new(GSL_CONST_CGS_PLANCKS_CONSTANT_H));
|
172
|
-
rb_define_const(module, "PLANCKS_CONSTANT_HBAR",
|
173
|
-
rb_float_new(GSL_CONST_CGS_PLANCKS_CONSTANT_HBAR));
|
174
|
-
rb_define_const(module, "ASTRONOMICAL_UNIT",
|
175
|
-
rb_float_new(GSL_CONST_CGS_ASTRONOMICAL_UNIT));
|
176
|
-
rb_define_const(module, "LIGHT_YEAR", rb_float_new(GSL_CONST_CGS_LIGHT_YEAR));
|
177
|
-
rb_define_const(module, "PARSEC", rb_float_new(GSL_CONST_CGS_PARSEC));
|
178
|
-
rb_define_const(module, "GRAV_ACCEL", rb_float_new(GSL_CONST_CGS_GRAV_ACCEL));
|
179
|
-
rb_define_const(module, "ELECTRON_VOLT",
|
180
|
-
rb_float_new(GSL_CONST_CGS_ELECTRON_VOLT));
|
181
|
-
rb_define_const(module, "MASS_ELECTRON",
|
182
|
-
rb_float_new(GSL_CONST_CGS_MASS_ELECTRON));
|
183
|
-
rb_define_const(module, "MASS_MUON", rb_float_new(GSL_CONST_CGS_MASS_MUON));
|
184
|
-
rb_define_const(module, "MASS_PROTON",
|
185
|
-
rb_float_new(GSL_CONST_CGS_MASS_PROTON));
|
186
|
-
rb_define_const(module, "MASS_NEUTRON", rb_float_new(GSL_CONST_CGS_MASS_NEUTRON));
|
187
|
-
rb_define_const(module, "RYDBERG", rb_float_new(GSL_CONST_CGS_RYDBERG));
|
188
|
-
rb_define_const(module, "BOHR_MAGNETON",
|
189
|
-
rb_float_new(GSL_CONST_CGS_BOHR_MAGNETON));
|
190
|
-
|
191
|
-
rb_define_const(module, "NUCLEAR_MAGNETON",
|
192
|
-
rb_float_new(GSL_CONST_CGS_NUCLEAR_MAGNETON));
|
193
|
-
rb_define_const(module, "ELECTRON_MAGNETIC_MOMENT",
|
194
|
-
rb_float_new(GSL_CONST_CGS_ELECTRON_MAGNETIC_MOMENT));
|
195
|
-
rb_define_const(module, "PROTON_MAGNETIC_MOMENT",
|
196
|
-
rb_float_new(GSL_CONST_CGS_PROTON_MAGNETIC_MOMENT));
|
197
|
-
rb_define_const(module, "STANDARD_GAS_VOLUME",
|
198
|
-
rb_float_new(GSL_CONST_CGS_STANDARD_GAS_VOLUME));
|
199
|
-
|
200
|
-
rb_define_const(module, "MINUTE", rb_float_new(GSL_CONST_CGS_MINUTE));
|
201
|
-
rb_define_const(module, "HOUR", rb_float_new(GSL_CONST_CGS_HOUR));
|
202
|
-
rb_define_const(module, "DAY", rb_float_new(GSL_CONST_CGS_DAY));
|
203
|
-
rb_define_const(module, "WEEK", rb_float_new(GSL_CONST_CGS_WEEK));
|
204
|
-
rb_define_const(module, "INCH", rb_float_new(GSL_CONST_CGS_INCH));
|
205
|
-
rb_define_const(module, "FOOT", rb_float_new(GSL_CONST_CGS_FOOT));
|
206
|
-
rb_define_const(module, "YARD", rb_float_new(GSL_CONST_CGS_YARD));
|
207
|
-
rb_define_const(module, "MILE", rb_float_new(GSL_CONST_CGS_MILE));
|
208
|
-
rb_define_const(module, "NAUTICAL_MILE",
|
209
|
-
rb_float_new(GSL_CONST_CGS_NAUTICAL_MILE));
|
210
|
-
rb_define_const(module, "FATHOM", rb_float_new(GSL_CONST_CGS_FATHOM));
|
211
|
-
rb_define_const(module, "MIL", rb_float_new(GSL_CONST_CGS_MIL));
|
212
|
-
rb_define_const(module, "POINT", rb_float_new(GSL_CONST_CGS_POINT));
|
213
|
-
rb_define_const(module, "TEXPOINT", rb_float_new(GSL_CONST_CGS_TEXPOINT));
|
214
|
-
rb_define_const(module, "MICRON", rb_float_new(GSL_CONST_CGS_MICRON));
|
215
|
-
rb_define_const(module, "ANGSTROM", rb_float_new(GSL_CONST_CGS_ANGSTROM));
|
216
|
-
rb_define_const(module, "HECTARE", rb_float_new(GSL_CONST_CGS_HECTARE));
|
217
|
-
rb_define_const(module, "ACRE", rb_float_new(GSL_CONST_CGS_ACRE));
|
218
|
-
#ifdef GSL_0_9_4_LATER
|
219
|
-
rb_define_const(module, "BARN", rb_float_new(GSL_CONST_CGS_BARN));
|
220
|
-
rb_define_const(module, "BTU", rb_float_new(GSL_CONST_CGS_BTU));
|
221
|
-
rb_define_const(module, "SOLAR_MASS", rb_float_new(GSL_CONST_CGS_SOLAR_MASS));
|
222
|
-
#else
|
223
|
-
rb_define_const(module, "BARN", rb_float_new(1e-24));
|
224
|
-
rb_define_const(module, "BTU", rb_float_new(1.05505585262e10));
|
225
|
-
#endif
|
226
|
-
rb_define_const(module, "LITER", rb_float_new(GSL_CONST_CGS_LITER));
|
227
|
-
rb_define_const(module, "US_GALLON", rb_float_new(GSL_CONST_CGS_US_GALLON));
|
228
|
-
rb_define_const(module, "QUART", rb_float_new(GSL_CONST_CGS_QUART));
|
229
|
-
rb_define_const(module, "PINT", rb_float_new(GSL_CONST_CGS_PINT));
|
230
|
-
rb_define_const(module, "CUP", rb_float_new(GSL_CONST_CGS_CUP));
|
231
|
-
rb_define_const(module, "FLUID_OUNCE", rb_float_new(GSL_CONST_CGS_FLUID_OUNCE));
|
232
|
-
rb_define_const(module, "TABLESPOON", rb_float_new(GSL_CONST_CGS_TABLESPOON));
|
233
|
-
rb_define_const(module, "CANADIAN_GALLON",
|
234
|
-
rb_float_new(GSL_CONST_CGS_CANADIAN_GALLON));
|
235
|
-
|
236
|
-
rb_define_const(module, "UK_GALLON", rb_float_new(GSL_CONST_CGS_UK_GALLON));
|
237
|
-
rb_define_const(module, "KILOMETERS_PER_HOUR",
|
238
|
-
rb_float_new(GSL_CONST_CGS_MILES_PER_HOUR));
|
239
|
-
rb_define_const(module, "MILES_PER_HOUR",
|
240
|
-
rb_float_new(GSL_CONST_CGS_KILOMETERS_PER_HOUR));
|
241
|
-
rb_define_const(module, "KNOT", rb_float_new(GSL_CONST_CGS_KNOT));
|
242
|
-
rb_define_const(module, "POUND_MASS", rb_float_new(GSL_CONST_CGS_POUND_MASS));
|
243
|
-
rb_define_const(module, "POUND_OUNCE", rb_float_new(GSL_CONST_CGS_OUNCE_MASS));
|
244
|
-
rb_define_const(module, "POUND_TON", rb_float_new(GSL_CONST_CGS_TON));
|
245
|
-
rb_define_const(module, "POUND_METRIC_TON",
|
246
|
-
rb_float_new(GSL_CONST_CGS_METRIC_TON));
|
247
|
-
rb_define_const(module, "POUND_UK_TON", rb_float_new(GSL_CONST_CGS_UK_TON));
|
248
|
-
rb_define_const(module, "POUND_TROY_OUNCE",
|
249
|
-
rb_float_new(GSL_CONST_CGS_TROY_OUNCE));
|
250
|
-
rb_define_const(module, "CARAT", rb_float_new(GSL_CONST_CGS_CARAT));
|
251
|
-
rb_define_const(module, "UNIFIED_ATOMIC_MASS",
|
252
|
-
rb_float_new(GSL_CONST_CGS_UNIFIED_ATOMIC_MASS));
|
253
|
-
rb_define_const(module, "GRAM_FORCE", rb_float_new(GSL_CONST_CGS_GRAM_FORCE));
|
254
|
-
rb_define_const(module, "POUND_FORCE", rb_float_new(GSL_CONST_CGS_POUND_FORCE));
|
255
|
-
rb_define_const(module, "KILOPOUND_FORCE",
|
256
|
-
rb_float_new(GSL_CONST_CGS_KILOPOUND_FORCE));
|
257
|
-
rb_define_const(module, "POUNDAL", rb_float_new(GSL_CONST_CGS_POUNDAL));
|
258
|
-
rb_define_const(module, "CALORIE", rb_float_new(GSL_CONST_CGS_CALORIE));
|
259
|
-
rb_define_const(module, "THERM", rb_float_new(GSL_CONST_CGS_THERM));
|
260
|
-
rb_define_const(module, "HORSEPOWER", rb_float_new(GSL_CONST_CGS_HORSEPOWER));
|
261
|
-
rb_define_const(module, "BAR", rb_float_new(GSL_CONST_CGS_BAR));
|
262
|
-
rb_define_const(module, "STD_ATMOSPHERE",
|
263
|
-
rb_float_new(GSL_CONST_CGS_STD_ATMOSPHERE));
|
264
|
-
rb_define_const(module, "TORR", rb_float_new(GSL_CONST_CGS_TORR));
|
265
|
-
rb_define_const(module, "METER_OF_MERCURY",
|
266
|
-
rb_float_new(GSL_CONST_CGS_METER_OF_MERCURY));
|
267
|
-
rb_define_const(module, "INCH_OF_MERCURY",
|
268
|
-
rb_float_new(GSL_CONST_CGS_INCH_OF_MERCURY));
|
269
|
-
rb_define_const(module, "INCH_OF_WATER",
|
270
|
-
rb_float_new(GSL_CONST_CGS_INCH_OF_WATER));
|
271
|
-
rb_define_const(module, "PSI", rb_float_new(GSL_CONST_CGS_PSI));
|
272
|
-
rb_define_const(module, "POISE", rb_float_new(GSL_CONST_CGS_POISE));
|
273
|
-
rb_define_const(module, "STOKES", rb_float_new(GSL_CONST_CGS_STOKES));
|
274
|
-
rb_define_const(module, "FARADAY", rb_float_new(GSL_CONST_CGS_FARADAY));
|
275
|
-
rb_define_const(module, "ELECTRON_CHARGE",
|
276
|
-
rb_float_new(GSL_CONST_CGS_ELECTRON_CHARGE));
|
277
|
-
rb_define_const(module, "ELECTRON_CHARGE_ESU",
|
278
|
-
rb_float_new(GSL_CONST_CGS_ELECTRON_CHARGE*GSL_CONST_CGS_SPEED_OF_LIGHT));
|
279
|
-
rb_define_const(module, "GAUSS", rb_float_new(GSL_CONST_CGS_GAUSS));
|
280
|
-
rb_define_const(module, "STILB", rb_float_new(GSL_CONST_CGS_STILB));
|
281
|
-
rb_define_const(module, "LUMEN", rb_float_new(GSL_CONST_CGS_LUMEN));
|
282
|
-
rb_define_const(module, "LUX", rb_float_new(GSL_CONST_CGS_LUX));
|
283
|
-
rb_define_const(module, "PHOT", rb_float_new(GSL_CONST_CGS_PHOT));
|
284
|
-
rb_define_const(module, "FOOTCANDLE", rb_float_new(GSL_CONST_CGS_FOOTCANDLE));
|
285
|
-
rb_define_const(module, "LAMBERT", rb_float_new(GSL_CONST_CGS_LAMBERT));
|
286
|
-
rb_define_const(module, "CURIE", rb_float_new(GSL_CONST_CGS_CURIE));
|
287
|
-
rb_define_const(module, "ROENTGEN", rb_float_new(GSL_CONST_CGS_ROENTGEN));
|
288
|
-
rb_define_const(module, "RAD", rb_float_new(GSL_CONST_CGS_RAD));
|
289
|
-
|
290
|
-
rb_define_const(module, "BOLTZMANN", rb_float_new(GSL_CONST_CGS_BOLTZMANN));
|
291
|
-
rb_define_const(module, "MOLAR_GAS", rb_float_new(GSL_CONST_CGS_MOLAR_GAS));
|
292
|
-
|
293
|
-
#ifdef GSL_1_1_LATER
|
294
|
-
rb_define_const(module, "BOHR_RADIUS", rb_float_new(GSL_CONST_CGS_BOHR_RADIUS));
|
295
|
-
#endif
|
296
|
-
#ifdef GSL_1_2_LATER
|
297
|
-
rb_define_const(module, "NEWTON", rb_float_new(GSL_CONST_CGS_NEWTON));
|
298
|
-
rb_define_const(module, "DYNE", rb_float_new(GSL_CONST_CGS_DYNE));
|
299
|
-
rb_define_const(module, "JOULE", rb_float_new(GSL_CONST_CGS_JOULE));
|
300
|
-
rb_define_const(module, "ERG", rb_float_new(GSL_CONST_CGS_ERG));
|
301
|
-
#endif
|
302
|
-
|
303
|
-
}
|
304
|
-
|
305
|
-
static void rb_gsl_const_num(VALUE module)
|
306
|
-
{
|
307
|
-
rb_define_const(module, "AVOGADRO", rb_float_new(GSL_CONST_NUM_AVOGADRO));
|
308
|
-
rb_define_const(module, "FINE_STRUCTURE",
|
309
|
-
rb_float_new(GSL_CONST_NUM_FINE_STRUCTURE));
|
310
|
-
#ifdef GSL_1_2_LATER
|
311
|
-
rb_define_const(module, "YOTTA", rb_float_new(GSL_CONST_NUM_YOTTA));
|
312
|
-
rb_define_const(module, "ZETTA", rb_float_new(GSL_CONST_NUM_ZETTA));
|
313
|
-
rb_define_const(module, "EXA", rb_float_new(GSL_CONST_NUM_EXA));
|
314
|
-
rb_define_const(module, "PETA", rb_float_new(GSL_CONST_NUM_PETA));
|
315
|
-
rb_define_const(module, "TERA", rb_float_new(GSL_CONST_NUM_TERA));
|
316
|
-
rb_define_const(module, "GIGA", rb_float_new(GSL_CONST_NUM_GIGA));
|
317
|
-
rb_define_const(module, "MEGA", rb_float_new(GSL_CONST_NUM_MEGA));
|
318
|
-
rb_define_const(module, "KILO", rb_float_new(GSL_CONST_NUM_KILO));
|
319
|
-
rb_define_const(module, "MILLI", rb_float_new(GSL_CONST_NUM_MILLI));
|
320
|
-
rb_define_const(module, "MICRO", rb_float_new(GSL_CONST_NUM_MICRO));
|
321
|
-
rb_define_const(module, "NANO", rb_float_new(GSL_CONST_NUM_NANO));
|
322
|
-
rb_define_const(module, "PICO", rb_float_new(GSL_CONST_NUM_PICO));
|
323
|
-
rb_define_const(module, "FEMTO", rb_float_new(GSL_CONST_NUM_FEMTO));
|
324
|
-
rb_define_const(module, "ATTO", rb_float_new(GSL_CONST_NUM_ATTO));
|
325
|
-
rb_define_const(module, "ZEPTO", rb_float_new(GSL_CONST_NUM_ZEPTO));
|
326
|
-
rb_define_const(module, "YOCTO", rb_float_new(GSL_CONST_NUM_YOCTO));
|
327
|
-
#endif
|
328
|
-
}
|
329
|
-
|
330
|
-
void Init_gsl_const(VALUE module)
|
331
|
-
{
|
332
|
-
VALUE mgsl_const;
|
333
|
-
VALUE mgsl_const_mks, mgsl_const_cgs, mgsl_const_num;
|
334
|
-
|
335
|
-
mgsl_const = rb_define_module_under(module, "CONST");
|
336
|
-
mgsl_const_mks = rb_define_module_under(mgsl_const, "MKSA");
|
337
|
-
rb_gsl_const_mks(mgsl_const_mks);
|
338
|
-
mgsl_const_cgs = rb_define_module_under(mgsl_const, "CGSM");
|
339
|
-
rb_gsl_const_cgs(mgsl_const_cgs);
|
340
|
-
mgsl_const_num = rb_define_module_under(mgsl_const, "NUM");
|
341
|
-
rb_gsl_const_num(mgsl_const_num);
|
342
|
-
Init_gsl_const_additional(mgsl_const_mks, mgsl_const_cgs, mgsl_const_num);
|
343
|
-
}
|
344
|
-
|
345
|
-
#else
|
346
|
-
|
347
|
-
static void rb_gsl_const_mks(VALUE module)
|
348
|
-
{
|
349
|
-
rb_define_const(module, "SPEED_OF_LIGHT",
|
350
|
-
rb_float_new(GSL_CONST_MKSA_SPEED_OF_LIGHT));
|
351
|
-
rb_define_const(module, "GRAVITATIONAL_CONSTANT",
|
352
|
-
rb_float_new(GSL_CONST_MKSA_GRAVITATIONAL_CONSTANT));
|
353
|
-
rb_define_const(module, "PLANCKS_CONSTANT_H",
|
354
|
-
rb_float_new(GSL_CONST_MKSA_PLANCKS_CONSTANT_H));
|
355
|
-
rb_define_const(module, "PLANCKS_CONSTANT_HBAR",
|
356
|
-
rb_float_new(GSL_CONST_MKSA_PLANCKS_CONSTANT_HBAR));
|
357
|
-
rb_define_const(module, "VACUUM_PERMEABILITY",
|
358
|
-
rb_float_new(GSL_CONST_MKSA_VACUUM_PERMEABILITY));
|
359
|
-
rb_define_const(module, "VACUUM_PERMITTIVITY",
|
360
|
-
rb_float_new(GSL_CONST_MKSA_VACUUM_PERMITTIVITY));
|
361
|
-
rb_define_const(module, "ASTRONOMICAL_UNIT",
|
362
|
-
rb_float_new(GSL_CONST_MKSA_ASTRONOMICAL_UNIT));
|
363
|
-
rb_define_const(module, "LIGHT_YEAR", rb_float_new(GSL_CONST_MKSA_LIGHT_YEAR));
|
364
|
-
rb_define_const(module, "PARSEC", rb_float_new(GSL_CONST_MKSA_PARSEC));
|
365
|
-
rb_define_const(module, "GRAV_ACCEL", rb_float_new(GSL_CONST_MKSA_GRAV_ACCEL));
|
366
|
-
rb_define_const(module, "ELECTRON_VOLT",
|
367
|
-
rb_float_new(GSL_CONST_MKSA_ELECTRON_VOLT));
|
368
|
-
rb_define_const(module, "MASS_ELECTRON",
|
369
|
-
rb_float_new(GSL_CONST_MKSA_MASS_ELECTRON));
|
370
|
-
rb_define_const(module, "MASS_MUON", rb_float_new(GSL_CONST_MKSA_MASS_MUON));
|
371
|
-
rb_define_const(module, "MASS_PROTON", rb_float_new(GSL_CONST_MKSA_MASS_PROTON));
|
372
|
-
rb_define_const(module, "MASS_NEUTRON", rb_float_new(GSL_CONST_MKSA_MASS_NEUTRON));
|
373
|
-
rb_define_const(module, "RYDBERG", rb_float_new(GSL_CONST_MKSA_RYDBERG));
|
374
|
-
rb_define_const(module, "BOHR_MAGNETON",
|
375
|
-
rb_float_new(GSL_CONST_MKSA_BOHR_MAGNETON));
|
376
|
-
rb_define_const(module, "NUCLEAR_MAGNETON",
|
377
|
-
rb_float_new(GSL_CONST_MKSA_NUCLEAR_MAGNETON));
|
378
|
-
rb_define_const(module, "ELECTRON_MAGNETIC_MOMENT",
|
379
|
-
rb_float_new(GSL_CONST_MKSA_ELECTRON_MAGNETIC_MOMENT));
|
380
|
-
rb_define_const(module, "PROTON_MAGNETIC_MOMENT",
|
381
|
-
rb_float_new(GSL_CONST_MKSA_PROTON_MAGNETIC_MOMENT));
|
382
|
-
rb_define_const(module, "STANDARD_GAS_VOLUME",
|
383
|
-
rb_float_new(GSL_CONST_MKSA_STANDARD_GAS_VOLUME));
|
384
|
-
|
385
|
-
rb_define_const(module, "MINUTE", rb_float_new(GSL_CONST_MKSA_MINUTE));
|
386
|
-
rb_define_const(module, "HOUR", rb_float_new(GSL_CONST_MKSA_HOUR));
|
387
|
-
rb_define_const(module, "DAY", rb_float_new(GSL_CONST_MKSA_DAY));
|
388
|
-
rb_define_const(module, "WEEK", rb_float_new(GSL_CONST_MKSA_WEEK));
|
389
|
-
rb_define_const(module, "INCH", rb_float_new(GSL_CONST_MKSA_INCH));
|
390
|
-
rb_define_const(module, "FOOT", rb_float_new(GSL_CONST_MKSA_FOOT));
|
391
|
-
rb_define_const(module, "YARD", rb_float_new(GSL_CONST_MKSA_YARD));
|
392
|
-
rb_define_const(module, "MILE", rb_float_new(GSL_CONST_MKSA_MILE));
|
393
|
-
rb_define_const(module, "NAUTICAL_MILE",
|
394
|
-
rb_float_new(GSL_CONST_MKSA_NAUTICAL_MILE));
|
395
|
-
rb_define_const(module, "FATHOM", rb_float_new(GSL_CONST_MKSA_FATHOM));
|
396
|
-
rb_define_const(module, "MIL", rb_float_new(GSL_CONST_MKSA_MIL));
|
397
|
-
rb_define_const(module, "POINT", rb_float_new(GSL_CONST_MKSA_POINT));
|
398
|
-
rb_define_const(module, "TEXPOINT", rb_float_new(GSL_CONST_MKSA_TEXPOINT));
|
399
|
-
rb_define_const(module, "MICRON", rb_float_new(GSL_CONST_MKSA_MICRON));
|
400
|
-
rb_define_const(module, "ANGSTROM", rb_float_new(GSL_CONST_MKSA_ANGSTROM));
|
401
|
-
rb_define_const(module, "HECTARE", rb_float_new(GSL_CONST_MKSA_HECTARE));
|
402
|
-
rb_define_const(module, "ACRE", rb_float_new(GSL_CONST_MKSA_ACRE));
|
403
|
-
rb_define_const(module, "BARN", rb_float_new(GSL_CONST_MKSA_BARN));
|
404
|
-
rb_define_const(module, "LITER", rb_float_new(GSL_CONST_MKSA_LITER));
|
405
|
-
rb_define_const(module, "US_GALLON", rb_float_new(GSL_CONST_MKSA_US_GALLON));
|
406
|
-
rb_define_const(module, "QUART", rb_float_new(GSL_CONST_MKSA_QUART));
|
407
|
-
rb_define_const(module, "PINT", rb_float_new(GSL_CONST_MKSA_PINT));
|
408
|
-
rb_define_const(module, "CUP", rb_float_new(GSL_CONST_MKSA_CUP));
|
409
|
-
rb_define_const(module, "FLUID_OUNCE", rb_float_new(GSL_CONST_MKSA_FLUID_OUNCE));
|
410
|
-
rb_define_const(module, "TABLESPOON", rb_float_new(GSL_CONST_MKSA_TABLESPOON));
|
411
|
-
rb_define_const(module, "CANADIAN_GALLON",
|
412
|
-
rb_float_new(GSL_CONST_MKSA_CANADIAN_GALLON));
|
413
|
-
|
414
|
-
rb_define_const(module, "UK_GALLON", rb_float_new(GSL_CONST_MKSA_UK_GALLON));
|
415
|
-
rb_define_const(module, "KILOMETERS_PER_HOUR",
|
416
|
-
rb_float_new(GSL_CONST_MKSA_MILES_PER_HOUR));
|
417
|
-
rb_define_const(module, "MILES_PER_HOUR",
|
418
|
-
rb_float_new(GSL_CONST_MKSA_KILOMETERS_PER_HOUR));
|
419
|
-
rb_define_const(module, "KNOT", rb_float_new(GSL_CONST_MKSA_KNOT));
|
420
|
-
rb_define_const(module, "POUND_MASS", rb_float_new(GSL_CONST_MKSA_POUND_MASS));
|
421
|
-
rb_define_const(module, "POUND_OUNCE", rb_float_new(GSL_CONST_MKSA_OUNCE_MASS));
|
422
|
-
rb_define_const(module, "POUND_TON", rb_float_new(GSL_CONST_MKSA_TON));
|
423
|
-
rb_define_const(module, "POUND_METRIC_TON",
|
424
|
-
rb_float_new(GSL_CONST_MKSA_METRIC_TON));
|
425
|
-
rb_define_const(module, "POUND_UK_TON", rb_float_new(GSL_CONST_MKSA_UK_TON));
|
426
|
-
rb_define_const(module, "POUND_TROY_OUNCE",
|
427
|
-
rb_float_new(GSL_CONST_MKSA_TROY_OUNCE));
|
428
|
-
rb_define_const(module, "CARAT", rb_float_new(GSL_CONST_MKSA_CARAT));
|
429
|
-
rb_define_const(module, "UNIFIED_ATOMIC_MASS",
|
430
|
-
rb_float_new(GSL_CONST_MKSA_UNIFIED_ATOMIC_MASS));
|
431
|
-
rb_define_const(module, "GRAM_FORCE", rb_float_new(GSL_CONST_MKSA_GRAM_FORCE));
|
432
|
-
rb_define_const(module, "POUND_FORCE", rb_float_new(GSL_CONST_MKSA_POUND_FORCE));
|
433
|
-
rb_define_const(module, "KILOPOUND_FORCE",
|
434
|
-
rb_float_new(GSL_CONST_MKSA_KILOPOUND_FORCE));
|
435
|
-
rb_define_const(module, "POUNDAL", rb_float_new(GSL_CONST_MKSA_POUNDAL));
|
436
|
-
rb_define_const(module, "CALORIE", rb_float_new(GSL_CONST_MKSA_CALORIE));
|
437
|
-
rb_define_const(module, "BTU", rb_float_new(GSL_CONST_MKSA_BTU));
|
438
|
-
rb_define_const(module, "THERM", rb_float_new(GSL_CONST_MKSA_THERM));
|
439
|
-
rb_define_const(module, "HORSEPOWER", rb_float_new(GSL_CONST_MKSA_HORSEPOWER));
|
440
|
-
rb_define_const(module, "BAR", rb_float_new(GSL_CONST_MKSA_BAR));
|
441
|
-
rb_define_const(module, "STD_ATMOSPHERE",
|
442
|
-
rb_float_new(GSL_CONST_MKSA_STD_ATMOSPHERE));
|
443
|
-
rb_define_const(module, "TORR", rb_float_new(GSL_CONST_MKSA_TORR));
|
444
|
-
rb_define_const(module, "METER_OF_MERCURY",
|
445
|
-
rb_float_new(GSL_CONST_MKSA_METER_OF_MERCURY));
|
446
|
-
rb_define_const(module, "INCH_OF_MERCURY",
|
447
|
-
rb_float_new(GSL_CONST_MKSA_INCH_OF_MERCURY));
|
448
|
-
rb_define_const(module, "INCH_OF_WATER",
|
449
|
-
rb_float_new(GSL_CONST_MKSA_INCH_OF_WATER));
|
450
|
-
rb_define_const(module, "PSI", rb_float_new(GSL_CONST_MKSA_PSI));
|
451
|
-
rb_define_const(module, "POISE", rb_float_new(GSL_CONST_MKSA_POISE));
|
452
|
-
rb_define_const(module, "STOKES", rb_float_new(GSL_CONST_MKSA_STOKES));
|
453
|
-
rb_define_const(module, "FARADAY", rb_float_new(GSL_CONST_MKSA_FARADAY));
|
454
|
-
rb_define_const(module, "ELECTRON_CHARGE",
|
455
|
-
rb_float_new(GSL_CONST_MKSA_ELECTRON_CHARGE));
|
456
|
-
rb_define_const(module, "GAUSS", rb_float_new(GSL_CONST_MKSA_GAUSS));
|
457
|
-
rb_define_const(module, "STILB", rb_float_new(GSL_CONST_MKSA_STILB));
|
458
|
-
rb_define_const(module, "LUMEN", rb_float_new(GSL_CONST_MKSA_LUMEN));
|
459
|
-
rb_define_const(module, "LUX", rb_float_new(GSL_CONST_MKSA_LUX));
|
460
|
-
rb_define_const(module, "PHOT", rb_float_new(GSL_CONST_MKSA_PHOT));
|
461
|
-
rb_define_const(module, "FOOTCANDLE", rb_float_new(GSL_CONST_MKSA_FOOTCANDLE));
|
462
|
-
rb_define_const(module, "LAMBERT", rb_float_new(GSL_CONST_MKSA_LAMBERT));
|
463
|
-
rb_define_const(module, "CURIE", rb_float_new(GSL_CONST_MKSA_CURIE));
|
464
|
-
rb_define_const(module, "ROENTGEN", rb_float_new(GSL_CONST_MKSA_ROENTGEN));
|
465
|
-
rb_define_const(module, "RAD", rb_float_new(GSL_CONST_MKSA_RAD));
|
466
|
-
rb_define_const(module, "SOLAR_MASS", rb_float_new(GSL_CONST_MKSA_SOLAR_MASS));
|
467
|
-
|
468
|
-
rb_define_const(module, "BOLTZMANN", rb_float_new(GSL_CONST_MKSA_BOLTZMANN));
|
469
|
-
rb_define_const(module, "MOLAR_GAS", rb_float_new(GSL_CONST_MKSA_MOLAR_GAS));
|
470
|
-
|
471
|
-
rb_define_const(module, "BOHR_RADIUS", rb_float_new(GSL_CONST_MKSA_BOHR_RADIUS));
|
472
|
-
rb_define_const(module, "NEWTON", rb_float_new(GSL_CONST_MKSA_NEWTON));
|
473
|
-
rb_define_const(module, "DYNE", rb_float_new(GSL_CONST_MKSA_DYNE));
|
474
|
-
rb_define_const(module, "JOULE", rb_float_new(GSL_CONST_MKSA_JOULE));
|
475
|
-
rb_define_const(module, "ERG", rb_float_new(GSL_CONST_MKSA_ERG));
|
476
|
-
|
477
|
-
#ifdef GSL_1_4_9_LATER
|
478
|
-
rb_define_const(module, "STEFAN_BOLTZMANN_CONSTANT",
|
479
|
-
rb_float_new(GSL_CONST_MKSA_STEFAN_BOLTZMANN_CONSTANT));
|
480
|
-
rb_define_const(module, "THOMSON_CROSS_SECTION",
|
481
|
-
rb_float_new(GSL_CONST_MKSA_THOMSON_CROSS_SECTION));
|
482
|
-
#endif
|
483
|
-
|
484
|
-
|
485
|
-
#ifdef GSL_1_8_LATER
|
486
|
-
rb_define_const(module, "DEBYE", rb_float_new(GSL_CONST_MKSA_DEBYE));
|
487
|
-
#endif
|
488
|
-
|
489
|
-
}
|
490
|
-
|
491
|
-
|
492
|
-
static void rb_gsl_const_cgs(VALUE module)
|
493
|
-
{
|
494
|
-
rb_define_const(module, "SPEED_OF_LIGHT",
|
495
|
-
rb_float_new(GSL_CONST_CGSM_SPEED_OF_LIGHT));
|
496
|
-
rb_define_const(module, "GRAVITATIONAL_CONSTANT",
|
497
|
-
rb_float_new(GSL_CONST_CGSM_GRAVITATIONAL_CONSTANT));
|
498
|
-
rb_define_const(module, "PLANCKS_CONSTANT_H",
|
499
|
-
rb_float_new(GSL_CONST_CGSM_PLANCKS_CONSTANT_H));
|
500
|
-
rb_define_const(module, "PLANCKS_CONSTANT_HBAR",
|
501
|
-
rb_float_new(GSL_CONST_CGSM_PLANCKS_CONSTANT_HBAR));
|
502
|
-
rb_define_const(module, "ASTRONOMICAL_UNIT",
|
503
|
-
rb_float_new(GSL_CONST_CGSM_ASTRONOMICAL_UNIT));
|
504
|
-
rb_define_const(module, "LIGHT_YEAR",
|
505
|
-
rb_float_new(GSL_CONST_CGSM_LIGHT_YEAR));
|
506
|
-
rb_define_const(module, "PARSEC",
|
507
|
-
rb_float_new(GSL_CONST_CGSM_PARSEC));
|
508
|
-
rb_define_const(module, "GRAV_ACCEL",
|
509
|
-
rb_float_new(GSL_CONST_CGSM_GRAV_ACCEL));
|
510
|
-
rb_define_const(module, "ELECTRON_VOLT",
|
511
|
-
rb_float_new(GSL_CONST_CGSM_ELECTRON_VOLT));
|
512
|
-
rb_define_const(module, "MASS_ELECTRON",
|
513
|
-
rb_float_new(GSL_CONST_CGSM_MASS_ELECTRON));
|
514
|
-
rb_define_const(module, "MASS_MUON", rb_float_new(GSL_CONST_CGSM_MASS_MUON));
|
515
|
-
rb_define_const(module, "MASS_PROTON", rb_float_new(GSL_CONST_CGSM_MASS_PROTON));
|
516
|
-
rb_define_const(module, "MASS_NEUTRON", rb_float_new(GSL_CONST_CGSM_MASS_NEUTRON));
|
517
|
-
rb_define_const(module, "RYDBERG", rb_float_new(GSL_CONST_CGSM_RYDBERG));
|
518
|
-
|
519
|
-
rb_define_const(module, "BOHR_MAGNETON",
|
520
|
-
rb_float_new(GSL_CONST_CGSM_BOHR_MAGNETON));
|
521
|
-
|
522
|
-
rb_define_const(module, "NUCLEAR_MAGNETON",
|
523
|
-
rb_float_new(GSL_CONST_CGSM_NUCLEAR_MAGNETON));
|
524
|
-
rb_define_const(module, "ELECTRON_MAGNETIC_MOMENT",
|
525
|
-
rb_float_new(GSL_CONST_CGSM_ELECTRON_MAGNETIC_MOMENT));
|
526
|
-
rb_define_const(module, "PROTON_MAGNETIC_MOMENT",
|
527
|
-
rb_float_new(GSL_CONST_CGSM_PROTON_MAGNETIC_MOMENT));
|
528
|
-
rb_define_const(module, "STANDARD_GAS_VOLUME",
|
529
|
-
rb_float_new(GSL_CONST_CGSM_STANDARD_GAS_VOLUME));
|
530
|
-
|
531
|
-
rb_define_const(module, "MINUTE", rb_float_new(GSL_CONST_CGSM_MINUTE));
|
532
|
-
rb_define_const(module, "HOUR", rb_float_new(GSL_CONST_CGSM_HOUR));
|
533
|
-
rb_define_const(module, "DAY", rb_float_new(GSL_CONST_CGSM_DAY));
|
534
|
-
rb_define_const(module, "WEEK", rb_float_new(GSL_CONST_CGSM_WEEK));
|
535
|
-
rb_define_const(module, "INCH", rb_float_new(GSL_CONST_CGSM_INCH));
|
536
|
-
rb_define_const(module, "FOOT", rb_float_new(GSL_CONST_CGSM_FOOT));
|
537
|
-
rb_define_const(module, "YARD", rb_float_new(GSL_CONST_CGSM_YARD));
|
538
|
-
rb_define_const(module, "MILE", rb_float_new(GSL_CONST_CGSM_MILE));
|
539
|
-
rb_define_const(module, "NAUTICAL_MILE",
|
540
|
-
rb_float_new(GSL_CONST_CGSM_NAUTICAL_MILE));
|
541
|
-
rb_define_const(module, "FATHOM", rb_float_new(GSL_CONST_CGSM_FATHOM));
|
542
|
-
rb_define_const(module, "MIL", rb_float_new(GSL_CONST_CGSM_MIL));
|
543
|
-
rb_define_const(module, "POINT", rb_float_new(GSL_CONST_CGSM_POINT));
|
544
|
-
rb_define_const(module, "TEXPOINT", rb_float_new(GSL_CONST_CGSM_TEXPOINT));
|
545
|
-
rb_define_const(module, "MICRON", rb_float_new(GSL_CONST_CGSM_MICRON));
|
546
|
-
rb_define_const(module, "ANGSTROM", rb_float_new(GSL_CONST_CGSM_ANGSTROM));
|
547
|
-
rb_define_const(module, "HECTARE", rb_float_new(GSL_CONST_CGSM_HECTARE));
|
548
|
-
rb_define_const(module, "ACRE", rb_float_new(GSL_CONST_CGSM_ACRE));
|
549
|
-
rb_define_const(module, "BARN", rb_float_new(GSL_CONST_CGSM_BARN));
|
550
|
-
rb_define_const(module, "LITER", rb_float_new(GSL_CONST_CGSM_LITER));
|
551
|
-
rb_define_const(module, "US_GALLON", rb_float_new(GSL_CONST_CGSM_US_GALLON));
|
552
|
-
rb_define_const(module, "QUART", rb_float_new(GSL_CONST_CGSM_QUART));
|
553
|
-
rb_define_const(module, "PINT", rb_float_new(GSL_CONST_CGSM_PINT));
|
554
|
-
rb_define_const(module, "CUP", rb_float_new(GSL_CONST_CGSM_CUP));
|
555
|
-
rb_define_const(module, "FLUID_OUNCE", rb_float_new(GSL_CONST_CGSM_FLUID_OUNCE));
|
556
|
-
rb_define_const(module, "TABLESPOON", rb_float_new(GSL_CONST_CGSM_TABLESPOON));
|
557
|
-
rb_define_const(module, "CANADIAN_GALLON",
|
558
|
-
rb_float_new(GSL_CONST_CGSM_CANADIAN_GALLON));
|
559
|
-
|
560
|
-
rb_define_const(module, "UK_GALLON", rb_float_new(GSL_CONST_CGSM_UK_GALLON));
|
561
|
-
rb_define_const(module, "KILOMETERS_PER_HOUR",
|
562
|
-
rb_float_new(GSL_CONST_CGSM_MILES_PER_HOUR));
|
563
|
-
rb_define_const(module, "MILES_PER_HOUR",
|
564
|
-
rb_float_new(GSL_CONST_CGSM_KILOMETERS_PER_HOUR));
|
565
|
-
rb_define_const(module, "KNOT", rb_float_new(GSL_CONST_CGSM_KNOT));
|
566
|
-
rb_define_const(module, "POUND_MASS", rb_float_new(GSL_CONST_CGSM_POUND_MASS));
|
567
|
-
rb_define_const(module, "POUND_OUNCE", rb_float_new(GSL_CONST_CGSM_OUNCE_MASS));
|
568
|
-
rb_define_const(module, "POUND_TON", rb_float_new(GSL_CONST_CGSM_TON));
|
569
|
-
rb_define_const(module, "POUND_METRIC_TON",
|
570
|
-
rb_float_new(GSL_CONST_CGSM_METRIC_TON));
|
571
|
-
rb_define_const(module, "POUND_UK_TON", rb_float_new(GSL_CONST_CGSM_UK_TON));
|
572
|
-
rb_define_const(module, "POUND_TROY_OUNCE",
|
573
|
-
rb_float_new(GSL_CONST_CGSM_TROY_OUNCE));
|
574
|
-
rb_define_const(module, "CARAT", rb_float_new(GSL_CONST_CGSM_CARAT));
|
575
|
-
rb_define_const(module, "UNIFIED_ATOMIC_MASS",
|
576
|
-
rb_float_new(GSL_CONST_CGSM_UNIFIED_ATOMIC_MASS));
|
577
|
-
rb_define_const(module, "GRAM_FORCE", rb_float_new(GSL_CONST_CGSM_GRAM_FORCE));
|
578
|
-
rb_define_const(module, "POUND_FORCE", rb_float_new(GSL_CONST_CGSM_POUND_FORCE));
|
579
|
-
rb_define_const(module, "KILOPOUND_FORCE",
|
580
|
-
rb_float_new(GSL_CONST_CGSM_KILOPOUND_FORCE));
|
581
|
-
rb_define_const(module, "POUNDAL", rb_float_new(GSL_CONST_CGSM_POUNDAL));
|
582
|
-
rb_define_const(module, "CALORIE", rb_float_new(GSL_CONST_CGSM_CALORIE));
|
583
|
-
rb_define_const(module, "BTU", rb_float_new(GSL_CONST_CGSM_BTU));
|
584
|
-
rb_define_const(module, "THERM", rb_float_new(GSL_CONST_CGSM_THERM));
|
585
|
-
rb_define_const(module, "HORSEPOWER", rb_float_new(GSL_CONST_CGSM_HORSEPOWER));
|
586
|
-
rb_define_const(module, "BAR", rb_float_new(GSL_CONST_CGSM_BAR));
|
587
|
-
rb_define_const(module, "STD_ATMOSPHERE",
|
588
|
-
rb_float_new(GSL_CONST_CGSM_STD_ATMOSPHERE));
|
589
|
-
rb_define_const(module, "TORR", rb_float_new(GSL_CONST_CGSM_TORR));
|
590
|
-
rb_define_const(module, "METER_OF_MERCURY",
|
591
|
-
rb_float_new(GSL_CONST_CGSM_METER_OF_MERCURY));
|
592
|
-
rb_define_const(module, "INCH_OF_MERCURY",
|
593
|
-
rb_float_new(GSL_CONST_CGSM_INCH_OF_MERCURY));
|
594
|
-
rb_define_const(module, "INCH_OF_WATER",
|
595
|
-
rb_float_new(GSL_CONST_CGSM_INCH_OF_WATER));
|
596
|
-
rb_define_const(module, "PSI", rb_float_new(GSL_CONST_CGSM_PSI));
|
597
|
-
rb_define_const(module, "POISE", rb_float_new(GSL_CONST_CGSM_POISE));
|
598
|
-
rb_define_const(module, "STOKES", rb_float_new(GSL_CONST_CGSM_STOKES));
|
599
|
-
rb_define_const(module, "FARADAY", rb_float_new(GSL_CONST_CGSM_FARADAY));
|
600
|
-
rb_define_const(module, "ELECTRON_CHARGE",
|
601
|
-
rb_float_new(GSL_CONST_CGSM_ELECTRON_CHARGE));
|
602
|
-
rb_define_const(module, "ELECTRON_CHARGE_ESU",
|
603
|
-
rb_float_new(GSL_CONST_CGSM_ELECTRON_CHARGE*GSL_CONST_CGSM_SPEED_OF_LIGHT));
|
604
|
-
#ifndef GSL_1_13_LATER
|
605
|
-
rb_define_const(module, "GAUSS", rb_float_new(GSL_CONST_CGSM_GAUSS));
|
606
|
-
#endif
|
607
|
-
rb_define_const(module, "STILB", rb_float_new(GSL_CONST_CGSM_STILB));
|
608
|
-
rb_define_const(module, "LUMEN", rb_float_new(GSL_CONST_CGSM_LUMEN));
|
609
|
-
rb_define_const(module, "LUX", rb_float_new(GSL_CONST_CGSM_LUX));
|
610
|
-
rb_define_const(module, "PHOT", rb_float_new(GSL_CONST_CGSM_PHOT));
|
611
|
-
rb_define_const(module, "FOOTCANDLE", rb_float_new(GSL_CONST_CGSM_FOOTCANDLE));
|
612
|
-
rb_define_const(module, "LAMBERT", rb_float_new(GSL_CONST_CGSM_LAMBERT));
|
613
|
-
rb_define_const(module, "CURIE", rb_float_new(GSL_CONST_CGSM_CURIE));
|
614
|
-
rb_define_const(module, "ROENTGEN", rb_float_new(GSL_CONST_CGSM_ROENTGEN));
|
615
|
-
rb_define_const(module, "RAD", rb_float_new(GSL_CONST_CGSM_RAD));
|
616
|
-
rb_define_const(module, "SOLAR_MASS", rb_float_new(GSL_CONST_CGSM_SOLAR_MASS));
|
617
|
-
|
618
|
-
rb_define_const(module, "BOLTZMANN", rb_float_new(GSL_CONST_CGSM_BOLTZMANN));
|
619
|
-
rb_define_const(module, "MOLAR_GAS", rb_float_new(GSL_CONST_CGSM_MOLAR_GAS));
|
620
|
-
|
621
|
-
rb_define_const(module, "BOHR_RADIUS", rb_float_new(GSL_CONST_CGSM_BOHR_RADIUS));
|
622
|
-
rb_define_const(module, "NEWTON", rb_float_new(GSL_CONST_CGSM_NEWTON));
|
623
|
-
rb_define_const(module, "DYNE", rb_float_new(GSL_CONST_CGSM_DYNE));
|
624
|
-
rb_define_const(module, "JOULE", rb_float_new(GSL_CONST_CGSM_JOULE));
|
625
|
-
rb_define_const(module, "ERG", rb_float_new(GSL_CONST_CGSM_ERG));
|
626
|
-
|
627
|
-
#ifdef GSL_1_4_9_LATER
|
628
|
-
rb_define_const(module, "STEFAN_BOLTZMANN_CONSTANT",
|
629
|
-
rb_float_new(GSL_CONST_CGSM_STEFAN_BOLTZMANN_CONSTANT));
|
630
|
-
rb_define_const(module, "THOMSON_CROSS_SECTION",
|
631
|
-
rb_float_new(GSL_CONST_CGSM_THOMSON_CROSS_SECTION));
|
632
|
-
#endif
|
633
|
-
}
|
634
|
-
|
635
|
-
static void rb_gsl_const_num(VALUE module)
|
636
|
-
{
|
637
|
-
rb_define_const(module, "AVOGADRO", rb_float_new(GSL_CONST_NUM_AVOGADRO));
|
638
|
-
rb_define_const(module, "FINE_STRUCTURE",
|
639
|
-
rb_float_new(GSL_CONST_NUM_FINE_STRUCTURE));
|
640
|
-
rb_define_const(module, "YOTTA", rb_float_new(GSL_CONST_NUM_YOTTA));
|
641
|
-
rb_define_const(module, "ZETTA", rb_float_new(GSL_CONST_NUM_ZETTA));
|
642
|
-
rb_define_const(module, "EXA", rb_float_new(GSL_CONST_NUM_EXA));
|
643
|
-
rb_define_const(module, "PETA", rb_float_new(GSL_CONST_NUM_PETA));
|
644
|
-
rb_define_const(module, "TERA", rb_float_new(GSL_CONST_NUM_TERA));
|
645
|
-
rb_define_const(module, "GIGA", rb_float_new(GSL_CONST_NUM_GIGA));
|
646
|
-
rb_define_const(module, "MEGA", rb_float_new(GSL_CONST_NUM_MEGA));
|
647
|
-
rb_define_const(module, "KILO", rb_float_new(GSL_CONST_NUM_KILO));
|
648
|
-
rb_define_const(module, "MILLI", rb_float_new(GSL_CONST_NUM_MILLI));
|
649
|
-
rb_define_const(module, "MICRO", rb_float_new(GSL_CONST_NUM_MICRO));
|
650
|
-
rb_define_const(module, "NANO", rb_float_new(GSL_CONST_NUM_NANO));
|
651
|
-
rb_define_const(module, "PICO", rb_float_new(GSL_CONST_NUM_PICO));
|
652
|
-
rb_define_const(module, "FEMTO", rb_float_new(GSL_CONST_NUM_FEMTO));
|
653
|
-
rb_define_const(module, "ATTO", rb_float_new(GSL_CONST_NUM_ATTO));
|
654
|
-
rb_define_const(module, "ZEPTO", rb_float_new(GSL_CONST_NUM_ZEPTO));
|
655
|
-
rb_define_const(module, "YOCTO", rb_float_new(GSL_CONST_NUM_YOCTO));
|
656
|
-
}
|
657
|
-
|
658
|
-
void Init_gsl_const(VALUE module)
|
659
|
-
{
|
660
|
-
VALUE mgsl_const;
|
661
|
-
VALUE mgsl_const_mks, mgsl_const_cgs, mgsl_const_num;
|
662
|
-
|
663
|
-
mgsl_const = rb_define_module_under(module, "CONST");
|
664
|
-
mgsl_const_mks = rb_define_module_under(mgsl_const, "MKSA");
|
665
|
-
rb_gsl_const_mks(mgsl_const_mks);
|
666
|
-
mgsl_const_cgs = rb_define_module_under(mgsl_const, "CGSM");
|
667
|
-
rb_gsl_const_cgs(mgsl_const_cgs);
|
668
|
-
mgsl_const_num = rb_define_module_under(mgsl_const, "NUM");
|
669
|
-
rb_gsl_const_num(mgsl_const_num);
|
670
|
-
Init_gsl_const_additional(mgsl_const_mks, mgsl_const_cgs, mgsl_const_num);
|
671
|
-
}
|
672
|
-
#endif
|