gsl 1.12.108

Sign up to get free protection for your applications and to get access to all the features.
Files changed (158) hide show
  1. data/README.rdoc +29 -0
  2. data/Rakefile +54 -0
  3. data/VERSION +2 -0
  4. data/ext/MANIFEST +119 -0
  5. data/ext/alf.c +206 -0
  6. data/ext/array.c +666 -0
  7. data/ext/array_complex.c +247 -0
  8. data/ext/blas.c +29 -0
  9. data/ext/blas1.c +731 -0
  10. data/ext/blas2.c +1093 -0
  11. data/ext/blas3.c +881 -0
  12. data/ext/block.c +44 -0
  13. data/ext/block_source.c +886 -0
  14. data/ext/bspline.c +130 -0
  15. data/ext/bundle.c +3 -0
  16. data/ext/cdf.c +754 -0
  17. data/ext/cheb.c +542 -0
  18. data/ext/combination.c +283 -0
  19. data/ext/common.c +325 -0
  20. data/ext/complex.c +1004 -0
  21. data/ext/const.c +673 -0
  22. data/ext/const_additional.c +120 -0
  23. data/ext/cqp.c +283 -0
  24. data/ext/deriv.c +195 -0
  25. data/ext/dht.c +361 -0
  26. data/ext/diff.c +166 -0
  27. data/ext/dirac.c +395 -0
  28. data/ext/eigen.c +2373 -0
  29. data/ext/error.c +194 -0
  30. data/ext/extconf.rb +281 -0
  31. data/ext/fcmp.c +66 -0
  32. data/ext/fft.c +1092 -0
  33. data/ext/fit.c +205 -0
  34. data/ext/fresnel.c +312 -0
  35. data/ext/function.c +524 -0
  36. data/ext/geometry.c +139 -0
  37. data/ext/graph.c +1638 -0
  38. data/ext/gsl.c +271 -0
  39. data/ext/gsl_narray.c +653 -0
  40. data/ext/histogram.c +1995 -0
  41. data/ext/histogram2d.c +1068 -0
  42. data/ext/histogram3d.c +884 -0
  43. data/ext/histogram3d_source.c +750 -0
  44. data/ext/histogram_find.c +101 -0
  45. data/ext/histogram_oper.c +159 -0
  46. data/ext/ieee.c +98 -0
  47. data/ext/integration.c +1138 -0
  48. data/ext/interp.c +512 -0
  49. data/ext/jacobi.c +739 -0
  50. data/ext/linalg.c +4047 -0
  51. data/ext/linalg_complex.c +741 -0
  52. data/ext/math.c +725 -0
  53. data/ext/matrix.c +39 -0
  54. data/ext/matrix_complex.c +1732 -0
  55. data/ext/matrix_double.c +560 -0
  56. data/ext/matrix_int.c +256 -0
  57. data/ext/matrix_source.c +2733 -0
  58. data/ext/min.c +250 -0
  59. data/ext/monte.c +992 -0
  60. data/ext/multifit.c +1879 -0
  61. data/ext/multimin.c +808 -0
  62. data/ext/multimin_fsdf.c +156 -0
  63. data/ext/multiroots.c +955 -0
  64. data/ext/ndlinear.c +321 -0
  65. data/ext/nmf.c +167 -0
  66. data/ext/nmf_wrap.c +72 -0
  67. data/ext/ntuple.c +469 -0
  68. data/ext/odeiv.c +959 -0
  69. data/ext/ool.c +879 -0
  70. data/ext/oper_complex_source.c +253 -0
  71. data/ext/permutation.c +596 -0
  72. data/ext/poly.c +42 -0
  73. data/ext/poly2.c +265 -0
  74. data/ext/poly_source.c +1885 -0
  75. data/ext/qrng.c +171 -0
  76. data/ext/randist.c +1873 -0
  77. data/ext/rational.c +480 -0
  78. data/ext/rng.c +612 -0
  79. data/ext/root.c +408 -0
  80. data/ext/sf.c +1494 -0
  81. data/ext/sf_airy.c +200 -0
  82. data/ext/sf_bessel.c +867 -0
  83. data/ext/sf_clausen.c +28 -0
  84. data/ext/sf_coulomb.c +206 -0
  85. data/ext/sf_coupling.c +118 -0
  86. data/ext/sf_dawson.c +29 -0
  87. data/ext/sf_debye.c +157 -0
  88. data/ext/sf_dilog.c +42 -0
  89. data/ext/sf_elementary.c +44 -0
  90. data/ext/sf_ellint.c +206 -0
  91. data/ext/sf_elljac.c +29 -0
  92. data/ext/sf_erfc.c +93 -0
  93. data/ext/sf_exp.c +164 -0
  94. data/ext/sf_expint.c +211 -0
  95. data/ext/sf_fermi_dirac.c +148 -0
  96. data/ext/sf_gamma.c +344 -0
  97. data/ext/sf_gegenbauer.c +96 -0
  98. data/ext/sf_hyperg.c +197 -0
  99. data/ext/sf_laguerre.c +112 -0
  100. data/ext/sf_lambert.c +47 -0
  101. data/ext/sf_legendre.c +367 -0
  102. data/ext/sf_log.c +104 -0
  103. data/ext/sf_mathieu.c +238 -0
  104. data/ext/sf_power.c +46 -0
  105. data/ext/sf_psi.c +98 -0
  106. data/ext/sf_synchrotron.c +48 -0
  107. data/ext/sf_transport.c +76 -0
  108. data/ext/sf_trigonometric.c +207 -0
  109. data/ext/sf_zeta.c +119 -0
  110. data/ext/signal.c +310 -0
  111. data/ext/siman.c +718 -0
  112. data/ext/sort.c +208 -0
  113. data/ext/spline.c +395 -0
  114. data/ext/stats.c +799 -0
  115. data/ext/sum.c +168 -0
  116. data/ext/tamu_anova.c +56 -0
  117. data/ext/tensor.c +38 -0
  118. data/ext/tensor_source.c +1123 -0
  119. data/ext/vector.c +38 -0
  120. data/ext/vector_complex.c +2236 -0
  121. data/ext/vector_double.c +1433 -0
  122. data/ext/vector_int.c +204 -0
  123. data/ext/vector_source.c +3329 -0
  124. data/ext/wavelet.c +937 -0
  125. data/include/rb_gsl.h +151 -0
  126. data/include/rb_gsl_array.h +238 -0
  127. data/include/rb_gsl_cheb.h +21 -0
  128. data/include/rb_gsl_common.h +343 -0
  129. data/include/rb_gsl_complex.h +25 -0
  130. data/include/rb_gsl_const.h +29 -0
  131. data/include/rb_gsl_dirac.h +13 -0
  132. data/include/rb_gsl_eigen.h +17 -0
  133. data/include/rb_gsl_fft.h +62 -0
  134. data/include/rb_gsl_fit.h +25 -0
  135. data/include/rb_gsl_function.h +27 -0
  136. data/include/rb_gsl_graph.h +70 -0
  137. data/include/rb_gsl_histogram.h +63 -0
  138. data/include/rb_gsl_histogram3d.h +97 -0
  139. data/include/rb_gsl_integration.h +17 -0
  140. data/include/rb_gsl_interp.h +46 -0
  141. data/include/rb_gsl_linalg.h +25 -0
  142. data/include/rb_gsl_math.h +26 -0
  143. data/include/rb_gsl_odeiv.h +21 -0
  144. data/include/rb_gsl_poly.h +71 -0
  145. data/include/rb_gsl_rational.h +37 -0
  146. data/include/rb_gsl_rng.h +21 -0
  147. data/include/rb_gsl_root.h +22 -0
  148. data/include/rb_gsl_sf.h +119 -0
  149. data/include/rb_gsl_statistics.h +17 -0
  150. data/include/rb_gsl_tensor.h +45 -0
  151. data/include/rb_gsl_with_narray.h +22 -0
  152. data/include/templates_off.h +87 -0
  153. data/include/templates_on.h +241 -0
  154. data/lib/gsl/gnuplot.rb +41 -0
  155. data/lib/gsl/oper.rb +68 -0
  156. data/lib/ool.rb +22 -0
  157. data/lib/ool/conmin.rb +30 -0
  158. metadata +224 -0
@@ -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
+ }
@@ -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
+ }
@@ -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
+ }
@@ -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
+ }
@@ -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
+ }