numo-gsl 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (266) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +4 -0
  3. data/README.md +84 -0
  4. data/Rakefile +16 -0
  5. data/ext/numo/gsl/cdf/depend +17 -0
  6. data/ext/numo/gsl/cdf/erbpp_cdf.rb +44 -0
  7. data/ext/numo/gsl/cdf/extconf.rb +9 -0
  8. data/ext/numo/gsl/cdf/func_def.rb +610 -0
  9. data/ext/numo/gsl/const/const_def.rb +419 -0
  10. data/ext/numo/gsl/const/depend +17 -0
  11. data/ext/numo/gsl/const/erbpp_const.rb +30 -0
  12. data/ext/numo/gsl/const/extconf.rb +9 -0
  13. data/ext/numo/gsl/err/depend +1 -0
  14. data/ext/numo/gsl/err/err.c +22 -0
  15. data/ext/numo/gsl/err/extconf.rb +9 -0
  16. data/ext/numo/gsl/extconf_gsl.rb +44 -0
  17. data/ext/numo/gsl/fit/depend +17 -0
  18. data/ext/numo/gsl/fit/erbpp_fit.rb +74 -0
  19. data/ext/numo/gsl/fit/extconf.rb +9 -0
  20. data/ext/numo/gsl/fit/func_def.rb +129 -0
  21. data/ext/numo/gsl/fit/tmpl/check_1d.c +9 -0
  22. data/ext/numo/gsl/fit/tmpl/fit_linear.c +53 -0
  23. data/ext/numo/gsl/fit/tmpl/fit_linear_est.c +56 -0
  24. data/ext/numo/gsl/fit/tmpl/fit_mul.c +50 -0
  25. data/ext/numo/gsl/fit/tmpl/fit_mul_est.c +47 -0
  26. data/ext/numo/gsl/fit/tmpl/fit_wlinear.c +59 -0
  27. data/ext/numo/gsl/fit/tmpl/fit_wmul.c +56 -0
  28. data/ext/numo/gsl/gen/erbpp2.rb +306 -0
  29. data/ext/numo/gsl/gen/erbpp_gsl.rb +166 -0
  30. data/ext/numo/gsl/gen/func_parser.rb +520 -0
  31. data/ext/numo/gsl/gen/tmpl/c_DFloat_f_DFloat.c +40 -0
  32. data/ext/numo/gsl/gen/tmpl/c_DFloat_f_SZ.c +41 -0
  33. data/ext/numo/gsl/gen/tmpl/c_DFloat_f_SZ_x2.c +44 -0
  34. data/ext/numo/gsl/gen/tmpl/c_DFloat_x2_f_DFloat_x2.c +45 -0
  35. data/ext/numo/gsl/gen/tmpl/c_double_f_double.c +16 -0
  36. data/ext/numo/gsl/gen/tmpl/c_double_f_sizet.c +16 -0
  37. data/ext/numo/gsl/gen/tmpl/c_double_f_sizet_x2.c +17 -0
  38. data/ext/numo/gsl/gen/tmpl/c_double_f_void.c +15 -0
  39. data/ext/numo/gsl/gen/tmpl/c_double_x2_f_void.c +17 -0
  40. data/ext/numo/gsl/gen/tmpl/c_new_DFloat.c +29 -0
  41. data/ext/numo/gsl/gen/tmpl/c_new_double.c +22 -0
  42. data/ext/numo/gsl/gen/tmpl/c_new_f_other.c +25 -0
  43. data/ext/numo/gsl/gen/tmpl/c_new_sizet.c +22 -0
  44. data/ext/numo/gsl/gen/tmpl/c_new_sizet_double.c +23 -0
  45. data/ext/numo/gsl/gen/tmpl/c_new_sizet_x2.c +23 -0
  46. data/ext/numo/gsl/gen/tmpl/c_new_void.c +21 -0
  47. data/ext/numo/gsl/gen/tmpl/c_other_f_void.c +19 -0
  48. data/ext/numo/gsl/gen/tmpl/c_self_f_DFloat.c +46 -0
  49. data/ext/numo/gsl/gen/tmpl/c_self_f_DFloat_x2.c +41 -0
  50. data/ext/numo/gsl/gen/tmpl/c_self_f_DFloat_x3.c +44 -0
  51. data/ext/numo/gsl/gen/tmpl/c_self_f_DFloat_x4.c +47 -0
  52. data/ext/numo/gsl/gen/tmpl/c_self_f_SZ_x2_DFloat.c +45 -0
  53. data/ext/numo/gsl/gen/tmpl/c_self_f_double.c +17 -0
  54. data/ext/numo/gsl/gen/tmpl/c_self_f_other.c +17 -0
  55. data/ext/numo/gsl/gen/tmpl/c_self_f_sizet.c +21 -0
  56. data/ext/numo/gsl/gen/tmpl/c_self_f_void.c +14 -0
  57. data/ext/numo/gsl/gen/tmpl/c_sizet_f_void.c +15 -0
  58. data/ext/numo/gsl/gen/tmpl/c_sizet_x2_f_void.c +17 -0
  59. data/ext/numo/gsl/gen/tmpl/c_str_f_void.c +15 -0
  60. data/ext/numo/gsl/gen/tmpl/c_super_new_void.c +18 -0
  61. data/ext/numo/gsl/gen/tmpl/c_uint_f_void.c +15 -0
  62. data/ext/numo/gsl/gen/tmpl/c_ulong_f_void.c +15 -0
  63. data/ext/numo/gsl/gen/tmpl/c_void_f_double.c +17 -0
  64. data/ext/numo/gsl/gen/tmpl/c_void_f_double_x2.c +18 -0
  65. data/ext/numo/gsl/gen/tmpl/c_void_f_double_x4.c +20 -0
  66. data/ext/numo/gsl/gen/tmpl/c_void_f_ulong.c +17 -0
  67. data/ext/numo/gsl/gen/tmpl/c_void_f_void.c +14 -0
  68. data/ext/numo/gsl/gen/tmpl/cast_1d_contiguous.c +15 -0
  69. data/ext/numo/gsl/gen/tmpl/cast_2d_contiguous.c +15 -0
  70. data/ext/numo/gsl/gen/tmpl/class.c +26 -0
  71. data/ext/numo/gsl/gen/tmpl/create_new_narray.c +26 -0
  72. data/ext/numo/gsl/gen/tmpl/init_class.c +10 -0
  73. data/ext/numo/gsl/gen/tmpl/init_module.c +12 -0
  74. data/ext/numo/gsl/gen/tmpl/lib.c +41 -0
  75. data/ext/numo/gsl/gen/tmpl/m_DFloat_Int_f_DFloat.c +38 -0
  76. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_DFloat.c +35 -0
  77. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_DFloat_Int.c +39 -0
  78. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_DFloat_UInt.c +39 -0
  79. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_DFloat_double.c +42 -0
  80. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_DFloat_double_x2.c +47 -0
  81. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_DFloat_int.c +42 -0
  82. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_DFloat_x2.c +38 -0
  83. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_DFloat_x3.c +41 -0
  84. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_Int.c +36 -0
  85. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt.c +36 -0
  86. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt32.c +36 -0
  87. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt32_double.c +43 -0
  88. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt32_double_uint.c +49 -0
  89. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt32_double_x2.c +48 -0
  90. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt32_uint_x3.c +51 -0
  91. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt_double.c +43 -0
  92. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt_double_uint.c +50 -0
  93. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt_double_x2.c +48 -0
  94. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_UInt_uint_x3.c +51 -0
  95. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_int_DFloat.c +41 -0
  96. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_int_DFloat_x2.c +44 -0
  97. data/ext/numo/gsl/gen/tmpl/m_DFloat_f_int_x2_DFloat_x2.c +46 -0
  98. data/ext/numo/gsl/gen/tmpl/m_Int_f_DFloat.c +36 -0
  99. data/ext/numo/gsl/gen/tmpl/m_Int_f_DFloat_x3.c +42 -0
  100. data/ext/numo/gsl/gen/tmpl/m_Int_f_int_DFloat.c +42 -0
  101. data/ext/numo/gsl/gen/tmpl/m_Int_f_int_DFloat_x2.c +45 -0
  102. data/ext/numo/gsl/gen/tmpl/mod_func_noloop.c +54 -0
  103. data/ext/numo/gsl/gen/tmpl/mod_func_scalar.c +27 -0
  104. data/ext/numo/gsl/gen/tmpl/module.c +9 -0
  105. data/ext/numo/gsl/histogram/depend +17 -0
  106. data/ext/numo/gsl/histogram/erbpp_histogram.rb +109 -0
  107. data/ext/numo/gsl/histogram/extconf.rb +9 -0
  108. data/ext/numo/gsl/histogram/func_def.rb +763 -0
  109. data/ext/numo/gsl/histogram/tmpl/c_DFloat_f_2d_get.c +54 -0
  110. data/ext/numo/gsl/histogram/tmpl/c_DFloat_f_field.c +35 -0
  111. data/ext/numo/gsl/histogram/tmpl/c_DFloat_f_get.c +47 -0
  112. data/ext/numo/gsl/histogram/tmpl/c_DFloat_x2_f_get_range.c +56 -0
  113. data/ext/numo/gsl/histogram/tmpl/c_bool_f_other.c +19 -0
  114. data/ext/numo/gsl/histogram/tmpl/c_bool_f_pdf_init.c +24 -0
  115. data/ext/numo/gsl/histogram/tmpl/c_self_f_2d_set_ranges.c +26 -0
  116. data/ext/numo/gsl/histogram/tmpl/c_self_f_set_ranges.c +21 -0
  117. data/ext/numo/gsl/histogram/tmpl/c_sizet_f_field.c +15 -0
  118. data/ext/numo/gsl/interp/depend +17 -0
  119. data/ext/numo/gsl/interp/erbpp_interp.rb +59 -0
  120. data/ext/numo/gsl/interp/extconf.rb +9 -0
  121. data/ext/numo/gsl/interp/func_def.rb +816 -0
  122. data/ext/numo/gsl/interp/parse_interp.rb +67 -0
  123. data/ext/numo/gsl/interp/tmpl/interp2d_new.c +36 -0
  124. data/ext/numo/gsl/interp/tmpl/interp2d_type_new.c +17 -0
  125. data/ext/numo/gsl/interp/tmpl/interp_bsearch.c +57 -0
  126. data/ext/numo/gsl/interp/tmpl/interp_new.c +29 -0
  127. data/ext/numo/gsl/interp/tmpl/interp_type_new.c +16 -0
  128. data/ext/numo/gsl/interp/tmpl/spline2d_eval.c +61 -0
  129. data/ext/numo/gsl/interp/tmpl/spline_eval.c +55 -0
  130. data/ext/numo/gsl/interp/tmpl/spline_integ.c +56 -0
  131. data/ext/numo/gsl/interp/type_def.rb +9 -0
  132. data/ext/numo/gsl/multifit/depend +17 -0
  133. data/ext/numo/gsl/multifit/erbpp_multifit.rb +99 -0
  134. data/ext/numo/gsl/multifit/extconf.rb +9 -0
  135. data/ext/numo/gsl/multifit/func_2.1.rb +1035 -0
  136. data/ext/numo/gsl/multifit/func_2.2.1.rb +736 -0
  137. data/ext/numo/gsl/multifit/func_2.2.rb +736 -0
  138. data/ext/numo/gsl/multifit/func_2.3.rb +872 -0
  139. data/ext/numo/gsl/multifit/func_def.rb +1012 -0
  140. data/ext/numo/gsl/multifit/tmpl/multifit_linear.c +66 -0
  141. data/ext/numo/gsl/multifit/tmpl/multifit_linear_est.c +48 -0
  142. data/ext/numo/gsl/multifit/tmpl/multifit_linear_residuals.c +47 -0
  143. data/ext/numo/gsl/multifit/tmpl/multifit_wlinear.c +70 -0
  144. data/ext/numo/gsl/multifit/type_def.rb +1 -0
  145. data/ext/numo/gsl/numo_gsl.h +117 -0
  146. data/ext/numo/gsl/pdf/depend +17 -0
  147. data/ext/numo/gsl/pdf/erbpp_pdf.rb +26 -0
  148. data/ext/numo/gsl/pdf/extconf.rb +9 -0
  149. data/ext/numo/gsl/pdf/func_2.2.1.rb +306 -0
  150. data/ext/numo/gsl/pdf/func_2.2.rb +306 -0
  151. data/ext/numo/gsl/pdf/func_2.3.rb +306 -0
  152. data/ext/numo/gsl/pdf/func_def.rb +282 -0
  153. data/ext/numo/gsl/pdf/parse_pdf.rb +42 -0
  154. data/ext/numo/gsl/pdf/tmpl/dirichlet.c +39 -0
  155. data/ext/numo/gsl/pdf/tmpl/multinomial.c +39 -0
  156. data/ext/numo/gsl/poly/depend +17 -0
  157. data/ext/numo/gsl/poly/erbpp_poly.rb +70 -0
  158. data/ext/numo/gsl/poly/extconf.rb +9 -0
  159. data/ext/numo/gsl/poly/func_def.rb +234 -0
  160. data/ext/numo/gsl/poly/tmpl/poly_complex_solve.c +59 -0
  161. data/ext/numo/gsl/poly/tmpl/poly_eval.c +70 -0
  162. data/ext/numo/gsl/poly/tmpl/poly_eval_derivs.c +40 -0
  163. data/ext/numo/gsl/ran/depend +17 -0
  164. data/ext/numo/gsl/ran/erbpp_ran.rb +42 -0
  165. data/ext/numo/gsl/ran/extconf.rb +9 -0
  166. data/ext/numo/gsl/ran/func_2.2.1.rb +1658 -0
  167. data/ext/numo/gsl/ran/func_2.2.rb +1658 -0
  168. data/ext/numo/gsl/ran/func_2.3.rb +1658 -0
  169. data/ext/numo/gsl/ran/func_def.rb +1594 -0
  170. data/ext/numo/gsl/ran/parse_ran.rb +10 -0
  171. data/ext/numo/gsl/rng/depend +17 -0
  172. data/ext/numo/gsl/rng/erbpp_rng.rb +58 -0
  173. data/ext/numo/gsl/rng/extconf.rb +9 -0
  174. data/ext/numo/gsl/rng/func_def.rb +230 -0
  175. data/ext/numo/gsl/rng/parse_rng.rb +125 -0
  176. data/ext/numo/gsl/rng/tmpl/ran.c +40 -0
  177. data/ext/numo/gsl/rng/tmpl/ran_DFloat_f_DFloat.c +28 -0
  178. data/ext/numo/gsl/rng/tmpl/ran_DFloat_x2.c +45 -0
  179. data/ext/numo/gsl/rng/tmpl/ran_DFloat_x3.c +51 -0
  180. data/ext/numo/gsl/rng/tmpl/ran_multinomial.c +32 -0
  181. data/ext/numo/gsl/rng/tmpl/rng_DFloat.c +29 -0
  182. data/ext/numo/gsl/rng/tmpl/rng_UInt.c +44 -0
  183. data/ext/numo/gsl/rng/tmpl/rng_alloc.c +24 -0
  184. data/ext/numo/gsl/rng/tmpl/rng_type_new.c +14 -0
  185. data/ext/numo/gsl/rng/type_def.rb +63 -0
  186. data/ext/numo/gsl/rstat/depend +17 -0
  187. data/ext/numo/gsl/rstat/erbpp_rstat.rb +64 -0
  188. data/ext/numo/gsl/rstat/extconf.rb +9 -0
  189. data/ext/numo/gsl/rstat/func_2.2.1.rb +116 -0
  190. data/ext/numo/gsl/rstat/func_2.2.rb +116 -0
  191. data/ext/numo/gsl/rstat/func_2.3.rb +123 -0
  192. data/ext/numo/gsl/rstat/func_def.rb +102 -0
  193. data/ext/numo/gsl/sf/depend +17 -0
  194. data/ext/numo/gsl/sf/erbpp_sf.rb +51 -0
  195. data/ext/numo/gsl/sf/extconf.rb +9 -0
  196. data/ext/numo/gsl/sf/func_def.rb +4703 -0
  197. data/ext/numo/gsl/sf/parse_sf.rb +277 -0
  198. data/ext/numo/gsl/sf/tmpl/c_DFloat_f_int_x2_DFloat.c +50 -0
  199. data/ext/numo/gsl/sf/tmpl/c_DFloat_f_int_x2_DFloat_x2.c +52 -0
  200. data/ext/numo/gsl/sf/tmpl/c_DFloat_f_int_x3_DFloat_x2.c +55 -0
  201. data/ext/numo/gsl/sf/tmpl/m_DFloat_f_DFloat_mode.c +47 -0
  202. data/ext/numo/gsl/sf/tmpl/m_DFloat_f_lmax_array.c +41 -0
  203. data/ext/numo/gsl/sf/tmpl/m_DFloat_f_nmin_nmax_array.c +49 -0
  204. data/ext/numo/gsl/spmatrix/const_2.2.1.rb +3 -0
  205. data/ext/numo/gsl/spmatrix/const_2.2.rb +3 -0
  206. data/ext/numo/gsl/spmatrix/const_2.3.rb +3 -0
  207. data/ext/numo/gsl/spmatrix/const_def.rb +2 -0
  208. data/ext/numo/gsl/spmatrix/depend +17 -0
  209. data/ext/numo/gsl/spmatrix/erbpp_spmatrix.rb +100 -0
  210. data/ext/numo/gsl/spmatrix/extconf.rb +9 -0
  211. data/ext/numo/gsl/spmatrix/func_2.2.1.rb +297 -0
  212. data/ext/numo/gsl/spmatrix/func_2.2.rb +297 -0
  213. data/ext/numo/gsl/spmatrix/func_2.3.rb +297 -0
  214. data/ext/numo/gsl/spmatrix/func_def.rb +218 -0
  215. data/ext/numo/gsl/spmatrix/parse_spmatrix.rb +70 -0
  216. data/ext/numo/gsl/spmatrix/tmpl/itersolve_iterate.c +47 -0
  217. data/ext/numo/gsl/spmatrix/tmpl/itersolve_new.c +22 -0
  218. data/ext/numo/gsl/spmatrix/tmpl/itersolve_type_new.c +16 -0
  219. data/ext/numo/gsl/spmatrix/tmpl/spblas_dgemm.c +35 -0
  220. data/ext/numo/gsl/spmatrix/tmpl/spblas_dgemv.c +43 -0
  221. data/ext/numo/gsl/spmatrix/tmpl/spmatrix_add.c +22 -0
  222. data/ext/numo/gsl/spmatrix/tmpl/spmatrix_d2sp.c +28 -0
  223. data/ext/numo/gsl/spmatrix/tmpl/spmatrix_new.c +40 -0
  224. data/ext/numo/gsl/spmatrix/tmpl/spmatrix_sp2d.c +25 -0
  225. data/ext/numo/gsl/spmatrix/type_def.rb +1 -0
  226. data/ext/numo/gsl/stats/depend +17 -0
  227. data/ext/numo/gsl/stats/erbpp_stats.rb +29 -0
  228. data/ext/numo/gsl/stats/extconf.rb +9 -0
  229. data/ext/numo/gsl/stats/func_2.2.1.rb +608 -0
  230. data/ext/numo/gsl/stats/func_2.2.rb +608 -0
  231. data/ext/numo/gsl/stats/func_2.3.rb +608 -0
  232. data/ext/numo/gsl/stats/func_def.rb +608 -0
  233. data/ext/numo/gsl/stats/parse_stats.rb +63 -0
  234. data/ext/numo/gsl/stats/tmpl/stats_1a0p.c +37 -0
  235. data/ext/numo/gsl/stats/tmpl/stats_1a0p_index.c +60 -0
  236. data/ext/numo/gsl/stats/tmpl/stats_1a1p.c +41 -0
  237. data/ext/numo/gsl/stats/tmpl/stats_1a2p.c +42 -0
  238. data/ext/numo/gsl/stats/tmpl/stats_2a0p.c +39 -0
  239. data/ext/numo/gsl/stats/tmpl/stats_2a1p.c +43 -0
  240. data/ext/numo/gsl/stats/tmpl/stats_2a2p.c +44 -0
  241. data/ext/numo/gsl/stats/tmpl/stats_minmax.c +37 -0
  242. data/ext/numo/gsl/stats/tmpl/stats_minmax_index.c +67 -0
  243. data/ext/numo/gsl/stats/tmpl/stats_spearman.c +46 -0
  244. data/ext/numo/gsl/sys/const_def.rb +21 -0
  245. data/ext/numo/gsl/sys/depend +17 -0
  246. data/ext/numo/gsl/sys/enum_def.rb +75 -0
  247. data/ext/numo/gsl/sys/erbpp_sys.rb +60 -0
  248. data/ext/numo/gsl/sys/extconf.rb +9 -0
  249. data/ext/numo/gsl/sys/func_def.rb +249 -0
  250. data/ext/numo/gsl/version.h +1 -0
  251. data/ext/numo/gsl/wavelet/depend +17 -0
  252. data/ext/numo/gsl/wavelet/erbpp_wavelet.rb +48 -0
  253. data/ext/numo/gsl/wavelet/extconf.rb +9 -0
  254. data/ext/numo/gsl/wavelet/func_def.rb +337 -0
  255. data/ext/numo/gsl/wavelet/parse_wavelet.rb +47 -0
  256. data/ext/numo/gsl/wavelet/tmpl/wavelet2d_transform.c +56 -0
  257. data/ext/numo/gsl/wavelet/tmpl/wavelet_array_check.c +56 -0
  258. data/ext/numo/gsl/wavelet/tmpl/wavelet_macro.c +1 -0
  259. data/ext/numo/gsl/wavelet/tmpl/wavelet_new.c +20 -0
  260. data/ext/numo/gsl/wavelet/tmpl/wavelet_transform.c +55 -0
  261. data/ext/numo/gsl/wavelet/tmpl/wavelet_transform2.c +22 -0
  262. data/ext/numo/gsl/wavelet/tmpl/wavelet_type_new.c +15 -0
  263. data/ext/numo/gsl/wavelet/type_def.rb +6 -0
  264. data/lib/numo/gsl.rb +17 -0
  265. data/numo-gsl.gemspec +33 -0
  266. metadata +367 -0
