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,42 @@
1
+ /*
2
+ sf_dilog.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_dilog(VALUE obj, VALUE x)
16
+ {
17
+ return rb_gsl_sf_eval1(gsl_sf_dilog, x);
18
+ }
19
+
20
+ static VALUE rb_gsl_sf_dilog_e(VALUE obj, VALUE x)
21
+ {
22
+ return rb_gsl_sf_eval_e(gsl_sf_dilog_e, x);
23
+ }
24
+
25
+ static VALUE rb_gsl_sf_complex_dilog_e(VALUE obj, VALUE r, VALUE theta)
26
+ {
27
+ gsl_sf_result *re, *im;
28
+ VALUE vre, vim;
29
+ int status;
30
+ Need_Float(r); Need_Float(theta);
31
+ vre = Data_Make_Struct(cgsl_sf_result, gsl_sf_result, 0, free, re);
32
+ vim = Data_Make_Struct(cgsl_sf_result, gsl_sf_result, 0, free, im);
33
+ status = gsl_sf_complex_dilog_e(NUM2DBL(r), NUM2DBL(theta), re, im);
34
+ return rb_ary_new3(2, vre, vim);
35
+ }
36
+
37
+ void Init_gsl_sf_dilog(VALUE module)
38
+ {
39
+ rb_define_module_function(module, "dilog", rb_gsl_sf_dilog, 1);
40
+ rb_define_module_function(module, "dilog_e", rb_gsl_sf_dilog_e, 1);
41
+ rb_define_module_function(module, "complex_dilog_e", rb_gsl_sf_complex_dilog_e, 2);
42
+ }
@@ -0,0 +1,44 @@
1
+ /*
2
+ sf_elementary.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_multiply_e(VALUE obj, VALUE x, VALUE y)
16
+ {
17
+ gsl_sf_result *r;
18
+ VALUE v;
19
+ int status;
20
+ Need_Float(x); Need_Float(y);
21
+ v = Data_Make_Struct(cgsl_sf_result, gsl_sf_result, 0, free, r);
22
+ status = gsl_sf_multiply_e(NUM2DBL(x), NUM2DBL(y), r);
23
+ return v;
24
+ }
25
+
26
+ static VALUE rb_gsl_sf_multiply_err_e(VALUE obj, VALUE x, VALUE dx,
27
+ VALUE y, VALUE dy)
28
+ {
29
+ gsl_sf_result *r;
30
+ VALUE v;
31
+ int status;
32
+ Need_Float(x); Need_Float(y);
33
+ Need_Float(dx); Need_Float(dy);
34
+ v = Data_Make_Struct(cgsl_sf_result, gsl_sf_result, 0, free, r);
35
+ status = gsl_sf_multiply_err_e(NUM2DBL(x), NUM2DBL(dx),
36
+ NUM2DBL(y), NUM2DBL(dy), r);
37
+ return v;
38
+ }
39
+
40
+ void Init_gsl_sf_elementary(VALUE module)
41
+ {
42
+ rb_define_module_function(module, "multiply_e", rb_gsl_sf_multiply_e, 2);
43
+ rb_define_module_function(module, "multiply_err_e", rb_gsl_sf_multiply_err_e, 4);
44
+ }
@@ -0,0 +1,206 @@
1
+ /*
2
+ sf_ellint.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_ellint_Kcomp(int argc, VALUE *argv, VALUE obj)
16
+ {
17
+ if (argc == 1) return eval_sf(gsl_sf_ellint_Kcomp, argv[0]);
18
+ else return rb_gsl_sf_eval_double_m(gsl_sf_ellint_Kcomp, argv[0], argv[1]);
19
+ }
20
+
21
+ static VALUE rb_gsl_sf_ellint_Kcomp_e(VALUE obj, VALUE k, VALUE m)
22
+ {
23
+ return rb_gsl_sf_eval_e_m(gsl_sf_ellint_Kcomp_e, k, m);
24
+ }
25
+
26
+ static VALUE rb_gsl_sf_ellint_Ecomp(int argc, VALUE *argv, VALUE obj)
27
+ {
28
+ if (argc == 1) return eval_sf(gsl_sf_ellint_Ecomp, argv[0]);
29
+ else return rb_gsl_sf_eval_double_m(gsl_sf_ellint_Ecomp, argv[0], argv[1]);
30
+ }
31
+
32
+ static VALUE rb_gsl_sf_ellint_Ecomp_e(VALUE obj, VALUE k, VALUE m)
33
+ {
34
+ return rb_gsl_sf_eval_e_m(gsl_sf_ellint_Ecomp_e, k, m);
35
+ }
36
+
37
+ static VALUE rb_gsl_sf_ellint_F(int argc, VALUE *argv, VALUE obj)
38
+ {
39
+ if (argc == 2)
40
+ return rb_gsl_sf_eval_double2_m(gsl_sf_ellint_F, argv[0], argv[1],
41
+ INT2FIX(GSL_PREC_DOUBLE));
42
+ else
43
+ return rb_gsl_sf_eval_double2_m(gsl_sf_ellint_F, argv[0], argv[1], argv[2]);
44
+ }
45
+
46
+ static VALUE rb_gsl_sf_ellint_F_e(VALUE obj, VALUE phi, VALUE k, VALUE m)
47
+ {
48
+ return rb_gsl_sf_eval_e_double2_m(gsl_sf_ellint_F_e, phi, k, m);
49
+ }
50
+
51
+ static VALUE rb_gsl_sf_ellint_E(int argc, VALUE *argv, VALUE obj)
52
+ {
53
+ if (argc == 2)
54
+ return rb_gsl_sf_eval_double2_m(gsl_sf_ellint_E, argv[0], argv[1],
55
+ INT2FIX(GSL_PREC_DOUBLE));
56
+ else
57
+ return rb_gsl_sf_eval_double2_m(gsl_sf_ellint_E, argv[0], argv[1], argv[2]);
58
+ }
59
+
60
+ static VALUE rb_gsl_sf_ellint_E_e(VALUE obj, VALUE phi, VALUE k, VALUE m)
61
+ {
62
+ return rb_gsl_sf_eval_e_double2_m(gsl_sf_ellint_E_e, phi, k, m);
63
+ }
64
+
65
+ static VALUE rb_gsl_sf_ellint_P(int argc, VALUE *argv, VALUE obj)
66
+
67
+ {
68
+ if (argc == 3)
69
+ return rb_gsl_sf_eval_double3_m(gsl_sf_ellint_P, argv[0], argv[1], argv[2],
70
+ INT2FIX(GSL_PREC_DOUBLE));
71
+ else
72
+ return rb_gsl_sf_eval_double3_m(gsl_sf_ellint_P, argv[0], argv[1], argv[2],
73
+ argv[3]);
74
+ }
75
+
76
+ static VALUE rb_gsl_sf_ellint_P_e(VALUE obj, VALUE phi, VALUE k,
77
+ VALUE n, VALUE m)
78
+ {
79
+ return rb_gsl_sf_eval_e_double3_m(gsl_sf_ellint_P_e, phi, k, n, m);
80
+ }
81
+
82
+ static VALUE rb_gsl_sf_ellint_D(int argc, VALUE *argv, VALUE obj)
83
+ {
84
+ if (argc == 3)
85
+ return rb_gsl_sf_eval_double3_m(gsl_sf_ellint_D, argv[0], argv[1], argv[2],
86
+ INT2FIX(GSL_PREC_DOUBLE));
87
+ else
88
+ return rb_gsl_sf_eval_double3_m(gsl_sf_ellint_D, argv[0], argv[1], argv[2],
89
+ argv[3]);
90
+ }
91
+
92
+ static VALUE rb_gsl_sf_ellint_D_e(VALUE obj, VALUE phi, VALUE k,
93
+ VALUE n, VALUE m)
94
+ {
95
+ return rb_gsl_sf_eval_e_double3_m(gsl_sf_ellint_D_e, phi, k, n, m);
96
+ }
97
+
98
+ static VALUE rb_gsl_sf_ellint_RC(int argc, VALUE *argv, VALUE obj)
99
+ {
100
+ if (argc == 2)
101
+ return rb_gsl_sf_eval_double2_m(gsl_sf_ellint_RC, argv[0], argv[1],
102
+ INT2FIX(GSL_PREC_DOUBLE));
103
+ else
104
+ return rb_gsl_sf_eval_double2_m(gsl_sf_ellint_RC, argv[0], argv[1], argv[2]);
105
+ }
106
+
107
+ static VALUE rb_gsl_sf_ellint_RC_e(VALUE obj, VALUE x, VALUE y, VALUE m)
108
+ {
109
+ return rb_gsl_sf_eval_e_double2_m(gsl_sf_ellint_RC_e, x, y, m);
110
+ }
111
+
112
+ static VALUE rb_gsl_sf_ellint_RD(int argc, VALUE *argv, VALUE obj)
113
+ {
114
+ if (argc == 3)
115
+ return rb_gsl_sf_eval_double3_m(gsl_sf_ellint_RD, argv[0], argv[1], argv[2],
116
+ INT2FIX(GSL_PREC_DOUBLE));
117
+ else
118
+ return rb_gsl_sf_eval_double3_m(gsl_sf_ellint_RD, argv[0], argv[1], argv[2],
119
+ argv[3]);
120
+ }
121
+
122
+ static VALUE rb_gsl_sf_ellint_RD_e(VALUE obj, VALUE x, VALUE y,
123
+ VALUE z, VALUE m)
124
+ {
125
+ return rb_gsl_sf_eval_e_double3_m(gsl_sf_ellint_RD_e, x, y, z, m);
126
+ }
127
+
128
+ static VALUE rb_gsl_sf_ellint_RF(int argc, VALUE *argv, VALUE obj)
129
+ {
130
+ if (argc == 3)
131
+ return rb_gsl_sf_eval_double3_m(gsl_sf_ellint_RF, argv[0], argv[1], argv[2],
132
+ INT2FIX(GSL_PREC_DOUBLE));
133
+ else
134
+ return rb_gsl_sf_eval_double3_m(gsl_sf_ellint_RF, argv[0], argv[1], argv[2],
135
+ argv[3]);
136
+ }
137
+
138
+ static VALUE rb_gsl_sf_ellint_RF_e(VALUE obj, VALUE x, VALUE y,
139
+ VALUE z, VALUE m)
140
+ {
141
+ return rb_gsl_sf_eval_e_double3_m(gsl_sf_ellint_RF_e, x, y, z, m);
142
+ }
143
+
144
+ static VALUE rb_gsl_sf_ellint_RJ(int argc, VALUE *argv, VALUE obj)
145
+ {
146
+ if (argc == 4)
147
+ return rb_gsl_sf_eval_double4_m(gsl_sf_ellint_RJ, argv[0], argv[1], argv[2],
148
+ argv[3], INT2FIX(GSL_PREC_DOUBLE));
149
+ else
150
+ return rb_gsl_sf_eval_double4_m(gsl_sf_ellint_RJ, argv[0], argv[1], argv[2],
151
+ argv[3], argv[4]);
152
+ }
153
+
154
+ static VALUE rb_gsl_sf_ellint_RJ_e(VALUE obj, VALUE x, VALUE y,
155
+ VALUE z, VALUE p, VALUE m)
156
+ {
157
+ return rb_gsl_sf_eval_e_double4_m(gsl_sf_ellint_RJ_e, x, y, z, p, m);
158
+ }
159
+
160
+ void Init_gsl_sf_ellint(VALUE module)
161
+ {
162
+ VALUE mgsl_sf_ellint;
163
+
164
+ rb_define_module_function(module, "ellint_Kcomp", rb_gsl_sf_ellint_Kcomp, -1);
165
+ rb_define_module_function(module, "ellint_Kcomp_e", rb_gsl_sf_ellint_Kcomp_e, 2);
166
+ rb_define_module_function(module, "ellint_Ecomp", rb_gsl_sf_ellint_Ecomp, -1);
167
+ rb_define_module_function(module, "ellint_Ecomp_e", rb_gsl_sf_ellint_Ecomp_e, 2);
168
+ rb_define_module_function(module, "ellint_F", rb_gsl_sf_ellint_F, -1);
169
+ rb_define_module_function(module, "ellint_F_e", rb_gsl_sf_ellint_F_e, 3);
170
+ rb_define_module_function(module, "ellint_E", rb_gsl_sf_ellint_E, -1);
171
+ rb_define_module_function(module, "ellint_E_e", rb_gsl_sf_ellint_E_e, 3);
172
+ rb_define_module_function(module, "ellint_P", rb_gsl_sf_ellint_P, -1);
173
+ rb_define_module_function(module, "ellint_P_e", rb_gsl_sf_ellint_P_e, 4);
174
+ rb_define_module_function(module, "ellint_D", rb_gsl_sf_ellint_D, -1);
175
+ rb_define_module_function(module, "ellint_D_e", rb_gsl_sf_ellint_D_e, 4);
176
+ rb_define_module_function(module, "ellint_RC", rb_gsl_sf_ellint_RC, -1);
177
+ rb_define_module_function(module, "ellint_RC_e", rb_gsl_sf_ellint_RC_e, 3);
178
+ rb_define_module_function(module, "ellint_RD", rb_gsl_sf_ellint_RD, -1);
179
+ rb_define_module_function(module, "ellint_RD_e", rb_gsl_sf_ellint_RD_e, 4);
180
+ rb_define_module_function(module, "ellint_RF", rb_gsl_sf_ellint_RF, -1);
181
+ rb_define_module_function(module, "ellint_RF_e", rb_gsl_sf_ellint_RF_e, 4);
182
+ rb_define_module_function(module, "ellint_RJ", rb_gsl_sf_ellint_RJ, -1);
183
+ rb_define_module_function(module, "ellint_RJ_e", rb_gsl_sf_ellint_RJ_e, 5);
184
+
185
+ mgsl_sf_ellint = rb_define_module_under(module, "Ellint");
186
+ rb_define_module_function(mgsl_sf_ellint, "Kcomp", rb_gsl_sf_ellint_Kcomp, -1);
187
+ rb_define_module_function(mgsl_sf_ellint, "Kcomp_e", rb_gsl_sf_ellint_Kcomp_e, 2);
188
+ rb_define_module_function(mgsl_sf_ellint, "Ecomp", rb_gsl_sf_ellint_Ecomp, -1);
189
+ rb_define_module_function(mgsl_sf_ellint, "Ecomp_e", rb_gsl_sf_ellint_Ecomp_e, 2);
190
+ rb_define_module_function(mgsl_sf_ellint, "F", rb_gsl_sf_ellint_F, -1);
191
+ rb_define_module_function(mgsl_sf_ellint, "F_e", rb_gsl_sf_ellint_F_e, 3);
192
+ rb_define_module_function(mgsl_sf_ellint, "E", rb_gsl_sf_ellint_E, -1);
193
+ rb_define_module_function(mgsl_sf_ellint, "E_e", rb_gsl_sf_ellint_E_e, 3);
194
+ rb_define_module_function(mgsl_sf_ellint, "P", rb_gsl_sf_ellint_P, -1);
195
+ rb_define_module_function(mgsl_sf_ellint, "P_e", rb_gsl_sf_ellint_P_e, 4);
196
+ rb_define_module_function(mgsl_sf_ellint, "D", rb_gsl_sf_ellint_D, -1);
197
+ rb_define_module_function(mgsl_sf_ellint, "D_e", rb_gsl_sf_ellint_D_e, 4);
198
+ rb_define_module_function(mgsl_sf_ellint, "RC", rb_gsl_sf_ellint_RC, -1);
199
+ rb_define_module_function(mgsl_sf_ellint, "RC_e", rb_gsl_sf_ellint_RC_e, 3);
200
+ rb_define_module_function(mgsl_sf_ellint, "RD", rb_gsl_sf_ellint_RD, -1);
201
+ rb_define_module_function(mgsl_sf_ellint, "RD_e", rb_gsl_sf_ellint_RD_e, 4);
202
+ rb_define_module_function(mgsl_sf_ellint, "RF", rb_gsl_sf_ellint_RF, -1);
203
+ rb_define_module_function(mgsl_sf_ellint, "RF_e", rb_gsl_sf_ellint_RF_e, 4);
204
+ rb_define_module_function(mgsl_sf_ellint, "RJ", rb_gsl_sf_ellint_RJ, -1);
205
+ rb_define_module_function(mgsl_sf_ellint, "RJ_e", rb_gsl_sf_ellint_RJ_e, 5);
206
+ }
@@ -0,0 +1,29 @@
1
+ /*
2
+ sf_elljac.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_elljac_e(VALUE obj, VALUE n, VALUE m)
16
+ {
17
+ double sn, cn, dn;
18
+ int status;
19
+ Need_Float(n); Need_Float(m);
20
+ status = gsl_sf_elljac_e(NUM2DBL(n), NUM2DBL(m), &sn, &cn, &dn);
21
+ return rb_ary_new3(3, rb_float_new(sn),
22
+ rb_float_new(cn), rb_float_new(dn));
23
+ }
24
+
25
+ void Init_gsl_sf_elljac(VALUE module)
26
+ {
27
+ rb_define_module_function(module, "elljac_e", rb_gsl_sf_elljac_e, 2);
28
+ rb_define_module_function(module, "elljac", rb_gsl_sf_elljac_e, 2);
29
+ }
@@ -0,0 +1,93 @@
1
+ /*
2
+ sf_erfc.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_erf(VALUE obj, VALUE x)
16
+ {
17
+ return rb_gsl_sf_eval1(gsl_sf_erf, x);
18
+ }
19
+
20
+ static VALUE rb_gsl_sf_erf_e(VALUE obj, VALUE x)
21
+ {
22
+ return rb_gsl_sf_eval_e(gsl_sf_erf_e, x);
23
+ }
24
+
25
+ static VALUE rb_gsl_sf_erfc(VALUE obj, VALUE x)
26
+ {
27
+ return rb_gsl_sf_eval1(gsl_sf_erfc, x);
28
+ }
29
+
30
+ static VALUE rb_gsl_sf_erfc_e(VALUE obj, VALUE x)
31
+ {
32
+ return rb_gsl_sf_eval_e(gsl_sf_erfc_e, x);
33
+ }
34
+
35
+ static VALUE rb_gsl_sf_log_erfc(VALUE obj, VALUE x)
36
+ {
37
+ return rb_gsl_sf_eval1(gsl_sf_log_erfc, x);
38
+ }
39
+
40
+ static VALUE rb_gsl_sf_log_erfc_e(VALUE obj, VALUE x)
41
+ {
42
+ return rb_gsl_sf_eval_e(gsl_sf_log_erfc_e, x);
43
+ }
44
+
45
+ static VALUE rb_gsl_sf_erf_Z(VALUE obj, VALUE x)
46
+ {
47
+ return rb_gsl_sf_eval1(gsl_sf_erf_Z, x);
48
+ }
49
+
50
+ static VALUE rb_gsl_sf_erf_Z_e(VALUE obj, VALUE x)
51
+ {
52
+ return rb_gsl_sf_eval_e(gsl_sf_erf_Z_e, x);
53
+ }
54
+
55
+ static VALUE rb_gsl_sf_erf_Q(VALUE obj, VALUE x)
56
+ {
57
+ return rb_gsl_sf_eval1(gsl_sf_erf_Q, x);
58
+ }
59
+
60
+ static VALUE rb_gsl_sf_erf_Q_e(VALUE obj, VALUE x)
61
+ {
62
+ return rb_gsl_sf_eval_e(gsl_sf_erf_Q_e, x);
63
+ }
64
+
65
+ #ifdef GSL_1_4_LATER
66
+ static VALUE rb_gsl_sf_hazard(VALUE obj, VALUE x)
67
+ {
68
+ return rb_gsl_sf_eval1(gsl_sf_hazard, x);
69
+ }
70
+
71
+ static VALUE rb_gsl_sf_hazard_e(VALUE obj, VALUE x)
72
+ {
73
+ return rb_gsl_sf_eval_e(gsl_sf_hazard_e, x);
74
+ }
75
+ #endif
76
+
77
+ void Init_gsl_sf_erfc(VALUE module)
78
+ {
79
+ rb_define_module_function(module, "erf", rb_gsl_sf_erf, 1);
80
+ rb_define_module_function(module, "erf_e", rb_gsl_sf_erf_e, 1);
81
+ rb_define_module_function(module, "erfc", rb_gsl_sf_erfc, 1);
82
+ rb_define_module_function(module, "erfc_e", rb_gsl_sf_erfc_e, 1);
83
+ rb_define_module_function(module, "log_erfc", rb_gsl_sf_log_erfc, 1);
84
+ rb_define_module_function(module, "log_erfc_e", rb_gsl_sf_log_erfc_e, 1);
85
+ rb_define_module_function(module, "erf_Z", rb_gsl_sf_erf_Z, 1);
86
+ rb_define_module_function(module, "erf_Z_e", rb_gsl_sf_erf_Z_e, 1);
87
+ rb_define_module_function(module, "erf_Q", rb_gsl_sf_erf_Q, 1);
88
+ rb_define_module_function(module, "erf_Q_e", rb_gsl_sf_erf_Q_e, 1);
89
+ #ifdef GSL_1_4_LATER
90
+ rb_define_module_function(module, "hazard", rb_gsl_sf_hazard, 1);
91
+ rb_define_module_function(module, "hazard_e", rb_gsl_sf_hazard_e, 1);
92
+ #endif
93
+ }
@@ -0,0 +1,164 @@
1
+ /*
2
+ sf_exp.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_exp(VALUE obj, VALUE x)
16
+ {
17
+ if (COMPLEX_P(x) || VECTOR_COMPLEX_P(x) || MATRIX_COMPLEX_P(x)) {
18
+ return rb_gsl_math_complex_eval(gsl_complex_exp, x);
19
+ } else {
20
+ return rb_gsl_sf_eval1(gsl_sf_exp, x);
21
+ }
22
+ }
23
+
24
+ static VALUE rb_gsl_sf_exp_e(VALUE obj, VALUE x)
25
+ {
26
+ return rb_gsl_sf_eval_e(gsl_sf_exp_e, x);
27
+ }
28
+
29
+ static VALUE rb_gsl_sf_exp_e10_e(VALUE obj, VALUE x)
30
+ {
31
+ gsl_sf_result_e10 *rslt = NULL;
32
+ VALUE v;
33
+ int status;
34
+ Need_Float(x);
35
+ v = Data_Make_Struct(cgsl_sf_result_e10, gsl_sf_result_e10, 0, free, rslt);
36
+ status = gsl_sf_exp_e10_e(NUM2DBL(x), rslt);
37
+ return v;
38
+ }
39
+
40
+ static VALUE rb_gsl_sf_exp_mult(VALUE obj, VALUE x, VALUE y)
41
+ {
42
+ Need_Float(x); Need_Float(y);
43
+ return rb_float_new(gsl_sf_exp_mult(NUM2DBL(x), NUM2DBL(y)));
44
+ }
45
+
46
+ static VALUE rb_gsl_sf_exp_mult_e(VALUE obj, VALUE x, VALUE y)
47
+ {
48
+ return rb_gsl_sf_eval_e_double2(gsl_sf_exp_mult_e, x, y);
49
+ }
50
+
51
+ static VALUE rb_gsl_sf_exp_mult_e10_e(VALUE obj, VALUE x, VALUE y)
52
+ {
53
+ gsl_sf_result_e10 *rslt = NULL;
54
+ VALUE v;
55
+ int status;
56
+ Need_Float(x); Need_Float(y);
57
+ v = Data_Make_Struct(cgsl_sf_result_e10, gsl_sf_result_e10, 0, free, rslt);
58
+ status = gsl_sf_exp_mult_e10_e(NUM2DBL(x), NUM2DBL(y), rslt);
59
+ return v;
60
+ }
61
+
62
+ static VALUE rb_gsl_sf_expm1(VALUE obj, VALUE x)
63
+ {
64
+ return rb_gsl_sf_eval1(gsl_sf_expm1, x);
65
+ }
66
+
67
+ static VALUE rb_gsl_sf_expm1_e(VALUE obj, VALUE x)
68
+ {
69
+ return rb_gsl_sf_eval_e(gsl_sf_expm1_e, x);
70
+ }
71
+
72
+ static VALUE rb_gsl_sf_exprel(VALUE obj, VALUE x)
73
+ {
74
+ return rb_gsl_sf_eval1(gsl_sf_exprel, x);
75
+ }
76
+
77
+ static VALUE rb_gsl_sf_exprel_e(VALUE obj, VALUE x)
78
+ {
79
+ return rb_gsl_sf_eval_e(gsl_sf_exprel_e, x);
80
+ }
81
+
82
+ static VALUE rb_gsl_sf_exprel_2(VALUE obj, VALUE x)
83
+ {
84
+ return rb_gsl_sf_eval1(gsl_sf_exprel_2, x);
85
+ }
86
+
87
+ static VALUE rb_gsl_sf_exprel_2_e(VALUE obj, VALUE x)
88
+ {
89
+ return rb_gsl_sf_eval_e(gsl_sf_exprel_2_e, x);
90
+ }
91
+
92
+ static VALUE rb_gsl_sf_exprel_n(VALUE obj, VALUE n, VALUE x)
93
+ {
94
+ return rb_gsl_sf_eval_int_double(gsl_sf_exprel_n, n, x);
95
+ }
96
+
97
+ static VALUE rb_gsl_sf_exprel_n_e(VALUE obj, VALUE n, VALUE x)
98
+ {
99
+ return rb_gsl_sf_eval_e_int_double(gsl_sf_exprel_n_e, n, x);
100
+ }
101
+
102
+ static VALUE rb_gsl_sf_exp_err_e(VALUE obj, VALUE x, VALUE dx)
103
+ {
104
+ return rb_gsl_sf_eval_e_double2(gsl_sf_exp_err_e, x, dx);
105
+ }
106
+
107
+ static VALUE rb_gsl_sf_exp_err_e10_e(VALUE obj, VALUE x, VALUE dx)
108
+ {
109
+ gsl_sf_result_e10 *rslt = NULL;
110
+ VALUE v;
111
+ int status;
112
+ Need_Float(x); Need_Float(dx);
113
+ v = Data_Make_Struct(cgsl_sf_result_e10, gsl_sf_result_e10, 0, free, rslt);
114
+ status = gsl_sf_exp_err_e10_e(NUM2DBL(x), NUM2DBL(dx), rslt);
115
+ return v;
116
+ }
117
+
118
+ static VALUE rb_gsl_sf_exp_mult_err_e(VALUE obj, VALUE x, VALUE dx,
119
+ VALUE y, VALUE dy)
120
+ {
121
+ gsl_sf_result *rslt = NULL;
122
+ VALUE v;
123
+ int status;
124
+ Need_Float(x); Need_Float(y);
125
+ Need_Float(dx); Need_Float(dy);
126
+ v = Data_Make_Struct(cgsl_sf_result, gsl_sf_result, 0, free, rslt);
127
+ status = gsl_sf_exp_mult_err_e(NUM2DBL(x), NUM2DBL(dx), NUM2DBL(y), NUM2DBL(dy), rslt);
128
+ return v;
129
+ }
130
+
131
+ static VALUE rb_gsl_sf_exp_mult_err_e10_e(VALUE obj, VALUE x, VALUE dx,
132
+ VALUE y, VALUE dy)
133
+ {
134
+ gsl_sf_result_e10 *rslt = NULL;
135
+ VALUE v;
136
+ int status;
137
+ Need_Float(x); Need_Float(y);
138
+ Need_Float(dx); Need_Float(dy);
139
+ v = Data_Make_Struct(cgsl_sf_result_e10, gsl_sf_result_e10, 0, free, rslt);
140
+ status = gsl_sf_exp_mult_err_e10_e(NUM2DBL(x), NUM2DBL(dx), NUM2DBL(y), NUM2DBL(dy), rslt);
141
+ return v;
142
+ }
143
+
144
+ void Init_gsl_sf_exp(VALUE module)
145
+ {
146
+ rb_define_module_function(module, "exp", rb_gsl_sf_exp, 1);
147
+ rb_define_module_function(module, "exp_e", rb_gsl_sf_exp_e, 1);
148
+ rb_define_module_function(module, "exp_e10_e", rb_gsl_sf_exp_e10_e, 1);
149
+ rb_define_module_function(module, "exp_mult", rb_gsl_sf_exp_mult, 2);
150
+ rb_define_module_function(module, "exp_mult_e", rb_gsl_sf_exp_mult_e, 2);
151
+ rb_define_module_function(module, "exp_mult_e10_e", rb_gsl_sf_exp_mult_e10_e, 2);
152
+ rb_define_module_function(module, "expm1", rb_gsl_sf_expm1, 1);
153
+ rb_define_module_function(module, "expm1_e", rb_gsl_sf_expm1_e, 1);
154
+ rb_define_module_function(module, "exprel", rb_gsl_sf_exprel, 1);
155
+ rb_define_module_function(module, "exprel_e", rb_gsl_sf_exprel_e, 1);
156
+ rb_define_module_function(module, "exprel_2", rb_gsl_sf_exprel_2, 1);
157
+ rb_define_module_function(module, "exprel_2_e", rb_gsl_sf_exprel_2_e, 1);
158
+ rb_define_module_function(module, "exprel_n", rb_gsl_sf_exprel_n, 2);
159
+ rb_define_module_function(module, "exprel_n_e", rb_gsl_sf_exprel_n_e, 2);
160
+ rb_define_module_function(module, "exp_err_e", rb_gsl_sf_exp_err_e, 2);
161
+ rb_define_module_function(module, "exp_err_e10_e", rb_gsl_sf_exp_err_e10_e, 2);
162
+ rb_define_module_function(module, "exp_mult_err_e", rb_gsl_sf_exp_mult_err_e, 4);
163
+ rb_define_module_function(module, "exp_mult_err_e10_e", rb_gsl_sf_exp_mult_err_e10_e, 4);
164
+ }