rb-gsl 1.16.0.4 → 1.16.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (307) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +12 -0
  3. data/.travis.yml +24 -0
  4. data/AUTHORS +6 -0
  5. data/COPYING +341 -339
  6. data/ChangeLog +608 -587
  7. data/Gemfile +4 -0
  8. data/README.md +77 -0
  9. data/Rakefile +14 -33
  10. data/THANKS +1 -1
  11. data/examples/blas/blas.rb +1 -1
  12. data/examples/bspline.rb +3 -3
  13. data/examples/complex/functions.rb +4 -4
  14. data/examples/complex/mul.rb +1 -1
  15. data/examples/const/physconst.rb +4 -4
  16. data/examples/const/travel.rb +4 -4
  17. data/examples/eigen/nonsymmv.rb +1 -1
  18. data/examples/eigen/qhoscillator.rb +3 -3
  19. data/examples/fft/radix2.rb +1 -1
  20. data/examples/fft/real-halfcomplex.rb +3 -3
  21. data/examples/fft/real-halfcomplex2.rb +3 -3
  22. data/examples/fit/expfit.rb +1 -1
  23. data/examples/fit/multifit.rb +1 -1
  24. data/examples/fit/ndlinear.rb +44 -44
  25. data/examples/fit/nonlinearfit.rb +1 -1
  26. data/examples/fit/wlinear.rb +3 -3
  27. data/examples/function/function.rb +1 -1
  28. data/examples/function/min.rb +1 -1
  29. data/examples/function/synchrotron.rb +2 -2
  30. data/examples/gallery/koch.rb +1 -1
  31. data/examples/histogram/cauchy.rb +2 -2
  32. data/examples/histogram/exponential.rb +1 -1
  33. data/examples/histogram/histo3d.rb +1 -1
  34. data/examples/histogram/histogram-pdf.rb +2 -2
  35. data/examples/histogram/xexp.rb +1 -1
  36. data/examples/integration/ahmed.rb +2 -2
  37. data/examples/integration/cosmology.rb +7 -7
  38. data/examples/integration/friedmann.rb +4 -4
  39. data/examples/integration/qng.rb +1 -1
  40. data/examples/interp/demo.rb +2 -2
  41. data/examples/linalg/LQ_solve.rb +1 -1
  42. data/examples/linalg/LU.rb +1 -1
  43. data/examples/linalg/LU2.rb +1 -1
  44. data/examples/linalg/LU_narray.rb +1 -1
  45. data/examples/linalg/PTLQ.rb +1 -1
  46. data/examples/linalg/QRPT.rb +1 -1
  47. data/examples/linalg/chol.rb +1 -1
  48. data/examples/linalg/chol_narray.rb +1 -1
  49. data/examples/linalg/complex.rb +1 -1
  50. data/examples/math/elementary.rb +1 -1
  51. data/examples/math/functions.rb +1 -1
  52. data/examples/math/inf_nan.rb +1 -1
  53. data/examples/math/minmax.rb +1 -1
  54. data/examples/math/power.rb +1 -1
  55. data/examples/math/test.rb +1 -1
  56. data/examples/min.rb +1 -1
  57. data/examples/multimin/bundle.rb +1 -1
  58. data/examples/multimin/cqp.rb +17 -17
  59. data/examples/multiroot/fsolver3.rb +1 -1
  60. data/examples/odeiv/binarysystem.rb +12 -12
  61. data/examples/odeiv/demo.rb +3 -3
  62. data/examples/odeiv/frei1.rb +7 -7
  63. data/examples/odeiv/frei2.rb +4 -4
  64. data/examples/odeiv/oscillator.rb +1 -1
  65. data/examples/odeiv/sedov.rb +3 -3
  66. data/examples/odeiv/whitedwarf.rb +11 -11
  67. data/examples/permutation/ex1.rb +2 -2
  68. data/examples/permutation/permutation.rb +1 -1
  69. data/examples/poly/demo.rb +1 -1
  70. data/examples/random/diffusion.rb +1 -1
  71. data/examples/random/generator.rb +2 -2
  72. data/examples/random/randomwalk.rb +3 -3
  73. data/examples/random/rng.rb +1 -1
  74. data/examples/roots/bisection.rb +1 -1
  75. data/examples/roots/brent.rb +1 -1
  76. data/examples/roots/demo.rb +1 -1
  77. data/examples/roots/newton.rb +2 -2
  78. data/examples/roots/recombination.gp +0 -1
  79. data/examples/sf/hyperg.rb +1 -1
  80. data/examples/sf/sphbessel.rb +1 -1
  81. data/examples/sort/sort.rb +1 -1
  82. data/examples/tamu_anova.rb +4 -4
  83. data/examples/vector/add.rb +1 -1
  84. data/examples/vector/decimate.rb +1 -1
  85. data/examples/vector/gnuplot.rb +8 -8
  86. data/examples/vector/vector.rb +2 -2
  87. data/examples/wavelet/wavelet1.rb +1 -1
  88. data/ext/{gsl → gsl_native}/alf.c +9 -9
  89. data/ext/{gsl → gsl_native}/array.c +64 -151
  90. data/ext/{gsl → gsl_native}/array_complex.c +61 -63
  91. data/ext/{gsl → gsl_native}/blas.c +0 -0
  92. data/ext/{gsl → gsl_native}/blas1.c +32 -32
  93. data/ext/{gsl → gsl_native}/blas2.c +54 -58
  94. data/ext/{gsl → gsl_native}/blas3.c +54 -54
  95. data/ext/{gsl → gsl_native}/block.c +3 -6
  96. data/ext/{gsl/block_source.c → gsl_native/block_source.h} +109 -111
  97. data/ext/gsl_native/bspline.c +122 -0
  98. data/ext/{gsl → gsl_native}/bundle.c +0 -0
  99. data/ext/{gsl → gsl_native}/cdf.c +76 -88
  100. data/ext/{gsl → gsl_native}/cheb.c +74 -85
  101. data/ext/{gsl → gsl_native}/combination.c +9 -16
  102. data/ext/{gsl → gsl_native}/common.c +7 -37
  103. data/ext/{gsl → gsl_native}/complex.c +113 -115
  104. data/ext/gsl_native/const.c +331 -0
  105. data/ext/{gsl → gsl_native}/const_additional.c +12 -33
  106. data/ext/gsl_native/cqp.c +283 -0
  107. data/ext/{gsl → gsl_native}/deriv.c +22 -30
  108. data/ext/{gsl → gsl_native}/dht.c +20 -28
  109. data/ext/{gsl → gsl_native}/diff.c +23 -25
  110. data/ext/{gsl → gsl_native}/dirac.c +44 -45
  111. data/ext/{gsl → gsl_native}/eigen.c +1031 -1082
  112. data/ext/{gsl → gsl_native}/error.c +13 -13
  113. data/ext/{gsl → gsl_native}/extconf.rb +5 -13
  114. data/ext/{gsl → gsl_native}/fft.c +192 -198
  115. data/ext/{gsl → gsl_native}/fit.c +16 -16
  116. data/ext/gsl_native/fresnel.c +312 -0
  117. data/ext/{gsl → gsl_native}/function.c +29 -35
  118. data/ext/{gsl → gsl_native}/geometry.c +15 -15
  119. data/ext/{gsl → gsl_native}/graph.c +37 -87
  120. data/ext/{gsl → gsl_native}/gsl.c +10 -23
  121. data/ext/{gsl → gsl_native}/gsl_narray.c +15 -24
  122. data/ext/{gsl → gsl_native}/histogram.c +123 -150
  123. data/ext/{gsl → gsl_native}/histogram2d.c +71 -96
  124. data/ext/{gsl → gsl_native}/histogram3d.c +72 -72
  125. data/ext/{gsl → gsl_native}/histogram3d_source.c +195 -196
  126. data/ext/{gsl → gsl_native}/histogram_find.c +31 -33
  127. data/ext/{gsl → gsl_native}/histogram_oper.c +43 -52
  128. data/ext/{gsl → gsl_native}/ieee.c +7 -15
  129. data/ext/{gsl → gsl_native}/include/rb_gsl.h +0 -7
  130. data/ext/{gsl → gsl_native}/include/rb_gsl_array.h +15 -25
  131. data/ext/{gsl → gsl_native}/include/rb_gsl_cheb.h +0 -0
  132. data/ext/{gsl → gsl_native}/include/rb_gsl_common.h +44 -52
  133. data/ext/{gsl → gsl_native}/include/rb_gsl_complex.h +0 -0
  134. data/ext/{gsl → gsl_native}/include/rb_gsl_const.h +0 -5
  135. data/ext/{gsl → gsl_native}/include/rb_gsl_dirac.h +0 -0
  136. data/ext/{gsl → gsl_native}/include/rb_gsl_eigen.h +0 -0
  137. data/ext/{gsl → gsl_native}/include/rb_gsl_fft.h +0 -3
  138. data/ext/{gsl → gsl_native}/include/rb_gsl_fit.h +0 -0
  139. data/ext/{gsl → gsl_native}/include/rb_gsl_function.h +0 -0
  140. data/ext/{gsl → gsl_native}/include/rb_gsl_graph.h +2 -2
  141. data/ext/{gsl → gsl_native}/include/rb_gsl_histogram.h +8 -8
  142. data/ext/{gsl → gsl_native}/include/rb_gsl_histogram3d.h +50 -50
  143. data/ext/{gsl → gsl_native}/include/rb_gsl_integration.h +0 -0
  144. data/ext/{gsl → gsl_native}/include/rb_gsl_interp.h +0 -0
  145. data/ext/{gsl → gsl_native}/include/rb_gsl_linalg.h +0 -1
  146. data/ext/{gsl → gsl_native}/include/rb_gsl_math.h +0 -4
  147. data/ext/{gsl → gsl_native}/include/rb_gsl_odeiv.h +0 -0
  148. data/ext/{gsl → gsl_native}/include/rb_gsl_poly.h +3 -3
  149. data/ext/{gsl → gsl_native}/include/rb_gsl_rational.h +1 -1
  150. data/ext/{gsl → gsl_native}/include/rb_gsl_rng.h +0 -0
  151. data/ext/{gsl → gsl_native}/include/rb_gsl_root.h +0 -0
  152. data/ext/{gsl → gsl_native}/include/rb_gsl_sf.h +39 -43
  153. data/ext/{gsl → gsl_native}/include/rb_gsl_statistics.h +0 -0
  154. data/ext/{gsl → gsl_native}/include/rb_gsl_tensor.h +0 -0
  155. data/ext/{gsl → gsl_native}/include/rb_gsl_with_narray.h +0 -0
  156. data/ext/{gsl → gsl_native}/include/templates_off.h +0 -0
  157. data/ext/{gsl → gsl_native}/include/templates_on.h +1 -1
  158. data/ext/{gsl → gsl_native}/integration.c +160 -183
  159. data/ext/{gsl → gsl_native}/interp.c +23 -31
  160. data/ext/gsl_native/jacobi.c +733 -0
  161. data/ext/{gsl → gsl_native}/linalg.c +448 -576
  162. data/ext/{gsl → gsl_native}/linalg_complex.c +84 -98
  163. data/ext/{gsl → gsl_native}/math.c +45 -63
  164. data/ext/{gsl → gsl_native}/matrix.c +4 -6
  165. data/ext/{gsl → gsl_native}/matrix_complex.c +111 -114
  166. data/ext/{gsl → gsl_native}/matrix_double.c +74 -77
  167. data/ext/{gsl → gsl_native}/matrix_int.c +49 -50
  168. data/ext/{gsl/matrix_source.c → gsl_native/matrix_source.h} +280 -302
  169. data/ext/{gsl → gsl_native}/min.c +43 -74
  170. data/ext/{gsl → gsl_native}/monte.c +45 -59
  171. data/ext/{gsl → gsl_native}/multifit.c +138 -147
  172. data/ext/{gsl → gsl_native}/multimin.c +55 -83
  173. data/ext/{gsl → gsl_native}/multimin_fsdf.c +15 -15
  174. data/ext/{gsl → gsl_native}/multiroots.c +61 -64
  175. data/ext/{gsl → gsl_native}/multiset.c +3 -7
  176. data/ext/{gsl → gsl_native}/ndlinear.c +320 -321
  177. data/ext/{gsl → gsl_native}/nmf.c +11 -11
  178. data/ext/{gsl → gsl_native}/nmf_wrap.c +1 -1
  179. data/ext/{gsl → gsl_native}/ntuple.c +13 -13
  180. data/ext/{gsl → gsl_native}/odeiv.c +95 -106
  181. data/ext/gsl_native/ool.c +879 -0
  182. data/ext/{gsl → gsl_native}/permutation.c +36 -34
  183. data/ext/{gsl → gsl_native}/poly.c +2 -5
  184. data/ext/{gsl → gsl_native}/poly2.c +6 -6
  185. data/ext/{gsl/poly_source.c → gsl_native/poly_source.h} +232 -275
  186. data/ext/{gsl → gsl_native}/qrng.c +6 -17
  187. data/ext/{gsl → gsl_native}/randist.c +218 -243
  188. data/ext/{gsl → gsl_native}/rational.c +9 -9
  189. data/ext/{gsl → gsl_native}/rng.c +29 -45
  190. data/ext/{gsl → gsl_native}/root.c +43 -43
  191. data/ext/{gsl → gsl_native}/sf.c +163 -197
  192. data/ext/{gsl → gsl_native}/sf_airy.c +0 -0
  193. data/ext/{gsl → gsl_native}/sf_bessel.c +6 -6
  194. data/ext/{gsl → gsl_native}/sf_clausen.c +0 -0
  195. data/ext/{gsl → gsl_native}/sf_coulomb.c +39 -39
  196. data/ext/{gsl → gsl_native}/sf_coupling.c +29 -29
  197. data/ext/{gsl → gsl_native}/sf_dawson.c +0 -0
  198. data/ext/{gsl → gsl_native}/sf_debye.c +0 -9
  199. data/ext/{gsl → gsl_native}/sf_dilog.c +0 -0
  200. data/ext/{gsl → gsl_native}/sf_elementary.c +2 -2
  201. data/ext/{gsl → gsl_native}/sf_ellint.c +42 -42
  202. data/ext/{gsl → gsl_native}/sf_elljac.c +2 -2
  203. data/ext/{gsl → gsl_native}/sf_erfc.c +0 -4
  204. data/ext/{gsl → gsl_native}/sf_exp.c +2 -2
  205. data/ext/{gsl → gsl_native}/sf_expint.c +1 -11
  206. data/ext/{gsl → gsl_native}/sf_fermi_dirac.c +0 -0
  207. data/ext/{gsl → gsl_native}/sf_gamma.c +1 -5
  208. data/ext/{gsl → gsl_native}/sf_gegenbauer.c +0 -0
  209. data/ext/{gsl → gsl_native}/sf_hyperg.c +0 -0
  210. data/ext/{gsl → gsl_native}/sf_laguerre.c +3 -3
  211. data/ext/{gsl → gsl_native}/sf_lambert.c +0 -0
  212. data/ext/{gsl → gsl_native}/sf_legendre.c +0 -0
  213. data/ext/{gsl → gsl_native}/sf_log.c +3 -3
  214. data/ext/gsl_native/sf_mathieu.c +235 -0
  215. data/ext/{gsl → gsl_native}/sf_power.c +0 -0
  216. data/ext/{gsl → gsl_native}/sf_psi.c +2 -11
  217. data/ext/{gsl → gsl_native}/sf_synchrotron.c +0 -0
  218. data/ext/{gsl → gsl_native}/sf_transport.c +0 -0
  219. data/ext/{gsl → gsl_native}/sf_trigonometric.c +3 -3
  220. data/ext/{gsl → gsl_native}/sf_zeta.c +0 -4
  221. data/ext/{gsl → gsl_native}/signal.c +60 -64
  222. data/ext/{gsl → gsl_native}/siman.c +36 -40
  223. data/ext/{gsl → gsl_native}/sort.c +3 -4
  224. data/ext/{gsl → gsl_native}/spline.c +25 -43
  225. data/ext/{gsl → gsl_native}/stats.c +102 -115
  226. data/ext/{gsl → gsl_native}/sum.c +32 -32
  227. data/ext/{gsl → gsl_native}/tamu_anova.c +0 -0
  228. data/ext/{gsl → gsl_native}/tensor.c +2 -4
  229. data/ext/{gsl/tensor_source.c → gsl_native/tensor_source.h} +144 -144
  230. data/ext/{gsl → gsl_native}/vector.c +2 -4
  231. data/ext/{gsl → gsl_native}/vector_complex.c +165 -171
  232. data/ext/{gsl → gsl_native}/vector_double.c +167 -174
  233. data/ext/{gsl → gsl_native}/vector_int.c +23 -25
  234. data/ext/{gsl/vector_source.c → gsl_native/vector_source.h} +400 -414
  235. data/ext/{gsl → gsl_native}/wavelet.c +215 -236
  236. data/lib/gsl.rb +1 -7
  237. data/lib/gsl/gnuplot.rb +2 -2
  238. data/lib/gsl/version.rb +1 -3
  239. data/rb-gsl.gemspec +29 -0
  240. data/rdoc/blas.rdoc +3 -3
  241. data/rdoc/bspline.rdoc +7 -7
  242. data/rdoc/cheb.rdoc +8 -8
  243. data/rdoc/cholesky_complex.rdoc +1 -1
  244. data/rdoc/combi.rdoc +9 -9
  245. data/rdoc/complex.rdoc +11 -11
  246. data/rdoc/const.rdoc +20 -20
  247. data/rdoc/dht.rdoc +6 -6
  248. data/rdoc/diff.rdoc +6 -6
  249. data/rdoc/ehandling.rdoc +3 -3
  250. data/rdoc/eigen.rdoc +11 -11
  251. data/rdoc/fft.rdoc +26 -26
  252. data/rdoc/fit.rdoc +18 -18
  253. data/rdoc/graph.rdoc +2 -2
  254. data/rdoc/hist.rdoc +16 -16
  255. data/rdoc/hist2d.rdoc +4 -4
  256. data/rdoc/hist3d.rdoc +3 -3
  257. data/rdoc/integration.rdoc +16 -16
  258. data/rdoc/interp.rdoc +11 -11
  259. data/rdoc/intro.rdoc +3 -3
  260. data/rdoc/linalg.rdoc +20 -20
  261. data/rdoc/linalg_complex.rdoc +1 -1
  262. data/rdoc/math.rdoc +13 -13
  263. data/rdoc/matrix.rdoc +22 -22
  264. data/rdoc/min.rdoc +9 -9
  265. data/rdoc/monte.rdoc +3 -3
  266. data/rdoc/multimin.rdoc +12 -12
  267. data/rdoc/multiroot.rdoc +12 -12
  268. data/rdoc/narray.rdoc +9 -9
  269. data/rdoc/ndlinear.rdoc +4 -4
  270. data/rdoc/nonlinearfit.rdoc +17 -17
  271. data/rdoc/ntuple.rdoc +5 -5
  272. data/rdoc/odeiv.rdoc +12 -12
  273. data/rdoc/perm.rdoc +11 -11
  274. data/rdoc/poly.rdoc +17 -17
  275. data/rdoc/qrng.rdoc +9 -9
  276. data/rdoc/randist.rdoc +10 -10
  277. data/rdoc/ref.rdoc +49 -49
  278. data/rdoc/rng.rdoc +9 -9
  279. data/rdoc/roots.rdoc +12 -12
  280. data/rdoc/sf.rdoc +35 -35
  281. data/rdoc/siman.rdoc +3 -3
  282. data/rdoc/sort.rdoc +6 -6
  283. data/rdoc/start.rdoc +2 -2
  284. data/rdoc/stats.rdoc +13 -13
  285. data/rdoc/sum.rdoc +4 -4
  286. data/rdoc/tensor.rdoc +3 -3
  287. data/rdoc/tut.rdoc +1 -1
  288. data/rdoc/use.rdoc +3 -3
  289. data/rdoc/vector.rdoc +28 -28
  290. data/rdoc/vector_complex.rdoc +6 -6
  291. data/rdoc/wavelet.rdoc +8 -8
  292. data/test/gsl/blas_test.rb +1 -1
  293. data/test/gsl/index_test.rb +61 -0
  294. data/test/gsl/matrix_test.rb +21 -0
  295. data/uncrustify.cfg +1693 -0
  296. metadata +212 -243
  297. data/README +0 -28
  298. data/ext/gsl/bspline.c +0 -130
  299. data/ext/gsl/const.c +0 -672
  300. data/ext/gsl/cqp.c +0 -283
  301. data/ext/gsl/fcmp.c +0 -64
  302. data/ext/gsl/fresnel.c +0 -312
  303. data/ext/gsl/jacobi.c +0 -739
  304. data/ext/gsl/ool.c +0 -879
  305. data/ext/gsl/oper_complex_source.c +0 -251
  306. data/ext/gsl/sf_mathieu.c +0 -238
  307. data/rdoc/index.rdoc +0 -50
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+ gemspec
3
+
4
+ gem 'narray' if ENV['NARRAY']
@@ -0,0 +1,77 @@
1
+ # Ruby/GSL, a Ruby interface to GSL (GNU Scientific library)
2
+
3
+ Permission is granted to copy, distribute and/or modify this document under
4
+ the terms of the GNU Free Documentation License.
5
+
6
+ ## Description
7
+
8
+ Ruby/GSL is a Ruby interface to the [GNU Scientific Library](https://gnu.org/software/gsl/)
9
+ (GSL), for numerical computing with [Ruby](http://www.ruby-lang.org/).
10
+
11
+
12
+ ## Installation
13
+
14
+ Ruby/GSL may be installed as a Ruby Gem by simply running
15
+
16
+ gem install rb-gsl
17
+
18
+ Note that the GSL libraries must already be installed before Ruby/GSL
19
+ can be installed:
20
+
21
+ Debian/Ubuntu: +libgsl0-dev+
22
+ Fedora/SuSE: +gsl-devel+
23
+ Gentoo: +sci-libs/gsl+
24
+ OS X: <tt>brew install gsl</tt>
25
+
26
+ It is recommended to install the [GNU plotutils](https://gnu.org/software/plotutils/plotutils.html)
27
+ package. Some of the example scripts in the +examples/+ directory use the
28
+ +graph+ utility included in the package to plot the results. Windows cygwin
29
+ binaries of <tt>GNU plotutils</tt> and related packages are available
30
+ [here](http://gnuwin32.sourceforge.net/packages/plotutils.htm).
31
+
32
+
33
+ ## Reference
34
+
35
+ The [Ruby/GSL reference manual](link:rdoc/ref_rdoc.html) follows and borrows
36
+ large parts of the GSL reference manual.
37
+
38
+
39
+ ## Examples
40
+
41
+ See scripts in +examples/+ and +test/+ directories.
42
+
43
+
44
+ ## Related Projects
45
+
46
+ * [ruby-gsl](http://ruby-gsl.sourceforge.net/): Another Ruby binding,
47
+ developed by Arno Erpenbeck.
48
+
49
+
50
+ ## Licence
51
+
52
+ Ruby/GSL is free software: you can redistribute it and/or modify it
53
+ under the terms of the GNU General Public License.
54
+ This library is distributed in the hope that it will be useful, but
55
+ WITHOUT ANY WARRANTY.
56
+
57
+
58
+ ## Bug Reports
59
+
60
+ Any bug reports are welcome. If you encounter bugs in Ruby/GSL, please
61
+ report them on GitHub(https://github.com/SciRuby/rb-gsl/issues).
62
+
63
+
64
+ ## Links
65
+
66
+ Documentation: https://sciruby.github.com/rb-gsl
67
+ Source code: https://github.com/SciRuby/rb-gsl
68
+ RubyGem: https://rubygems.org/gems/rb-gsl
69
+ Bug tracker: https://github.com/SciRuby/rb-gsl/issues
70
+ Travis CI: https://travis-ci.org/SciRuby/rb-gsl
71
+
72
+
73
+ ## Authors
74
+
75
+ * Yoshiki Tsunesada <y-tsunesada at mm dot em-net dot ne dot jp> (July, 2004)
76
+ * David MacMahon <davidm@astro.berkeley.edu> (November, 2010)
77
+ * Jens Wille <mailto:jens.wille@gmail.com> (November, 2013)
data/Rakefile CHANGED
@@ -1,39 +1,20 @@
1
1
  require File.expand_path(%q{../lib/gsl/version}, __FILE__)
2
2
 
3
- begin
4
- require 'hen'
3
+ require 'bundler/setup'
4
+ require 'rubygems/package_task'
5
+ require 'rake/extensiontask'
6
+ require 'rake/testtask'
5
7
 
6
- note = '[Ruby 2.x and GSL 1.16 compatible fork]'
8
+ Bundler::GemHelper.install_tasks
7
9
 
8
- Hen.lay! {{
9
- :gem => {
10
- :name => %q{rb-gsl},
11
- :version => GSL::RB_GSL_VERSION,
12
- :summary => %Q{Ruby interface to the GNU Scientific Library #{note}},
13
- :description => %Q{Ruby/GSL is a Ruby interface to the GNU Scientific Library, for numerical computing with Ruby #{note}},
14
- :authors => ['Yoshiki Tsunesada', 'David MacMahon', 'Jens Wille'],
15
- :email => %q{jens.wille@gmail.com},
16
- :license => %q{GPL-2.0},
17
- :homepage => :blackwinter,
18
- :dependencies => [['narray', '>= 0.5.9']],
19
- :requirements => ['GSL (http://www.gnu.org/software/gsl/)'],
20
-
21
- :extra_files => FileList['examples/**/*', 'rdoc/*'].to_a,
10
+ Rake::TestTask.new do |t|
11
+ t.libs << 'test'
12
+ t.libs << 'test/gsl'
13
+ t.test_files = FileList['test/*.rb', 'test/gsl/*.rb']
14
+ end
22
15
 
23
- :extension => { :cross_compile => false },
16
+ spec = eval(IO.read('rb-gsl.gemspec'))
17
+ Gem::PackageTask.new(spec).define
18
+ Rake::ExtensionTask.new(:gsl_native, spec)
24
19
 
25
- :required_ruby_version => '>= 1.8.7'
26
- },
27
- :rdoc => {
28
- :title => 'Ruby/GSL{version: (v%s)}',
29
- :rdoc_files => FileList['rdoc/*'].to_a,
30
- :main => 'index.rdoc',
31
- :root => 'rdoc'
32
- },
33
- :test => {
34
- :libs => %w[lib test]
35
- }
36
- }}
37
- rescue LoadError => err
38
- warn "Please install the `hen' gem. (#{err})"
39
- end
20
+ task :default => [:compile, :test]
data/THANKS CHANGED
@@ -1,5 +1,5 @@
1
1
  Takeshi Horinouchi
2
- Masahide Kikkawa
2
+ Masahide Kikkawa
3
3
  Seiya Nishizawa (Patches, NArray supports)
4
4
  Arno Erpenbeck (ruby-gsl project)
5
5
  Austin Newton
@@ -10,4 +10,4 @@ B = b.matrix_view(3, 2)
10
10
  C = GSL::Blas.dgemm(GSL::Blas::NoTrans, GSL::Blas::NoTrans, 1.0, A, B, 0.0)
11
11
  p C
12
12
 
13
- p A*B
13
+ p A*B
@@ -19,15 +19,15 @@ w = GSL::Vector.alloc(N)
19
19
  for i in 0...N do
20
20
  xi = (15.0/(N-1)/1)*i
21
21
  yi = Math::cos(xi)*Math::exp(-0.1*xi)
22
-
22
+
23
23
  sigma = 0.1
24
24
  dy = GSL::Ran.gaussian(r, sigma)
25
25
  yi += dy
26
-
26
+
27
27
  x[i] = xi
28
28
  y[i] = yi
29
29
  w[i] = sigma
30
-
30
+
31
31
  # printf("%f %f\n", xi, yi)
32
32
  end
33
33
 
@@ -26,8 +26,8 @@ p f.log == z
26
26
  p z.pow(f) # [1.931e-02 1.752e-02], verified with Octave result
27
27
 
28
28
  # The results below are verified with the Octave results
29
- p GSL::Complex.sin(z)
30
- p GSL::Complex.cos(z)
29
+ p GSL::Complex.sin(z)
30
+ p GSL::Complex.cos(z)
31
31
  p GSL::Complex.tan(z)
32
32
  p GSL::Complex.sec(z)
33
33
  p GSL::Complex.csc(z)
@@ -43,8 +43,8 @@ p GSL::Complex.arccsc(z)
43
43
  p GSL::Complex.arccsc_real(2)
44
44
  p GSL::Complex.arccot(z)
45
45
 
46
- p GSL::Complex.sinh(z)
47
- p GSL::Complex.cosh(z)
46
+ p GSL::Complex.sinh(z)
47
+ p GSL::Complex.cosh(z)
48
48
  p GSL::Complex.tanh(z)
49
49
  p GSL::Complex.sech(z)
50
50
  p GSL::Complex.csch(z)
@@ -3,7 +3,7 @@ require 'gsl'
3
3
 
4
4
  a = GSL::Complex.rect(1, 2)
5
5
  b = GSL::Complex[3, 4]
6
-
6
+
7
7
  p a*b # -5 + 10i
8
8
  p a.mul(b)
9
9
  p a
@@ -42,7 +42,7 @@ MENU[2] = ["", "ASTRONOMICAL_UNIT", "GRAVITATIONAL_CONSTANT",
42
42
  MENU[3] = ["", "ELECTRON_CHARGE", "ELECTRON_VOLT", "UNIFIED_ATOMIC_MASS",
43
43
  "MASS_ELECTRON", "MASS_MUON", "MASS_PROTON", "MASS_NEUTRON",
44
44
  "FINE_STRUCTURE", "RYDBERG", "BOHR_RADIUS", "ANGSTROM",
45
- "BARN", "BOHR_MAGNETON", "NUCLEAR_MAGNETON",
45
+ "BARN", "BOHR_MAGNETON", "NUCLEAR_MAGNETON",
46
46
  "ELECTRON_MAGNETIC_MOMENT", "PROTON_MAGNETIC_MOMENT",
47
47
  "THOMSON_CROSS_SECTION"]
48
48
 
@@ -56,10 +56,10 @@ MENU[9] = ["", "POUND_MASS", "OUNCE_MASS", "TON", "METRIC_TON", "UK_TON",
56
56
  "TROY_OUNCE", "CARAT", "GRAM_FORCE", "POUND_FORCE",
57
57
  "KILOPOUND_FORCE", "POUNDAL"]
58
58
  MENU[10] = ["", "CALORIE", "BTU", "THERM", "HORSEPOWER"]
59
- MENU[11] = ["", "BAR", "STD_ATMOSPHERE", "TORR", "METER_OF_MERCURY",
59
+ MENU[11] = ["", "BAR", "STD_ATMOSPHERE", "TORR", "METER_OF_MERCURY",
60
60
  "INCH_OF_MERCURY", "INCH_OF_WATER", "PSI"]
61
61
  MENU[12] = ["", "POISE", "STOKES"]
62
- MENU[13] = ["", "STILB", "LUMEN", "LUX", "PHOT", "FOOTCANDLE",
62
+ MENU[13] = ["", "STILB", "LUMEN", "LUX", "PHOT", "FOOTCANDLE",
63
63
  "LAMBERT", "FOOTLAMBERT"]
64
64
  MENU[14] = ["", "CURIE", "ROENTGEN", "RAD"]
65
65
  MENU[15] = ["", "NEWTON", "DYNE", "JOULE", "ERG"]
@@ -96,7 +96,7 @@ def show_submenu(ind, w)
96
96
  w.setpos(i+=1, 1)
97
97
  str = " ? ['m' to menu]: "
98
98
  w.addstr(str)
99
- w.setpos(i, str.size+1)
99
+ w.setpos(i, str.size+1)
100
100
  w.box('|', '-')
101
101
  w.refresh
102
102
  end
@@ -8,8 +8,8 @@ c = SPEED_OF_LIGHT;
8
8
  au = ASTRONOMICAL_UNIT;
9
9
  minutes = MINUTE;
10
10
 
11
- # distance stored in meters
12
- r_earth = 1.00 * au;
11
+ # distance stored in meters
12
+ r_earth = 1.00 * au;
13
13
  r_mars = 1.52 * au;
14
14
 
15
15
  t_min = (r_mars - r_earth) / c;
@@ -30,8 +30,8 @@ c = SPEED_OF_LIGHT;
30
30
  au = ASTRONOMICAL_UNIT;
31
31
  minutes = MINUTE;
32
32
 
33
- # distance stored in meters
34
- r_earth = 1.00 * au;
33
+ # distance stored in meters
34
+ r_earth = 1.00 * au;
35
35
  r_mars = 1.52 * au;
36
36
 
37
37
  t_min = (r_mars - r_earth) / c;
@@ -13,7 +13,7 @@ p eval
13
13
  p evec
14
14
 
15
15
  =begin
16
- This can be compared with the corresponding output from GNU OCTAVE,
16
+ This can be compared with the corresponding output from GNU OCTAVE,
17
17
 
18
18
  octave> [v,d] = eig(vander([-1 -2 3 4]));
19
19
  octave> diag(d)
@@ -61,13 +61,13 @@ end
61
61
  # The differences with Tabelle 5.1 are from NMAX and dx.
62
62
  # If we use NMAX=512 and dx=0.02, we obtain the same results (but much slower).
63
63
  STDERR.puts(" Eigen values:")
64
- STDERR.printf(" %2s Exact %5s %10s | %2s Exact %5s %10s\n",
64
+ STDERR.printf(" %2s Exact %5s %10s | %2s Exact %5s %10s\n",
65
65
  "n", "E", "err\(\%\)", "n", "E", "err\(\%\)")
66
66
  STDERR.print(" -----------------------------------------------------\n")
67
67
  for n1 in 0..6 do
68
68
  exact1 = n1 + 0.5
69
69
  exact2 = n1 + 7 + 0.5
70
- STDERR.printf(" %2d %4.1f %8.5f %+7.5f | %2d %4.1f %8.5f %+7.5f\n",
70
+ STDERR.printf(" %2d %4.1f %8.5f %+7.5f | %2d %4.1f %8.5f %+7.5f\n",
71
71
  n1, exact1, eval[n1], (exact1 - eval[n1])/exact1*100,
72
72
  n1+7, exact2, eval[n1+7], (exact2-eval[n1+7])/exact2*100)
73
73
  end
@@ -75,7 +75,7 @@ STDERR.flush
75
75
 
76
76
  # Eigen vectors of n = 0, 1, 2, 10. See p217 "Abb 5.3"
77
77
  c = Math::sqrt(1.0/dx)
78
- vec0 = evec.col(0).scale(c)
78
+ vec0 = evec.col(0).scale(c)
79
79
  vec1 = evec.col(1).scale(c)
80
80
  vec2 = evec.col(2).scale(c)
81
81
  vec10 = evec.col(10).scale(c)
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
- require("gsl")
2
+ require("gsl")
3
3
 
4
4
  n = 128
5
5
  data = GSL::Vector::Complex.alloc(n)
@@ -11,7 +11,7 @@ end
11
11
 
12
12
  rtable = GSL::FFT::RealWavetable.alloc(n)
13
13
  rwork = GSL::FFT::RealWorkspace.alloc(n)
14
-
14
+
15
15
  #ffted = data.real_transform(rtable, rwork)
16
16
  #ffted = data.real_transform(rtable)
17
17
  #ffted = data.real_transform(rwork)
@@ -22,9 +22,9 @@ ffted = data.real_transform()
22
22
  for i in 11...n do
23
23
  ffted[i] = 0.0
24
24
  end
25
-
25
+
26
26
  hctable = GSL::FFT::HalfComplexWavetable.alloc(n)
27
-
27
+
28
28
  #data2 = ffted.halfcomplex_inverse(hctable, rwork)
29
29
  #data2 = ffted.halfcomplex_inverse()
30
30
  #data2 = ffted.ifft
@@ -12,15 +12,15 @@ org = data.clone
12
12
 
13
13
  rtable = GSL::FFT::RealWavetable.alloc(n)
14
14
  rwork = GSL::FFT::RealWorkspace.alloc(n)
15
-
15
+
16
16
  data.real_transform!(rtable, rwork)
17
17
 
18
18
  for i in 11...n do
19
19
  data[i] = 0.0
20
20
  end
21
-
21
+
22
22
  hctable = GSL::FFT::HalfComplexWavetable.alloc(n)
23
-
23
+
24
24
  #data.halfcomplex_inverse!(hctable, rwork)
25
25
  #data.halfcomplex_inverse!()
26
26
  #data.ifft!
@@ -22,7 +22,7 @@ p err
22
22
  GSL::graph(x, y, y0+amp*GSL::Sf::exp(-b*x))
23
23
 
24
24
  # This will result in
25
- # [ 1.019e+00 5.045e+00 1.040e-01 ]
25
+ # [ 1.019e+00 5.045e+00 1.040e-01 ]
26
26
  # [ 3.385e-02 5.395e-02 2.826e-03 ]
27
27
 
28
28
  # GNUPLOT results:
@@ -2,7 +2,7 @@
2
2
  require("gsl")
3
3
 
4
4
  GSL::Rng.env_setup()
5
-
5
+
6
6
  r = GSL::Rng.alloc(GSL::Rng::DEFAULT)
7
7
 
8
8
  n = 19
@@ -2,8 +2,8 @@
2
2
  require("gsl")
3
3
 
4
4
  unless GSL::MultiFit.const_defined?("Ndlinear")
5
- puts("The extension library NDLINEAR is not installed.")
6
- exit()
5
+ puts("The extension library NDLINEAR is not installed.")
6
+ exit()
7
7
  end
8
8
 
9
9
  N_DIM = 3
@@ -13,33 +13,33 @@ N_SUM_PHI = 9
13
13
  R_MAX = 3.0
14
14
 
15
15
  def psi_real_exact(k, l, m, r, theta, phi)
16
- rr = GSL::pow(r, l)*Math::exp(-r*r)*GSL::Sf::laguerre_n(k, l + 0.5, 2 * r * r)
16
+ rr = GSL::pow(r, l)*Math::exp(-r*r)*GSL::Sf::laguerre_n(k, l + 0.5, 2 * r * r)
17
17
 
18
- tt = GSL::Sf::legendre_sphPlm(l, m, Math::cos(theta))
18
+ tt = GSL::Sf::legendre_sphPlm(l, m, Math::cos(theta))
19
19
 
20
- pp = Math::cos(m*phi)
20
+ pp = Math::cos(m*phi)
21
21
 
22
- rr*tt*pp
22
+ rr*tt*pp
23
23
  end
24
24
 
25
25
  basis_r = Proc.new { |r, y, params|
26
- params.eval(r, y)
26
+ params.eval(r, y)
27
27
  }
28
28
 
29
29
  basis_theta = Proc.new { |theta, y, params|
30
- for i in 0...N_SUM_THETA do
31
- y[i] = GSL::Sf::legendre_Pl(i, Math::cos(theta));
32
- end
30
+ for i in 0...N_SUM_THETA do
31
+ y[i] = GSL::Sf::legendre_Pl(i, Math::cos(theta));
32
+ end
33
33
  }
34
34
 
35
35
  basis_phi = Proc.new { |phi, y, params|
36
- for i in 0...N_SUM_PHI do
37
- if i%2 == 0
38
- y[i] = Math::cos(i*0.5*phi)
39
- else
40
- y[i] = Math::sin((i+1.0)*0.5*phi)
41
- end
42
- end
36
+ for i in 0...N_SUM_PHI do
37
+ if i%2 == 0
38
+ y[i] = Math::cos(i*0.5*phi)
39
+ else
40
+ y[i] = Math::sin((i+1.0)*0.5*phi)
41
+ end
42
+ end
43
43
  }
44
44
 
45
45
 
@@ -67,19 +67,19 @@ data = GSL::Vector.alloc(NDATA)
67
67
 
68
68
  for i in 0...NDATA do
69
69
 
70
- r = rng.uniform()*R_MAX
71
- theta = rng.uniform()*Math::PI
72
- phi = rng.uniform()*2*Math::PI
70
+ r = rng.uniform()*R_MAX
71
+ theta = rng.uniform()*Math::PI
72
+ phi = rng.uniform()*2*Math::PI
73
73
 
74
- psi = psi_real_exact(k, l, m, r, theta, phi)
74
+ psi = psi_real_exact(k, l, m, r, theta, phi)
75
75
 
76
- dpsi = rng.gaussian(0.05*psi)
76
+ dpsi = rng.gaussian(0.05*psi)
77
77
 
78
- vars[i,0] = r
79
- vars[i,1] = theta
80
- vars[i,2] = phi
78
+ vars[i,0] = r
79
+ vars[i,1] = theta
80
+ vars[i,2] = phi
81
81
 
82
- data[i] = psi + dpsi
82
+ data[i] = psi + dpsi
83
83
  end
84
84
 
85
85
  #GSL::MultiFit::Ndlinear::design(vars, X, ndlinear)
@@ -99,18 +99,18 @@ x = GSL::Vector.alloc(N_DIM)
99
99
 
100
100
  r = 0.01
101
101
  while r < R_MAX do
102
- theta = 0.0
103
- while theta < Math::PI do
104
- phi = 0.0
105
- while phi < 2*Math::PI do
106
- dV = r*r*Math::sin(theta)*dr*dtheta*dphi
107
- x[0] = r
108
- x[1] = theta
109
- x[2] = phi
110
-
111
- psi_model, err = GSL::MultiFit::Ndlinear.calc(x, coeffs, cov, ndlinear)
112
- psi = psi_real_exact(k, l, m, r, theta, phi)
113
- err = psi_model - psi
102
+ theta = 0.0
103
+ while theta < Math::PI do
104
+ phi = 0.0
105
+ while phi < 2*Math::PI do
106
+ dV = r*r*Math::sin(theta)*dr*dtheta*dphi
107
+ x[0] = r
108
+ x[1] = theta
109
+ x[2] = phi
110
+
111
+ psi_model, err = GSL::MultiFit::Ndlinear.calc(x, coeffs, cov, ndlinear)
112
+ psi = psi_real_exact(k, l, m, r, theta, phi)
113
+ err = psi_model - psi
114
114
  eps_rms += err * err * dV;
115
115
  volume += dV;
116
116
 
@@ -118,13 +118,13 @@ while r < R_MAX do
118
118
  printf("%e %e %e %e\n", r, theta, psi, psi_model)
119
119
  end
120
120
 
121
- phi += dphi
122
- end
123
- theta += dtheta
124
- end
125
- printf("\n");
121
+ phi += dphi
122
+ end
123
+ theta += dtheta
124
+ end
125
+ printf("\n");
126
126
 
127
- r += dr
127
+ r += dr
128
128
  end
129
129
 
130
130
  eps_rms /= volume