@@ -0,0 +1,282 @@
1
+ [{:func_name=>"gsl_ran_gaussian_pdf",
2
+ :func_type=>"double",
3
+ :args=>[["double", "x"], ["double", "sigma"]],
4
+ :desc=>
5
+ "This function computes the probability density p(x) at x\n" +
6
+ "for a Gaussian distribution with standard deviation sigma, using\n" +
7
+ "the formula given above."},
8
+ {:func_name=>"gsl_ran_ugaussian_pdf",
9
+ :func_type=>"double",
10
+ :args=>[["double", "x"]],
11
+ :desc=>
12
+ "These functions compute results for the unit Gaussian distribution. They\n" +
13
+ "are equivalent to the functions above with a standard deviation of one,\n" +
14
+ "sigma = 1."},
15
+ {:func_name=>"gsl_ran_gaussian_tail_pdf",
16
+ :func_type=>"double",
17
+ :args=>[["double", "x"], ["double", "a"], ["double", "sigma"]],
18
+ :desc=>
19
+ "This function computes the probability density p(x) at x\n" +
20
+ "for a Gaussian tail distribution with standard deviation sigma and\n" +
21
+ "lower limit a, using the formula given above."},
22
+ {:func_name=>"gsl_ran_ugaussian_tail_pdf",
23
+ :func_type=>"double",
24
+ :args=>[["double", "x"], ["double", "a"]],
25
+ :desc=>
26
+ "These functions compute results for the tail of a unit Gaussian\n" +
27
+ "distribution. They are equivalent to the functions above with a standard\n" +
28
+ "deviation of one, sigma = 1."},
29
+ {:func_name=>"gsl_ran_bivariate_gaussian_pdf",
30
+ :func_type=>"double",
31
+ :args=>
32
+ [["double", "x"],
33
+ ["double", "y"],
34
+ ["double", "sigma_x"],
35
+ ["double", "sigma_y"],
36
+ ["double", "rho"]],
37
+ :desc=>
38
+ "This function computes the probability density p(x,y) at\n" +
39
+ "(x,y) for a bivariate Gaussian distribution with standard\n" +
40
+ "deviations sigma_x, sigma_y and correlation coefficient\n" +
41
+ "rho, using the formula given above."},
42
+ {:func_name=>"gsl_ran_exponential_pdf",
43
+ :func_type=>"double",
44
+ :args=>[["double", "x"], ["double", "mu"]],
45
+ :desc=>
46
+ "This function computes the probability density p(x) at x\n" +
47
+ "for an exponential distribution with mean mu, using the formula\n" +
48
+ "given above."},
49
+ {:func_name=>"gsl_ran_laplace_pdf",
50
+ :func_type=>"double",
51
+ :args=>[["double", "x"], ["double", "a"]],
52
+ :desc=>
53
+ "This function computes the probability density p(x) at x\n" +
54
+ "for a Laplace distribution with width a, using the formula\n" +
55
+ "given above."},
56
+ {:func_name=>"gsl_ran_exppow_pdf",
57
+ :func_type=>"double",
58
+ :args=>[["double", "x"], ["double", "a"], ["double", "b"]],
59
+ :desc=>
60
+ "This function computes the probability density p(x) at x\n" +
61
+ "for an exponential power distribution with scale parameter a\n" +
62
+ "and exponent b, using the formula given above."},
63
+ {:func_name=>"gsl_ran_cauchy_pdf",
64
+ :func_type=>"double",
65
+ :args=>[["double", "x"], ["double", "a"]],
66
+ :desc=>
67
+ "This function computes the probability density p(x) at x\n" +
68
+ "for a Cauchy distribution with scale parameter a, using the formula\n" +
69
+ "given above."},
70
+ {:func_name=>"gsl_ran_rayleigh_pdf",
71
+ :func_type=>"double",
72
+ :args=>[["double", "x"], ["double", "sigma"]],
73
+ :desc=>
74
+ "This function computes the probability density p(x) at x\n" +
75
+ "for a Rayleigh distribution with scale parameter sigma, using the\n" +
76
+ "formula given above."},
77
+ {:func_name=>"gsl_ran_rayleigh_tail_pdf",
78
+ :func_type=>"double",
79
+ :args=>[["double", "x"], ["double", "a"], ["double", "sigma"]],
80
+ :desc=>
81
+ "This function computes the probability density p(x) at x\n" +
82
+ "for a Rayleigh tail distribution with scale parameter sigma and\n" +
83
+ "lower limit a, using the formula given above."},
84
+ {:func_name=>"gsl_ran_landau_pdf",
85
+ :func_type=>"double",
86
+ :args=>[["double", "x"]],
87
+ :desc=>
88
+ "This function computes the probability density p(x) at x\n" +
89
+ "for the Landau distribution using an approximation to the formula given\n" +
90
+ "above."},
91
+ {:func_name=>"gsl_ran_gamma_pdf",
92
+ :func_type=>"double",
93
+ :args=>[["double", "x"], ["double", "a"], ["double", "b"]],
94
+ :desc=>
95
+ "This function computes the probability density p(x) at x\n" +
96
+ "for a gamma distribution with parameters a and b, using the\n" +
97
+ "formula given above."},
98
+ {:func_name=>"gsl_ran_flat_pdf",
99
+ :func_type=>"double",
100
+ :args=>[["double", "x"], ["double", "a"], ["double", "b"]],
101
+ :desc=>
102
+ "This function computes the probability density p(x) at x\n" +
103
+ "for a uniform distribution from a to b, using the formula\n" +
104
+ "given above."},
105
+ {:func_name=>"gsl_ran_lognormal_pdf",
106
+ :func_type=>"double",
107
+ :args=>[["double", "x"], ["double", "zeta"], ["double", "sigma"]],
108
+ :desc=>
109
+ "This function computes the probability density p(x) at x\n" +
110
+ "for a lognormal distribution with parameters zeta and sigma,\n" +
111
+ "using the formula given above."},
112
+ {:func_name=>"gsl_ran_chisq_pdf",
113
+ :func_type=>"double",
114
+ :args=>[["double", "x"], ["double", "nu"]],
115
+ :desc=>
116
+ "This function computes the probability density p(x) at x\n" +
117
+ "for a chi-squared distribution with nu degrees of freedom, using\n" +
118
+ "the formula given above."},
119
+ {:func_name=>"gsl_ran_fdist_pdf",
120
+ :func_type=>"double",
121
+ :args=>[["double", "x"], ["double", "nu1"], ["double", "nu2"]],
122
+ :desc=>
123
+ "This function computes the probability density p(x) at x\n" +
124
+ "for an F-distribution with nu1 and nu2 degrees of freedom,\n" +
125
+ "using the formula given above."},
126
+ {:func_name=>"gsl_ran_tdist_pdf",
127
+ :func_type=>"double",
128
+ :args=>[["double", "x"], ["double", "nu"]],
129
+ :desc=>
130
+ "This function computes the probability density p(x) at x\n" +
131
+ "for a t-distribution with nu degrees of freedom, using the formula\n" +
132
+ "given above."},
133
+ {:func_name=>"gsl_ran_beta_pdf",
134
+ :func_type=>"double",
135
+ :args=>[["double", "x"], ["double", "a"], ["double", "b"]],
136
+ :desc=>
137
+ "This function computes the probability density p(x) at x\n" +
138
+ "for a beta distribution with parameters a and b, using the\n" +
139
+ "formula given above."},
140
+ {:func_name=>"gsl_ran_logistic_pdf",
141
+ :func_type=>"double",
142
+ :args=>[["double", "x"], ["double", "a"]],
143
+ :desc=>
144
+ "This function computes the probability density p(x) at x\n" +
145
+ "for a logistic distribution with scale parameter a, using the\n" +
146
+ "formula given above."},
147
+ {:func_name=>"gsl_ran_pareto_pdf",
148
+ :func_type=>"double",
149
+ :args=>[["double", "x"], ["double", "a"], ["double", "b"]],
150
+ :desc=>
151
+ "This function computes the probability density p(x) at x\n" +
152
+ "for a Pareto distribution with exponent a and scale b, using\n" +
153
+ "the formula given above."},
154
+ {:func_name=>"gsl_ran_weibull_pdf",
155
+ :func_type=>"double",
156
+ :args=>[["double", "x"], ["double", "a"], ["double", "b"]],
157
+ :desc=>
158
+ "This function computes the probability density p(x) at x\n" +
159
+ "for a Weibull distribution with scale a and exponent b,\n" +
160
+ "using the formula given above."},
161
+ {:func_name=>"gsl_ran_gumbel1_pdf",
162
+ :func_type=>"double",
163
+ :args=>[["double", "x"], ["double", "a"], ["double", "b"]],
164
+ :desc=>
165
+ "This function computes the probability density p(x) at x\n" +
166
+ "for a Type-1 Gumbel distribution with parameters a and b,\n" +
167
+ "using the formula given above."},
168
+ {:func_name=>"gsl_ran_gumbel2_pdf",
169
+ :func_type=>"double",
170
+ :args=>[["double", "x"], ["double", "a"], ["double", "b"]],
171
+ :desc=>
172
+ "This function computes the probability density p(x) at x\n" +
173
+ "for a Type-2 Gumbel distribution with parameters a and b,\n" +
174
+ "using the formula given above."},
175
+ {:func_name=>"gsl_ran_dirichlet_pdf",
176
+ :func_type=>"double",
177
+ :args=>
178
+ [["size_t", "K"], ["const double", "alpha[]"], ["const double", "theta[]"]],
179
+ :desc=>
180
+ "This function computes the probability density \n" +
181
+ "$p(\\theta_1, \\ldots , \\theta_K)$\n" +
182
+ "p(\\theta_1, ... , \\theta_K)\n" +
183
+ "at theta[K] for a Dirichlet distribution with parameters \n" +
184
+ "alpha[K], using the formula given above."},
185
+ {:func_name=>"gsl_ran_dirichlet_lnpdf",
186
+ :func_type=>"double",
187
+ :args=>
188
+ [["size_t", "K"], ["const double", "alpha[]"], ["const double", "theta[]"]],
189
+ :desc=>
190
+ "This function computes the logarithm of the probability density \n" +
191
+ "$p(\\theta_1, \\ldots , \\theta_K)$\n" +
192
+ "p(\\theta_1, ... , \\theta_K)\n" +
193
+ "for a Dirichlet distribution with parameters \n" +
194
+ "alpha[K]."},
195
+ {:func_name=>"gsl_ran_discrete_pdf",
196
+ :func_type=>"double",
197
+ :args=>[["size_t", "k"], ["const gsl_ran_discrete_t *", "g"]],
198
+ :desc=>
199
+ "Returns the probability P[k] of observing the variable k.\n" +
200
+ "Since P[k] is not stored as part of the lookup table, it must be\n" +
201
+ "recomputed; this computation takes O(K), so if K is large\n" +
202
+ "and you care about the original array P[k] used to create the\n" +
203
+ "lookup table, then you should just keep this original array P[k]\n" +
204
+ "around."},
205
+ {:func_name=>"gsl_ran_poisson_pdf",
206
+ :func_type=>"double",
207
+ :args=>[["unsigned int", "k"], ["double", "mu"]],
208
+ :desc=>
209
+ "This function computes the probability p(k) of obtaining k\n" +
210
+ "from a Poisson distribution with mean mu, using the formula\n" +
211
+ "given above."},
212
+ {:func_name=>"gsl_ran_bernoulli_pdf",
213
+ :func_type=>"double",
214
+ :args=>[["unsigned int", "k"], ["double", "p"]],
215
+ :desc=>
216
+ "This function computes the probability p(k) of obtaining\n" +
217
+ "k from a Bernoulli distribution with probability parameter\n" +
218
+ "p, using the formula given above."},
219
+ {:func_name=>"gsl_ran_binomial_pdf",
220
+ :func_type=>"double",
221
+ :args=>[["unsigned int", "k"], ["double", "p"], ["unsigned int", "n"]],
222
+ :desc=>
223
+ "This function computes the probability p(k) of obtaining k\n" +
224
+ "from a binomial distribution with parameters p and n, using\n" +
225
+ "the formula given above."},
226
+ {:func_name=>"gsl_ran_multinomial_pdf",
227
+ :func_type=>"double",
228
+ :args=>
229
+ [["size_t", "K"], ["const double", "p[]"], ["const unsigned int", "n[]"]],
230
+ :desc=>
231
+ "This function computes the probability \n" +
232
+ "$P(n_1, n_2, \\ldots, n_K)$\n" +
233
+ "P(n_1, n_2, ..., n_K)\n" +
234
+ "of sampling n[K] from a multinomial distribution \n" +
235
+ "with parameters p[K], using the formula given above."},
236
+ {:func_name=>"gsl_ran_multinomial_lnpdf",
237
+ :func_type=>"double",
238
+ :args=>
239
+ [["size_t", "K"], ["const double", "p[]"], ["const unsigned int", "n[]"]],
240
+ :desc=>
241
+ "This function returns the logarithm of the probability for the\n" +
242
+ "multinomial distribution $P(n_1, n_2, \\ldots, n_K)$\n" +
243
+ "P(n_1, n_2, ..., n_K) with parameters p[K]."},
244
+ {:func_name=>"gsl_ran_negative_binomial_pdf",
245
+ :func_type=>"double",
246
+ :args=>[["unsigned int", "k"], ["double", "p"], ["double", "n"]],
247
+ :desc=>
248
+ "This function computes the probability p(k) of obtaining k\n" +
249
+ "from a negative binomial distribution with parameters p and\n" +
250
+ "n, using the formula given above."},
251
+ {:func_name=>"gsl_ran_pascal_pdf",
252
+ :func_type=>"double",
253
+ :args=>[["unsigned int", "k"], ["double", "p"], ["unsigned int", "n"]],
254
+ :desc=>
255
+ "This function computes the probability p(k) of obtaining k\n" +
256
+ "from a Pascal distribution with parameters p and\n" +
257
+ "n, using the formula given above."},
258
+ {:func_name=>"gsl_ran_geometric_pdf",
259
+ :func_type=>"double",
260
+ :args=>[["unsigned int", "k"], ["double", "p"]],
261
+ :desc=>
262
+ "This function computes the probability p(k) of obtaining k\n" +
263
+ "from a geometric distribution with probability parameter p, using\n" +
264
+ "the formula given above."},
265
+ {:func_name=>"gsl_ran_hypergeometric_pdf",
266
+ :func_type=>"double",
267
+ :args=>
268
+ [["unsigned int", "k"],
269
+ ["unsigned int", "n1"],
270
+ ["unsigned int", "n2"],
271
+ ["unsigned int", "t"]],
272
+ :desc=>
273
+ "This function computes the probability p(k) of obtaining k\n" +
274
+ "from a hypergeometric distribution with parameters n1, n2,\n" +
275
+ "t, using the formula given above."},
276
+ {:func_name=>"gsl_ran_logarithmic_pdf",
277
+ :func_type=>"double",
278
+ :args=>[["unsigned int", "k"], ["double", "p"]],
279
+ :desc=>
280
+ "This function computes the probability p(k) of obtaining k\n" +
281
+ "from a logarithmic distribution with probability parameter p,\n" +
282
+ "using the formula given above."}]
@@ -0,0 +1,42 @@
1
+ require_relative "../gen/erbpp_gsl"
2
+
3
+ class DefPdf < DefGslModule
4
+ def lookup(h)
5
+ case h
6
+ when FM(name:/_dirichlet_(ln)?pdf$/); "dirichlet"
7
+ when FM(name:/_multinomial_(ln)?pdf$/); "multinomial"
8
+ when FM(name:/_discrete_pdf$/); false
9
+ when FM(name:/_multivariate_gaussian(_log)?_pdf$/); false
10
+ when FM(name:/_pdf$/); "mod_func_noloop"
11
+ end
12
+ end
13
+
14
+ def define_method(t,**h)
15
+ PdfMethod.new(self, t, **h)
16
+ end
17
+
18
+ def to_method_name(s)
19
+ s.sub(/^gsl_ran_(\w+[^_])_?pdf$/,'\1')
20
+ end
21
+ end
22
+
23
+ class PdfMethod < DefGslModuleFunction
24
+
25
+ PARAM_DESC = {}
26
+ PARAM_NAMES =
27
+ {
28
+ "double" => %w[a b p n mu nu nu1 nu2 sigma sigma_x sigma_y rho zeta],
29
+ "unsigned int" => %w[n n1 n2 t],
30
+ "size_t" => true,
31
+ }
32
+
33
+ def argument_property(type,name)
34
+ if name == "return"; {output:true, narray:true, pass: :return}
35
+ elsif name == "K"; {} # ignore array size
36
+ elsif /\[\]$/ =~ name; {input:true, narray:true, pass: :array}
37
+ elsif is_param(type,name); {input:true, param:true}
38
+ elsif /\*$/ =~ type; {output:true, narray:true, pass: :pointer}
39
+ else; {input:true, narray:true}
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,39 @@
1
+ static void
2
+ iter_<%=c_func%>(na_loop_t *const lp)
3
+ {
4
+ size_t n;
5
+ char *p1, *p2, *p3;
6
+
7
+ INIT_COUNTER(lp, n);
8
+ p1 = lp->args[0].ptr + lp->args[0].iter[0].pos;
9
+ p2 = lp->args[1].ptr + lp->args[1].iter[0].pos;
10
+ p3 = lp->args[2].ptr + lp->args[2].iter[0].pos;
11
+
12
+ *(double*)p3 = <%=func_name%>(n,(double*)p1,(double*)p2);
13
+ }
14
+
15
+ /*
16
+ @overload <%=name%>(<%=method_args%>, axis:nil, keepdims:false)
17
+ <% desc_param.each do |x|%>
18
+ <%=x%><% end %>
19
+ @param [Numeric,Array,Range] axis (keyword) Axes along which the operation is performed.
20
+ @param [TrueClass] keepdims (keyword) If true, the reduced axes are left in the result array as dimensions with size one.
21
+
22
+ <%=desc%>
23
+ */
24
+ static VALUE
25
+ <%=c_func(-1)%>(int argc, VALUE *argv, VALUE mod)
26
+ {
27
+ VALUE reduce;
28
+ ndfunc_arg_in_t ain[3] = {{cDF,0},{cDF,0},{sym_reduce,0}};
29
+ ndfunc_arg_out_t aout[1] = {{cDF,0}};
30
+ ndfunc_t ndf = { iter_<%=c_func%>, NDF_HAS_LOOP|NDF_FLAT_REDUCE|NDF_EXTRACT,
31
+ 3, 1, ain, aout };
32
+
33
+ if (argc<2) {
34
+ rb_raise(rb_eArgError,"wrong number of argument (%d for >=2)",argc);
35
+ }
36
+
37
+ reduce = nary_reduce_dimension(argc-2, argv+2, 2, argv, &ndf, 0);
38
+ return na_ndloop(&ndf, 3, argv[0], argv[1], reduce);
39
+ }
@@ -0,0 +1,39 @@
1
+ static void
2
+ iter_<%=c_func%>(na_loop_t *const lp)
3
+ {
4
+ size_t n;
5
+ char *p1, *p2, *p3;
6
+
7
+ INIT_COUNTER(lp, n);
8
+ p1 = lp->args[0].ptr + lp->args[0].iter[0].pos;
9
+ p2 = lp->args[1].ptr + lp->args[1].iter[0].pos;
10
+ p3 = lp->args[2].ptr + lp->args[2].iter[0].pos;
11
+
12
+ *(double*)p3 = <%=func_name%>(n,(double*)p1,(unsigned int *)p2);
13
+ }
14
+
15
+ /*
16
+ @overload <%=name%>(<%=method_args%>,[axis0,axis1,..])
17
+ <% desc_param.each do |x|%>
18
+ <%=x%><% end %>
19
+ @param [Numeric,Array,Range] axis (keyword) Axes along which the operation is performed.
20
+ @param [TrueClass] keepdims (keyword) If true, the reduced axes are left in the result array as dimensions with size one.
21
+
22
+ <%=desc%>
23
+ */
24
+ static VALUE
25
+ <%=c_func(-1)%>(int argc, VALUE *argv, VALUE mod)
26
+ {
27
+ VALUE reduce;
28
+ ndfunc_arg_in_t ain[3] = {{cDF,0},{cUI,0},{sym_reduce,0}};
29
+ ndfunc_arg_out_t aout[1] = {{cDF,0}};
30
+ ndfunc_t ndf = { iter_<%=c_func%>, NDF_HAS_LOOP|NDF_FLAT_REDUCE|NDF_EXTRACT,
31
+ 3, 1, ain, aout };
32
+
33
+ if (argc<2) {
34
+ rb_raise(rb_eArgError,"wrong number of argument (%d for >=2)",argc);
35
+ }
36
+
37
+ reduce = nary_reduce_dimension(argc-2, argv+2, 2, argv, &ndf, 0);
38
+ return na_ndloop(&ndf, 3, argv[0], argv[1], reduce);
39
+ }
@@ -0,0 +1,17 @@
1
+ COGEN=ruby erbpp_poly.rb
2
+ GENSRC=gsl_poly.c
3
+ GENDEPS=erbpp_poly.rb ../gen/*.rb ../gen/tmpl/*.c tmpl/*.c
4
+
5
+ src : $(GENSRC)
6
+
7
+ $(GENSRC) : $(GENDEPS)
8
+ $(COGEN) > $@
9
+
10
+ doc : $(GENSRC)
11
+ yard doc $(GENSRC)
12
+
13
+ clean: cleansrc cleandoc
14
+ cleansrc:
15
+ -$(Q)$(RM) $(GENSRC)
16
+ cleandoc:
17
+ -$(Q)$(RM_RF) doc .yardoc
@@ -0,0 +1,70 @@
1
+ require_relative "../gen/erbpp_gsl"
2
+ require "erbpp/line_number"
3
+
4
+ func_list = ErbppGsl.read_func
5
+ ErbppGsl.read_func_pattern(
6
+ [/^gsl_poly_complex_workspace_/, polyws_list=[]],
7
+ [/^gsl_/, poly_list=[]],
8
+ )
9
+
10
+ class DefPolyWs < DefGslClass
11
+ def lookup(h)
12
+ case h
13
+ when FM(name:/_workspace_free/); false
14
+ when FM(name:/_workspace_alloc/); "c_new_sizet"
15
+ end
16
+ end
17
+ end
18
+
19
+ class DefPoly < DefGslModule
20
+ def lookup(h)
21
+ case h
22
+ when FM(name:/^gsl_poly_eval$/); "poly_eval"
23
+ when FM(name:/^gsl_poly_eval_derivs$/); "poly_eval_derivs"
24
+ when FM(name:/^gsl_poly_complex_solve$/); "poly_complex_solve"
25
+ when FM(name:/^gsl_poly(_complex)?_solve_/); "mod_func_noloop"
26
+ end
27
+ end
28
+ end
29
+
30
+ DefLib.new(nil) do
31
+ set erb_dir: %w[tmpl ../gen/tmpl]
32
+ set erb_suffix: ".c"
33
+ set ns_var: "mG"
34
+
35
+ name = "Poly"
36
+ base = name.downcase
37
+ set file_name: "gsl_#{name}.c"
38
+ set include_files: %w[gsl/gsl_poly.h assert.h]
39
+ set lib_name: base
40
+
41
+ DefPoly.new(self) do
42
+ name = "Poly"
43
+ base = name.downcase
44
+ set name: base
45
+ set module_name: name
46
+ set module_var: "m"+name
47
+ set full_module_name: "Numo::GSL::"+name
48
+
49
+ DefPolyWs.new(self) do
50
+ wname = "ComplexWorkspace"
51
+ wbase = "poly_complex_workspace"
52
+ set name: wbase
53
+ set class_name: wname
54
+ set class_var: "c"+wname
55
+ set full_class_name: "Numo::GSL::Poly::"+wname
56
+ set struct: "gsl_"+wbase
57
+ set ns_var: "mPoly"
58
+
59
+ undef_alloc_func
60
+ polyws_list.each do |h|
61
+ check_func(h)
62
+ end
63
+ end
64
+
65
+ poly_list.each do |h|
66
+ check_func(h)
67
+ end
68
+ end
69
+
70
+ end.run