gsl 1.12.108
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +29 -0
- data/Rakefile +54 -0
- data/VERSION +2 -0
- data/ext/MANIFEST +119 -0
- data/ext/alf.c +206 -0
- data/ext/array.c +666 -0
- data/ext/array_complex.c +247 -0
- data/ext/blas.c +29 -0
- data/ext/blas1.c +731 -0
- data/ext/blas2.c +1093 -0
- data/ext/blas3.c +881 -0
- data/ext/block.c +44 -0
- data/ext/block_source.c +886 -0
- data/ext/bspline.c +130 -0
- data/ext/bundle.c +3 -0
- data/ext/cdf.c +754 -0
- data/ext/cheb.c +542 -0
- data/ext/combination.c +283 -0
- data/ext/common.c +325 -0
- data/ext/complex.c +1004 -0
- data/ext/const.c +673 -0
- data/ext/const_additional.c +120 -0
- data/ext/cqp.c +283 -0
- data/ext/deriv.c +195 -0
- data/ext/dht.c +361 -0
- data/ext/diff.c +166 -0
- data/ext/dirac.c +395 -0
- data/ext/eigen.c +2373 -0
- data/ext/error.c +194 -0
- data/ext/extconf.rb +281 -0
- data/ext/fcmp.c +66 -0
- data/ext/fft.c +1092 -0
- data/ext/fit.c +205 -0
- data/ext/fresnel.c +312 -0
- data/ext/function.c +524 -0
- data/ext/geometry.c +139 -0
- data/ext/graph.c +1638 -0
- data/ext/gsl.c +271 -0
- data/ext/gsl_narray.c +653 -0
- data/ext/histogram.c +1995 -0
- data/ext/histogram2d.c +1068 -0
- data/ext/histogram3d.c +884 -0
- data/ext/histogram3d_source.c +750 -0
- data/ext/histogram_find.c +101 -0
- data/ext/histogram_oper.c +159 -0
- data/ext/ieee.c +98 -0
- data/ext/integration.c +1138 -0
- data/ext/interp.c +512 -0
- data/ext/jacobi.c +739 -0
- data/ext/linalg.c +4047 -0
- data/ext/linalg_complex.c +741 -0
- data/ext/math.c +725 -0
- data/ext/matrix.c +39 -0
- data/ext/matrix_complex.c +1732 -0
- data/ext/matrix_double.c +560 -0
- data/ext/matrix_int.c +256 -0
- data/ext/matrix_source.c +2733 -0
- data/ext/min.c +250 -0
- data/ext/monte.c +992 -0
- data/ext/multifit.c +1879 -0
- data/ext/multimin.c +808 -0
- data/ext/multimin_fsdf.c +156 -0
- data/ext/multiroots.c +955 -0
- data/ext/ndlinear.c +321 -0
- data/ext/nmf.c +167 -0
- data/ext/nmf_wrap.c +72 -0
- data/ext/ntuple.c +469 -0
- data/ext/odeiv.c +959 -0
- data/ext/ool.c +879 -0
- data/ext/oper_complex_source.c +253 -0
- data/ext/permutation.c +596 -0
- data/ext/poly.c +42 -0
- data/ext/poly2.c +265 -0
- data/ext/poly_source.c +1885 -0
- data/ext/qrng.c +171 -0
- data/ext/randist.c +1873 -0
- data/ext/rational.c +480 -0
- data/ext/rng.c +612 -0
- data/ext/root.c +408 -0
- data/ext/sf.c +1494 -0
- data/ext/sf_airy.c +200 -0
- data/ext/sf_bessel.c +867 -0
- data/ext/sf_clausen.c +28 -0
- data/ext/sf_coulomb.c +206 -0
- data/ext/sf_coupling.c +118 -0
- data/ext/sf_dawson.c +29 -0
- data/ext/sf_debye.c +157 -0
- data/ext/sf_dilog.c +42 -0
- data/ext/sf_elementary.c +44 -0
- data/ext/sf_ellint.c +206 -0
- data/ext/sf_elljac.c +29 -0
- data/ext/sf_erfc.c +93 -0
- data/ext/sf_exp.c +164 -0
- data/ext/sf_expint.c +211 -0
- data/ext/sf_fermi_dirac.c +148 -0
- data/ext/sf_gamma.c +344 -0
- data/ext/sf_gegenbauer.c +96 -0
- data/ext/sf_hyperg.c +197 -0
- data/ext/sf_laguerre.c +112 -0
- data/ext/sf_lambert.c +47 -0
- data/ext/sf_legendre.c +367 -0
- data/ext/sf_log.c +104 -0
- data/ext/sf_mathieu.c +238 -0
- data/ext/sf_power.c +46 -0
- data/ext/sf_psi.c +98 -0
- data/ext/sf_synchrotron.c +48 -0
- data/ext/sf_transport.c +76 -0
- data/ext/sf_trigonometric.c +207 -0
- data/ext/sf_zeta.c +119 -0
- data/ext/signal.c +310 -0
- data/ext/siman.c +718 -0
- data/ext/sort.c +208 -0
- data/ext/spline.c +395 -0
- data/ext/stats.c +799 -0
- data/ext/sum.c +168 -0
- data/ext/tamu_anova.c +56 -0
- data/ext/tensor.c +38 -0
- data/ext/tensor_source.c +1123 -0
- data/ext/vector.c +38 -0
- data/ext/vector_complex.c +2236 -0
- data/ext/vector_double.c +1433 -0
- data/ext/vector_int.c +204 -0
- data/ext/vector_source.c +3329 -0
- data/ext/wavelet.c +937 -0
- data/include/rb_gsl.h +151 -0
- data/include/rb_gsl_array.h +238 -0
- data/include/rb_gsl_cheb.h +21 -0
- data/include/rb_gsl_common.h +343 -0
- data/include/rb_gsl_complex.h +25 -0
- data/include/rb_gsl_const.h +29 -0
- data/include/rb_gsl_dirac.h +13 -0
- data/include/rb_gsl_eigen.h +17 -0
- data/include/rb_gsl_fft.h +62 -0
- data/include/rb_gsl_fit.h +25 -0
- data/include/rb_gsl_function.h +27 -0
- data/include/rb_gsl_graph.h +70 -0
- data/include/rb_gsl_histogram.h +63 -0
- data/include/rb_gsl_histogram3d.h +97 -0
- data/include/rb_gsl_integration.h +17 -0
- data/include/rb_gsl_interp.h +46 -0
- data/include/rb_gsl_linalg.h +25 -0
- data/include/rb_gsl_math.h +26 -0
- data/include/rb_gsl_odeiv.h +21 -0
- data/include/rb_gsl_poly.h +71 -0
- data/include/rb_gsl_rational.h +37 -0
- data/include/rb_gsl_rng.h +21 -0
- data/include/rb_gsl_root.h +22 -0
- data/include/rb_gsl_sf.h +119 -0
- data/include/rb_gsl_statistics.h +17 -0
- data/include/rb_gsl_tensor.h +45 -0
- data/include/rb_gsl_with_narray.h +22 -0
- data/include/templates_off.h +87 -0
- data/include/templates_on.h +241 -0
- data/lib/gsl/gnuplot.rb +41 -0
- data/lib/gsl/oper.rb +68 -0
- data/lib/ool.rb +22 -0
- data/lib/ool/conmin.rb +30 -0
- metadata +224 -0
data/ext/sf_clausen.c
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
/*
|
2
|
+
sf_clausen.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 "rb_gsl_sf.h"
|
13
|
+
|
14
|
+
static VALUE rb_gsl_sf_clausen(VALUE obj, VALUE x)
|
15
|
+
{
|
16
|
+
return rb_gsl_sf_eval1(gsl_sf_clausen, x);
|
17
|
+
}
|
18
|
+
|
19
|
+
static VALUE rb_gsl_sf_clausen_e(VALUE obj, VALUE x)
|
20
|
+
{
|
21
|
+
return rb_gsl_sf_eval_e(gsl_sf_clausen_e, x);
|
22
|
+
}
|
23
|
+
|
24
|
+
void Init_gsl_sf_clausen(VALUE module)
|
25
|
+
{
|
26
|
+
rb_define_module_function(module, "clausen", rb_gsl_sf_clausen, 1);
|
27
|
+
rb_define_module_function(module, "clausen_e", rb_gsl_sf_clausen_e, 1);
|
28
|
+
}
|
data/ext/sf_coulomb.c
ADDED
@@ -0,0 +1,206 @@
|
|
1
|
+
/*
|
2
|
+
sf_coulomb.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; without even the implied warranty of
|
10
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
11
|
+
*/
|
12
|
+
|
13
|
+
#include "rb_gsl_sf.h"
|
14
|
+
EXTERN VALUE cgsl_vector;
|
15
|
+
|
16
|
+
static VALUE rb_gsl_sf_hydrogenicR_1(VALUE obj, VALUE Z, VALUE r)
|
17
|
+
{
|
18
|
+
return rb_gsl_sf_eval_double_double(gsl_sf_hydrogenicR_1, Z, r);
|
19
|
+
}
|
20
|
+
|
21
|
+
static VALUE rb_gsl_sf_hydrogenicR_1_e(VALUE obj, VALUE Z, VALUE r)
|
22
|
+
{
|
23
|
+
return rb_gsl_sf_eval_e_double2(gsl_sf_hydrogenicR_1_e, Z, r);
|
24
|
+
}
|
25
|
+
|
26
|
+
static VALUE rb_gsl_sf_hydrogenicR(VALUE obj, VALUE n, VALUE l,
|
27
|
+
VALUE Z, VALUE r)
|
28
|
+
{
|
29
|
+
return rb_float_new(gsl_sf_hydrogenicR(FIX2INT(n), FIX2INT(l),
|
30
|
+
NUM2DBL(Z), NUM2DBL(r)));
|
31
|
+
}
|
32
|
+
|
33
|
+
static VALUE rb_gsl_sf_hydrogenicR_e(VALUE obj, VALUE n, VALUE l,
|
34
|
+
VALUE Z, VALUE r)
|
35
|
+
{
|
36
|
+
gsl_sf_result *rslt = NULL;
|
37
|
+
VALUE v;
|
38
|
+
int status;
|
39
|
+
CHECK_FIXNUM(n); CHECK_FIXNUM(l);
|
40
|
+
Need_Float(Z); Need_Float(r);
|
41
|
+
v = Data_Make_Struct(cgsl_sf_result, gsl_sf_result, 0, free, rslt);
|
42
|
+
status = gsl_sf_hydrogenicR_e(FIX2INT(n), FIX2INT(l),
|
43
|
+
NUM2DBL(Z), NUM2DBL(r), rslt);
|
44
|
+
return v;
|
45
|
+
}
|
46
|
+
|
47
|
+
static VALUE rb_gsl_sf_coulomb_wave_FG_e(VALUE obj, VALUE eta, VALUE x,
|
48
|
+
VALUE L_F, VALUE k)
|
49
|
+
|
50
|
+
{
|
51
|
+
gsl_sf_result *F, *Fp, *G, *Gp;
|
52
|
+
VALUE vF, vFp, vG, vGp;
|
53
|
+
double exp_G, exp_F;
|
54
|
+
int status;
|
55
|
+
Need_Float(eta); Need_Float(x); Need_Float(L_F);
|
56
|
+
CHECK_FIXNUM(k);
|
57
|
+
vF = Data_Make_Struct(cgsl_sf_result, gsl_sf_result, 0, free, F);
|
58
|
+
vFp = Data_Make_Struct(cgsl_sf_result, gsl_sf_result, 0, free, Fp);
|
59
|
+
vG = Data_Make_Struct(cgsl_sf_result, gsl_sf_result, 0, free, G);
|
60
|
+
vGp = Data_Make_Struct(cgsl_sf_result, gsl_sf_result, 0, free, Gp);
|
61
|
+
status = gsl_sf_coulomb_wave_FG_e(NUM2DBL(eta), NUM2DBL(x), NUM2DBL(L_F),
|
62
|
+
FIX2INT(k), F, Fp, G, Gp, &exp_F, &exp_G);
|
63
|
+
return rb_ary_new3(7, vF, vFp, vG, vGp,
|
64
|
+
rb_float_new(exp_F), rb_float_new(exp_G), INT2FIX(status));
|
65
|
+
}
|
66
|
+
|
67
|
+
static VALUE rb_gsl_sf_coulomb_wave_F_array(VALUE obj, VALUE Lmin, VALUE kmax,
|
68
|
+
VALUE eta, VALUE x)
|
69
|
+
{
|
70
|
+
double F_exponent;
|
71
|
+
int status;
|
72
|
+
size_t size;
|
73
|
+
gsl_vector *v = NULL;
|
74
|
+
CHECK_FIXNUM(kmax);
|
75
|
+
Need_Float(Lmin); Need_Float(eta); Need_Float(x);
|
76
|
+
size = FIX2INT(kmax);
|
77
|
+
v = gsl_vector_alloc(size);
|
78
|
+
status = gsl_sf_coulomb_wave_F_array(NUM2DBL(Lmin), size, NUM2DBL(eta),
|
79
|
+
NUM2DBL(x), v->data, &F_exponent);
|
80
|
+
|
81
|
+
return rb_ary_new3(3, Data_Wrap_Struct(cgsl_vector, 0, gsl_vector_free, v),
|
82
|
+
rb_float_new(F_exponent), INT2FIX(status));
|
83
|
+
}
|
84
|
+
|
85
|
+
static VALUE rb_gsl_sf_coulomb_wave_FG_array(VALUE obj, VALUE Lmin, VALUE kmax,
|
86
|
+
VALUE eta, VALUE x)
|
87
|
+
{
|
88
|
+
double F_exponent, G_exponent;
|
89
|
+
int status;
|
90
|
+
size_t size, stride;
|
91
|
+
gsl_vector *vf = NULL, *vg = NULL;
|
92
|
+
VALUE fary, gary;
|
93
|
+
CHECK_FIXNUM(kmax);
|
94
|
+
Need_Float(Lmin); Need_Float(eta); Need_Float(x);
|
95
|
+
size = FIX2INT(kmax);
|
96
|
+
vf = gsl_vector_alloc(size);
|
97
|
+
vg = gsl_vector_alloc(size);
|
98
|
+
stride = vf->stride;
|
99
|
+
|
100
|
+
status = gsl_sf_coulomb_wave_FG_array(NUM2DBL(Lmin), size, NUM2DBL(eta),
|
101
|
+
NUM2DBL(x), vf->data, vg->data,
|
102
|
+
&F_exponent, &G_exponent);
|
103
|
+
fary = Data_Wrap_Struct(cgsl_vector, 0, gsl_vector_free, vf);
|
104
|
+
gary = Data_Wrap_Struct(cgsl_vector, 0, gsl_vector_free, vf);
|
105
|
+
return rb_ary_new3(5, fary, gary,
|
106
|
+
rb_float_new(F_exponent), rb_float_new(G_exponent),
|
107
|
+
INT2FIX(status));
|
108
|
+
}
|
109
|
+
|
110
|
+
static VALUE rb_gsl_sf_coulomb_wave_FGp_array(VALUE obj, VALUE Lmin, VALUE kmax,
|
111
|
+
VALUE eta, VALUE x)
|
112
|
+
{
|
113
|
+
double F_exponent, G_exponent;
|
114
|
+
int status;
|
115
|
+
size_t size, stride;
|
116
|
+
gsl_vector *vf = NULL, *vg = NULL, *vfp = NULL, *vgp = NULL;
|
117
|
+
VALUE fary, gary, fpary, gpary;
|
118
|
+
CHECK_FIXNUM(kmax);
|
119
|
+
Need_Float(Lmin); Need_Float(eta); Need_Float(x);
|
120
|
+
size = FIX2INT(kmax);
|
121
|
+
vf = gsl_vector_alloc(size);
|
122
|
+
vfp = gsl_vector_alloc(size);
|
123
|
+
vg = gsl_vector_alloc(size);
|
124
|
+
vgp = gsl_vector_alloc(size);
|
125
|
+
stride = vf->stride;
|
126
|
+
|
127
|
+
status = gsl_sf_coulomb_wave_FGp_array(NUM2DBL(Lmin), size, NUM2DBL(eta),
|
128
|
+
NUM2DBL(x), vf->data, vfp->data,
|
129
|
+
vg->data, vgp->data,
|
130
|
+
&F_exponent, &G_exponent);
|
131
|
+
fary = Data_Wrap_Struct(cgsl_vector, 0, gsl_vector_free, vf);
|
132
|
+
fpary =Data_Wrap_Struct(cgsl_vector, 0, gsl_vector_free, vfp);
|
133
|
+
gary = Data_Wrap_Struct(cgsl_vector, 0, gsl_vector_free, vg);
|
134
|
+
gpary =Data_Wrap_Struct(cgsl_vector, 0, gsl_vector_free, vgp);
|
135
|
+
return rb_ary_new3(7, fary, fpary, gary, gpary,
|
136
|
+
rb_float_new(F_exponent), rb_float_new(G_exponent),
|
137
|
+
INT2FIX(status));
|
138
|
+
}
|
139
|
+
|
140
|
+
static VALUE rb_gsl_sf_coulomb_wave_sphF_array(VALUE obj, VALUE Lmin, VALUE kmax,
|
141
|
+
VALUE eta, VALUE x)
|
142
|
+
{
|
143
|
+
int status;
|
144
|
+
size_t size;
|
145
|
+
gsl_vector *v = NULL, *v2 = NULL;
|
146
|
+
CHECK_FIXNUM(kmax);
|
147
|
+
Need_Float(Lmin); Need_Float(eta); Need_Float(x);
|
148
|
+
size = FIX2INT(kmax);
|
149
|
+
v = gsl_vector_alloc(size);
|
150
|
+
v2 = gsl_vector_alloc(size);
|
151
|
+
status = gsl_sf_coulomb_wave_sphF_array(NUM2DBL(Lmin), size, NUM2DBL(eta),
|
152
|
+
NUM2DBL(x), v->data, v2->data);
|
153
|
+
return rb_ary_new3(3, Data_Wrap_Struct(cgsl_vector, 0, gsl_vector_free, v),
|
154
|
+
Data_Wrap_Struct(cgsl_vector, 0, gsl_vector_free, v2),
|
155
|
+
INT2FIX(status));
|
156
|
+
}
|
157
|
+
|
158
|
+
static VALUE rb_gsl_sf_coulomb_CL_e(VALUE obj, VALUE L, VALUE eta)
|
159
|
+
{
|
160
|
+
return rb_gsl_sf_eval_e_double2(gsl_sf_coulomb_CL_e, L, eta);
|
161
|
+
}
|
162
|
+
|
163
|
+
static VALUE rb_gsl_sf_coulomb_CL_array(VALUE obj, VALUE Lmin, VALUE kmax,
|
164
|
+
VALUE eta)
|
165
|
+
{
|
166
|
+
gsl_vector *v = NULL;
|
167
|
+
size_t size;
|
168
|
+
int status;
|
169
|
+
CHECK_FIXNUM(kmax);
|
170
|
+
Need_Float(Lmin); Need_Float(eta);
|
171
|
+
size = FIX2INT(kmax);
|
172
|
+
v = gsl_vector_alloc(size);
|
173
|
+
status = gsl_sf_coulomb_CL_array(NUM2DBL(Lmin), size, NUM2DBL(eta), v->data);
|
174
|
+
return Data_Wrap_Struct(cgsl_vector, 0, gsl_vector_free, v);
|
175
|
+
}
|
176
|
+
|
177
|
+
void Init_gsl_sf_coulomb(VALUE module)
|
178
|
+
{
|
179
|
+
VALUE mgsl_sf_coulomb;
|
180
|
+
|
181
|
+
rb_define_module_function(module, "hydrogenicR_1", rb_gsl_sf_hydrogenicR_1, 2);
|
182
|
+
rb_define_module_function(module, "hydrogenicR_1_e", rb_gsl_sf_hydrogenicR_1_e, 2);
|
183
|
+
rb_define_module_function(module, "hydrogenicR", rb_gsl_sf_hydrogenicR, 4);
|
184
|
+
rb_define_module_function(module, "hydrogenicR_e", rb_gsl_sf_hydrogenicR_e, 4);
|
185
|
+
rb_define_module_function(module, "coulomb_wave_FG_e", rb_gsl_sf_coulomb_wave_FG_e, 4);
|
186
|
+
rb_define_module_function(module, "coulomb_wave_F_array", rb_gsl_sf_coulomb_wave_F_array, 4);
|
187
|
+
rb_define_module_function(module, "coulomb_wave_FG_array", rb_gsl_sf_coulomb_wave_FG_array, 4);
|
188
|
+
rb_define_module_function(module, "coulomb_wave_FGp_array", rb_gsl_sf_coulomb_wave_FGp_array, 4);
|
189
|
+
rb_define_module_function(module, "coulomb_wave_sphF_array ", rb_gsl_sf_coulomb_wave_sphF_array, 4);
|
190
|
+
rb_define_module_function(module, "coulomb_CL_e", rb_gsl_sf_coulomb_CL_e, 2);
|
191
|
+
rb_define_module_function(module, "coulomb_CL_array", rb_gsl_sf_coulomb_CL_array, 3);
|
192
|
+
|
193
|
+
mgsl_sf_coulomb = rb_define_module_under(module, "Coulomb");
|
194
|
+
|
195
|
+
rb_define_module_function(mgsl_sf_coulomb, "hydrogenicR_1", rb_gsl_sf_hydrogenicR_1, 2);
|
196
|
+
rb_define_module_function(mgsl_sf_coulomb, "hydrogenicR_1_e", rb_gsl_sf_hydrogenicR_1_e, 2);
|
197
|
+
rb_define_module_function(mgsl_sf_coulomb, "hydrogenicR", rb_gsl_sf_hydrogenicR, 4);
|
198
|
+
rb_define_module_function(mgsl_sf_coulomb, "hydrogenicR_e", rb_gsl_sf_hydrogenicR_e, 4);
|
199
|
+
rb_define_module_function(mgsl_sf_coulomb, "wave_FG_e", rb_gsl_sf_coulomb_wave_FG_e, 4);
|
200
|
+
rb_define_module_function(mgsl_sf_coulomb, "wave_F_array", rb_gsl_sf_coulomb_wave_F_array, 4);
|
201
|
+
rb_define_module_function(mgsl_sf_coulomb, "wave_FG_array", rb_gsl_sf_coulomb_wave_FG_array, 4);
|
202
|
+
rb_define_module_function(mgsl_sf_coulomb, "wave_FGp_array", rb_gsl_sf_coulomb_wave_FGp_array, 4);
|
203
|
+
rb_define_module_function(mgsl_sf_coulomb, "wave_sphF_array ", rb_gsl_sf_coulomb_wave_sphF_array, 4);
|
204
|
+
rb_define_module_function(mgsl_sf_coulomb, "CL_e", rb_gsl_sf_coulomb_CL_e, 2);
|
205
|
+
rb_define_module_function(mgsl_sf_coulomb, "CL_array", rb_gsl_sf_coulomb_CL_array, 3);
|
206
|
+
}
|
data/ext/sf_coupling.c
ADDED
@@ -0,0 +1,118 @@
|
|
1
|
+
/*
|
2
|
+
sf_coupling.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; without even the implied warranty of
|
10
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
11
|
+
*/
|
12
|
+
|
13
|
+
#include "rb_gsl_sf.h"
|
14
|
+
|
15
|
+
static VALUE rb_gsl_sf_coupling_3j(VALUE obj, VALUE two_ja, VALUE two_jb, VALUE two_jc, VALUE two_ma, VALUE two_mb, VALUE two_mc)
|
16
|
+
{
|
17
|
+
CHECK_FIXNUM(two_ja); CHECK_FIXNUM(two_jb); CHECK_FIXNUM(two_jc);
|
18
|
+
CHECK_FIXNUM(two_ma); CHECK_FIXNUM(two_mb); CHECK_FIXNUM(two_mc);
|
19
|
+
return rb_float_new(gsl_sf_coupling_3j(FIX2INT(two_ja), FIX2INT(two_jb),
|
20
|
+
FIX2INT(two_jc), FIX2INT(two_ma),
|
21
|
+
FIX2INT(two_mb), FIX2INT(two_mc)));
|
22
|
+
}
|
23
|
+
|
24
|
+
static VALUE rb_gsl_sf_coupling_3j_e(VALUE obj, VALUE two_ja, VALUE two_jb, VALUE two_jc, VALUE two_ma, VALUE two_mb, VALUE two_mc)
|
25
|
+
{
|
26
|
+
gsl_sf_result *rslt = NULL;
|
27
|
+
VALUE v;
|
28
|
+
int status;
|
29
|
+
CHECK_FIXNUM(two_ja); CHECK_FIXNUM(two_jb); CHECK_FIXNUM(two_jc);
|
30
|
+
CHECK_FIXNUM(two_ma); CHECK_FIXNUM(two_mb); CHECK_FIXNUM(two_mc);
|
31
|
+
v = Data_Make_Struct(cgsl_sf_result, gsl_sf_result, 0, free, rslt);
|
32
|
+
status = gsl_sf_coupling_3j_e(FIX2INT(two_ja), FIX2INT(two_jb),
|
33
|
+
FIX2INT(two_jc), FIX2INT(two_ma),
|
34
|
+
FIX2INT(two_mb), FIX2INT(two_mc),
|
35
|
+
rslt);
|
36
|
+
|
37
|
+
return v;
|
38
|
+
}
|
39
|
+
|
40
|
+
static VALUE rb_gsl_sf_coupling_6j(VALUE obj, VALUE two_ja, VALUE two_jb, VALUE two_jc, VALUE two_jd, VALUE two_je, VALUE two_jf)
|
41
|
+
{
|
42
|
+
CHECK_FIXNUM(two_ja); CHECK_FIXNUM(two_jb); CHECK_FIXNUM(two_jc);
|
43
|
+
CHECK_FIXNUM(two_jd); CHECK_FIXNUM(two_je); CHECK_FIXNUM(two_jf);
|
44
|
+
return rb_float_new(gsl_sf_coupling_6j(FIX2INT(two_ja), FIX2INT(two_jb),
|
45
|
+
FIX2INT(two_jc), FIX2INT(two_jd),
|
46
|
+
FIX2INT(two_je), FIX2INT(two_jf)));
|
47
|
+
}
|
48
|
+
|
49
|
+
static VALUE rb_gsl_sf_coupling_6j_e(VALUE obj, VALUE two_ja, VALUE two_jb, VALUE two_jc, VALUE two_jd, VALUE two_je, VALUE two_jf)
|
50
|
+
{
|
51
|
+
gsl_sf_result *rslt = NULL;
|
52
|
+
VALUE v;
|
53
|
+
int status;
|
54
|
+
CHECK_FIXNUM(two_ja); CHECK_FIXNUM(two_jb); CHECK_FIXNUM(two_jc);
|
55
|
+
CHECK_FIXNUM(two_jd); CHECK_FIXNUM(two_je); CHECK_FIXNUM(two_jf);
|
56
|
+
v = Data_Make_Struct(cgsl_sf_result, gsl_sf_result, 0, free, rslt);
|
57
|
+
status = gsl_sf_coupling_6j_e(FIX2INT(two_ja), FIX2INT(two_jb),
|
58
|
+
FIX2INT(two_jc), FIX2INT(two_jd),
|
59
|
+
FIX2INT(two_je), FIX2INT(two_jf),
|
60
|
+
rslt);
|
61
|
+
return v;
|
62
|
+
}
|
63
|
+
|
64
|
+
static VALUE rb_gsl_sf_coupling_9j(VALUE obj, VALUE two_ja, VALUE two_jb,
|
65
|
+
VALUE two_jc, VALUE two_jd, VALUE two_je,
|
66
|
+
VALUE two_jf, VALUE two_jg, VALUE two_jh,
|
67
|
+
VALUE two_ji)
|
68
|
+
{
|
69
|
+
CHECK_FIXNUM(two_ja); CHECK_FIXNUM(two_jb); CHECK_FIXNUM(two_jc);
|
70
|
+
CHECK_FIXNUM(two_jd); CHECK_FIXNUM(two_je); CHECK_FIXNUM(two_jf);
|
71
|
+
CHECK_FIXNUM(two_jg); CHECK_FIXNUM(two_jh); CHECK_FIXNUM(two_ji);
|
72
|
+
return rb_float_new(gsl_sf_coupling_9j(FIX2INT(two_ja), FIX2INT(two_jb),
|
73
|
+
FIX2INT(two_jc), FIX2INT(two_jd),
|
74
|
+
FIX2INT(two_je), FIX2INT(two_jf),
|
75
|
+
FIX2INT(two_jg), FIX2INT(two_jh),
|
76
|
+
FIX2INT(two_ji)));
|
77
|
+
}
|
78
|
+
|
79
|
+
static VALUE rb_gsl_sf_coupling_9j_e(VALUE obj, VALUE two_ja, VALUE two_jb,
|
80
|
+
VALUE two_jc, VALUE two_jd, VALUE two_je,
|
81
|
+
VALUE two_jf, VALUE two_jg, VALUE two_jh,
|
82
|
+
VALUE two_ji)
|
83
|
+
{
|
84
|
+
gsl_sf_result *rslt = NULL;
|
85
|
+
VALUE v;
|
86
|
+
int status;
|
87
|
+
CHECK_FIXNUM(two_ja); CHECK_FIXNUM(two_jb); CHECK_FIXNUM(two_jc);
|
88
|
+
CHECK_FIXNUM(two_jd); CHECK_FIXNUM(two_je); CHECK_FIXNUM(two_jf);
|
89
|
+
CHECK_FIXNUM(two_jg); CHECK_FIXNUM(two_jh); CHECK_FIXNUM(two_ji);
|
90
|
+
v = Data_Make_Struct(cgsl_sf_result, gsl_sf_result, 0, free, rslt);
|
91
|
+
status = gsl_sf_coupling_9j_e(FIX2INT(two_ja), FIX2INT(two_jb),
|
92
|
+
FIX2INT(two_jc), FIX2INT(two_jd),
|
93
|
+
FIX2INT(two_je), FIX2INT(two_jf),
|
94
|
+
FIX2INT(two_jg), FIX2INT(two_jh),
|
95
|
+
FIX2INT(two_ji), rslt);
|
96
|
+
return v;
|
97
|
+
}
|
98
|
+
|
99
|
+
void Init_gsl_sf_coupling(VALUE module)
|
100
|
+
{
|
101
|
+
VALUE mgsl_sf_coupling;
|
102
|
+
|
103
|
+
rb_define_module_function(module, "coupling_3j", rb_gsl_sf_coupling_3j, 6);
|
104
|
+
rb_define_module_function(module, "coupling_3j_e", rb_gsl_sf_coupling_3j_e, 6);
|
105
|
+
rb_define_module_function(module, "coupling_6j", rb_gsl_sf_coupling_6j, 6);
|
106
|
+
rb_define_module_function(module, "coupling_6j_e", rb_gsl_sf_coupling_6j_e, 6);
|
107
|
+
rb_define_module_function(module, "coupling_9j", rb_gsl_sf_coupling_9j, 9);
|
108
|
+
rb_define_module_function(module, "coupling_9j_e", rb_gsl_sf_coupling_9j_e, 9);
|
109
|
+
|
110
|
+
mgsl_sf_coupling = rb_define_module_under(module, "Coupling");
|
111
|
+
|
112
|
+
rb_define_module_function(mgsl_sf_coupling, "3j", rb_gsl_sf_coupling_3j, 6);
|
113
|
+
rb_define_module_function(mgsl_sf_coupling, "3j_e", rb_gsl_sf_coupling_3j_e, 6);
|
114
|
+
rb_define_module_function(mgsl_sf_coupling, "6j", rb_gsl_sf_coupling_6j, 6);
|
115
|
+
rb_define_module_function(mgsl_sf_coupling, "6j_e", rb_gsl_sf_coupling_6j_e, 6);
|
116
|
+
rb_define_module_function(mgsl_sf_coupling, "9j", rb_gsl_sf_coupling_9j, 9);
|
117
|
+
rb_define_module_function(mgsl_sf_coupling, "9j_e", rb_gsl_sf_coupling_9j_e, 9);
|
118
|
+
}
|
data/ext/sf_dawson.c
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
/*
|
2
|
+
sf_dawson.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; without even the implied warranty of
|
10
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
11
|
+
*/
|
12
|
+
|
13
|
+
#include "rb_gsl_sf.h"
|
14
|
+
|
15
|
+
static VALUE rb_gsl_sf_dawson(VALUE obj, VALUE x)
|
16
|
+
{
|
17
|
+
return rb_gsl_sf_eval1(gsl_sf_dawson, x);
|
18
|
+
}
|
19
|
+
|
20
|
+
static VALUE rb_gsl_sf_dawson_e(VALUE obj, VALUE x)
|
21
|
+
{
|
22
|
+
return rb_gsl_sf_eval_e(gsl_sf_dawson_e, x);
|
23
|
+
}
|
24
|
+
|
25
|
+
void Init_gsl_sf_dawson(VALUE module)
|
26
|
+
{
|
27
|
+
rb_define_module_function(module, "dawson", rb_gsl_sf_dawson, 1);
|
28
|
+
rb_define_module_function(module, "dawson_e", rb_gsl_sf_dawson_e, 1);
|
29
|
+
}
|
data/ext/sf_debye.c
ADDED
@@ -0,0 +1,157 @@
|
|
1
|
+
/*
|
2
|
+
sf_debye.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; without even the implied warranty of
|
10
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
11
|
+
*/
|
12
|
+
|
13
|
+
#include "rb_gsl_sf.h"
|
14
|
+
|
15
|
+
static VALUE rb_gsl_sf_debye_1(VALUE obj, VALUE x)
|
16
|
+
{
|
17
|
+
return rb_gsl_sf_eval1(gsl_sf_debye_1, x);
|
18
|
+
}
|
19
|
+
|
20
|
+
static VALUE rb_gsl_sf_debye_1_e(VALUE obj, VALUE x)
|
21
|
+
{
|
22
|
+
return rb_gsl_sf_eval_e(gsl_sf_debye_1_e, x);
|
23
|
+
}
|
24
|
+
|
25
|
+
static VALUE rb_gsl_sf_debye_2(VALUE obj, VALUE x)
|
26
|
+
{
|
27
|
+
return rb_gsl_sf_eval1(gsl_sf_debye_2, x);
|
28
|
+
}
|
29
|
+
|
30
|
+
static VALUE rb_gsl_sf_debye_2_e(VALUE obj, VALUE x)
|
31
|
+
{
|
32
|
+
return rb_gsl_sf_eval_e(gsl_sf_debye_2_e, x);
|
33
|
+
}
|
34
|
+
|
35
|
+
static VALUE rb_gsl_sf_debye_3(VALUE obj, VALUE x)
|
36
|
+
{
|
37
|
+
return rb_gsl_sf_eval1(gsl_sf_debye_3, x);
|
38
|
+
}
|
39
|
+
|
40
|
+
static VALUE rb_gsl_sf_debye_3_e(VALUE obj, VALUE x)
|
41
|
+
{
|
42
|
+
return rb_gsl_sf_eval_e(gsl_sf_debye_3_e, x);
|
43
|
+
}
|
44
|
+
|
45
|
+
static VALUE rb_gsl_sf_debye_4(VALUE obj, VALUE x)
|
46
|
+
{
|
47
|
+
return rb_gsl_sf_eval1(gsl_sf_debye_4, x);
|
48
|
+
}
|
49
|
+
|
50
|
+
static VALUE rb_gsl_sf_debye_4_e(VALUE obj, VALUE x)
|
51
|
+
{
|
52
|
+
return rb_gsl_sf_eval_e(gsl_sf_debye_4_e, x);
|
53
|
+
}
|
54
|
+
|
55
|
+
static VALUE rb_gsl_sf_debye_n(int argc, VALUE *argv, VALUE obj)
|
56
|
+
{
|
57
|
+
int n;
|
58
|
+
VALUE x;
|
59
|
+
switch (argc) {
|
60
|
+
case 1:
|
61
|
+
n = 1;
|
62
|
+
x = argv[0];
|
63
|
+
break;
|
64
|
+
case 2:
|
65
|
+
CHECK_FIXNUM(argv[0]);
|
66
|
+
n = FIX2INT(argv[0]);
|
67
|
+
x = argv[1];
|
68
|
+
break;
|
69
|
+
default:
|
70
|
+
rb_raise(rb_eArgError, "wrong number of arguments (%d for 1 or 2)", argc);
|
71
|
+
break;
|
72
|
+
}
|
73
|
+
switch (n) {
|
74
|
+
case 1:
|
75
|
+
return rb_gsl_sf_eval1(gsl_sf_debye_1, x);
|
76
|
+
break;
|
77
|
+
case 2:
|
78
|
+
return rb_gsl_sf_eval1(gsl_sf_debye_2, x);
|
79
|
+
break;
|
80
|
+
case 3:
|
81
|
+
return rb_gsl_sf_eval1(gsl_sf_debye_3, x);
|
82
|
+
break;
|
83
|
+
case 4:
|
84
|
+
return rb_gsl_sf_eval1(gsl_sf_debye_4, x);
|
85
|
+
break;
|
86
|
+
#ifdef GSL_1_8_LATER
|
87
|
+
case 5:
|
88
|
+
return rb_gsl_sf_eval1(gsl_sf_debye_5, x);
|
89
|
+
break;
|
90
|
+
case 6:
|
91
|
+
return rb_gsl_sf_eval1(gsl_sf_debye_6, x);
|
92
|
+
break;
|
93
|
+
#endif
|
94
|
+
default:
|
95
|
+
rb_raise(rb_eRuntimeError, "n must be 1, 2, 3, or 4");
|
96
|
+
break;
|
97
|
+
}
|
98
|
+
}
|
99
|
+
|
100
|
+
#ifdef GSL_1_8_LATER
|
101
|
+
static VALUE rb_gsl_sf_debye_5(VALUE obj, VALUE x)
|
102
|
+
{
|
103
|
+
return rb_gsl_sf_eval1(gsl_sf_debye_5, x);
|
104
|
+
}
|
105
|
+
|
106
|
+
static VALUE rb_gsl_sf_debye_5_e(VALUE obj, VALUE x)
|
107
|
+
{
|
108
|
+
return rb_gsl_sf_eval_e(gsl_sf_debye_5_e, x);
|
109
|
+
}
|
110
|
+
static VALUE rb_gsl_sf_debye_6(VALUE obj, VALUE x)
|
111
|
+
{
|
112
|
+
return rb_gsl_sf_eval1(gsl_sf_debye_6, x);
|
113
|
+
}
|
114
|
+
|
115
|
+
static VALUE rb_gsl_sf_debye_6_e(VALUE obj, VALUE x)
|
116
|
+
{
|
117
|
+
return rb_gsl_sf_eval_e(gsl_sf_debye_6_e, x);
|
118
|
+
}
|
119
|
+
|
120
|
+
#endif
|
121
|
+
|
122
|
+
void Init_gsl_sf_debye(VALUE module)
|
123
|
+
{
|
124
|
+
VALUE mgsl_sf_debye;
|
125
|
+
rb_define_module_function(module, "debye_1", rb_gsl_sf_debye_1, 1);
|
126
|
+
rb_define_module_function(module, "debye_1_e", rb_gsl_sf_debye_1_e, 1);
|
127
|
+
rb_define_module_function(module, "debye_2", rb_gsl_sf_debye_2, 1);
|
128
|
+
rb_define_module_function(module, "debye_2_e", rb_gsl_sf_debye_2_e, 1);
|
129
|
+
rb_define_module_function(module, "debye_3", rb_gsl_sf_debye_3, 1);
|
130
|
+
rb_define_module_function(module, "debye_3_e", rb_gsl_sf_debye_3_e, 1);
|
131
|
+
rb_define_module_function(module, "debye_4", rb_gsl_sf_debye_4, 1);
|
132
|
+
rb_define_module_function(module, "debye_4_e", rb_gsl_sf_debye_4_e, 1);
|
133
|
+
#ifdef GSL_1_8_LATER
|
134
|
+
rb_define_module_function(module, "debye_5", rb_gsl_sf_debye_5, 1);
|
135
|
+
rb_define_module_function(module, "debye_5_e", rb_gsl_sf_debye_5_e, 1);
|
136
|
+
rb_define_module_function(module, "debye_6", rb_gsl_sf_debye_6, 1);
|
137
|
+
rb_define_module_function(module, "debye_6_e", rb_gsl_sf_debye_6_e, 1);
|
138
|
+
#endif
|
139
|
+
rb_define_module_function(module, "debye_n", rb_gsl_sf_debye_n, -1);
|
140
|
+
|
141
|
+
mgsl_sf_debye = rb_define_module_under(module, "Debye");
|
142
|
+
rb_define_module_function(mgsl_sf_debye, "one", rb_gsl_sf_debye_1, 1);
|
143
|
+
rb_define_module_function(mgsl_sf_debye, "one_e", rb_gsl_sf_debye_1_e, 1);
|
144
|
+
rb_define_module_function(mgsl_sf_debye, "two", rb_gsl_sf_debye_2, 1);
|
145
|
+
rb_define_module_function(mgsl_sf_debye, "two_e", rb_gsl_sf_debye_2_e, 1);
|
146
|
+
rb_define_module_function(mgsl_sf_debye, "three", rb_gsl_sf_debye_3, 1);
|
147
|
+
rb_define_module_function(mgsl_sf_debye, "three_e", rb_gsl_sf_debye_3_e, 1);
|
148
|
+
rb_define_module_function(mgsl_sf_debye, "four", rb_gsl_sf_debye_4, 1);
|
149
|
+
rb_define_module_function(mgsl_sf_debye, "four_e", rb_gsl_sf_debye_4_e, 1);
|
150
|
+
#ifdef GSL_1_8_LATER
|
151
|
+
rb_define_module_function(mgsl_sf_debye, "five", rb_gsl_sf_debye_5, 1);
|
152
|
+
rb_define_module_function(mgsl_sf_debye, "five_e", rb_gsl_sf_debye_5_e, 1);
|
153
|
+
rb_define_module_function(mgsl_sf_debye, "six", rb_gsl_sf_debye_6, 1);
|
154
|
+
rb_define_module_function(mgsl_sf_debye, "six_e", rb_gsl_sf_debye_6_e, 1);
|
155
|
+
#endif
|
156
|
+
rb_define_module_function(mgsl_sf_debye, "n", rb_gsl_sf_debye_n, -1);
|
157
|
+
}
|