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
@@ -2,7 +2,7 @@
2
2
  matrix_double.c
3
3
  Ruby/GSL: Ruby extension library for GSL (GNU Scientific Library)
4
4
  (C) Copyright 2001-2006 by Yoshiki Tsunesada
5
-
5
+
6
6
  Ruby/GSL is free software: you can redistribute it and/or modify it
7
7
  under the terms of the GNU General Public License.
8
8
  This library is distributed in the hope that it will be useful, but
@@ -11,9 +11,7 @@
11
11
 
12
12
  #include "include/rb_gsl_array.h"
13
13
  #include "include/rb_gsl_complex.h"
14
- #ifdef HAVE_NARRAY_H
15
14
  #include "include/rb_gsl_with_narray.h"
16
- #endif
17
15
 
18
16
  enum {
19
17
  GSL_MATRIX_ADD,
@@ -62,29 +60,28 @@ static VALUE rb_gsl_matrix_arithmetics(int flag, VALUE obj, VALUE bb)
62
60
  default:
63
61
  if (MATRIX_INT_P(bb)) bb = rb_gsl_matrix_int_to_f(bb);
64
62
  if (VECTOR_INT_P(bb)) bb = rb_gsl_vector_int_to_f(bb);
65
-
66
63
  if (rb_obj_is_kind_of(bb, cgsl_matrix)) {
67
64
  Data_Get_Struct(bb, gsl_matrix, mb);
68
65
  switch (flag) {
69
66
  case GSL_MATRIX_ADD:
70
- mnew = make_matrix_clone(m);
71
- gsl_matrix_add(mnew, mb);
72
- break;
67
+ mnew = make_matrix_clone(m);
68
+ gsl_matrix_add(mnew, mb);
69
+ break;
73
70
  case GSL_MATRIX_SUB:
74
- mnew = make_matrix_clone(m);
75
- gsl_matrix_sub(mnew,mb);
76
- break;
71
+ mnew = make_matrix_clone(m);
72
+ gsl_matrix_sub(mnew,mb);
73
+ break;
77
74
  case GSL_MATRIX_MUL:
78
- mnew = make_matrix_clone(m);
79
- gsl_matrix_mul_elements(mnew, mb);
80
- break;
75
+ mnew = make_matrix_clone(m);
76
+ gsl_matrix_mul_elements(mnew, mb);
77
+ break;
81
78
  case GSL_MATRIX_DIV:
82
- mnew = make_matrix_clone(m);
83
- gsl_matrix_div_elements(mnew, mb);
84
- break;
79
+ mnew = make_matrix_clone(m);
80
+ gsl_matrix_div_elements(mnew, mb);
81
+ break;
85
82
  default:
86
- rb_raise(rb_eRuntimeError, "operation not defined");
87
- break;
83
+ rb_raise(rb_eRuntimeError, "operation not defined");
84
+ break;
88
85
  }
89
86
  return Data_Wrap_Struct(cgsl_matrix, 0, gsl_matrix_free, mnew);
90
87
  } else if (rb_obj_is_kind_of(bb, cgsl_matrix_complex)) {
@@ -92,20 +89,20 @@ static VALUE rb_gsl_matrix_arithmetics(int flag, VALUE obj, VALUE bb)
92
89
  cmnew = matrix_to_complex(m);
93
90
  switch (flag) {
94
91
  case GSL_MATRIX_ADD:
95
- gsl_matrix_complex_add(cmnew, cmb);
96
- break;
92
+ gsl_matrix_complex_add(cmnew, cmb);
93
+ break;
97
94
  case GSL_MATRIX_SUB:
98
- gsl_matrix_complex_sub(cmnew,cmb);
99
- break;
95
+ gsl_matrix_complex_sub(cmnew,cmb);
96
+ break;
100
97
  case GSL_MATRIX_MUL:
101
- gsl_matrix_complex_mul_elements(cmnew, cmb);
102
- break;
98
+ gsl_matrix_complex_mul_elements(cmnew, cmb);
99
+ break;
103
100
  case GSL_MATRIX_DIV:
104
- gsl_matrix_complex_div_elements(cmnew, cmb);
105
- break;
101
+ gsl_matrix_complex_div_elements(cmnew, cmb);
102
+ break;
106
103
  default:
107
- rb_raise(rb_eRuntimeError, "operation not defined");
108
- break;
104
+ rb_raise(rb_eRuntimeError, "operation not defined");
105
+ break;
109
106
  }
110
107
  return Data_Wrap_Struct(cgsl_matrix_complex, 0, gsl_matrix_complex_free, cmnew);
111
108
  } else if (rb_obj_is_kind_of(bb, cgsl_complex)) {
@@ -113,60 +110,60 @@ static VALUE rb_gsl_matrix_arithmetics(int flag, VALUE obj, VALUE bb)
113
110
  cmnew = matrix_to_complex(m);
114
111
  switch (flag) {
115
112
  case GSL_MATRIX_ADD:
116
- gsl_matrix_complex_add_constant(cmnew, *c);
117
- break;
113
+ gsl_matrix_complex_add_constant(cmnew, *c);
114
+ break;
118
115
  case GSL_MATRIX_SUB:
119
- gsl_matrix_complex_add_constant(cmnew, gsl_complex_negative(*c));
120
- break;
116
+ gsl_matrix_complex_add_constant(cmnew, gsl_complex_negative(*c));
117
+ break;
121
118
  case GSL_MATRIX_MUL:
122
- gsl_matrix_complex_scale(cmnew, *c);
123
- break;
119
+ gsl_matrix_complex_scale(cmnew, *c);
120
+ break;
124
121
  case GSL_MATRIX_DIV:
125
- gsl_matrix_complex_scale(cmnew, gsl_complex_inverse(*c));
126
- break;
122
+ gsl_matrix_complex_scale(cmnew, gsl_complex_inverse(*c));
123
+ break;
127
124
  default:
128
- rb_raise(rb_eRuntimeError, "operation not defined");
129
- break;
125
+ rb_raise(rb_eRuntimeError, "operation not defined");
126
+ break;
130
127
  }
131
128
  return Data_Wrap_Struct(cgsl_matrix_complex, 0, gsl_matrix_complex_free, cmnew);
132
129
  } else if (rb_obj_is_kind_of(bb, cgsl_vector)) {
133
130
  if (!VECTOR_COL_P(bb))
134
- rb_raise(rb_eTypeError,
135
- "Operation with %s is not defined (GSL::Vector::Col expected)",
136
- rb_class2name(CLASS_OF(bb)));
131
+ rb_raise(rb_eTypeError,
132
+ "Operation with %s is not defined (GSL::Vector::Col expected)",
133
+ rb_class2name(CLASS_OF(bb)));
137
134
  Data_Get_Struct(bb, gsl_vector, v);
138
135
  switch (flag) {
139
136
  case GSL_MATRIX_MUL:
140
- // vnew = gsl_vector_alloc(v->size);
141
- vnew = gsl_vector_alloc(m->size1);
142
- if (vnew == NULL) rb_raise(rb_eNoMemError, "gsl_vector_alloc failed");
143
- gsl_matrix_mul_vector(vnew, m, v);
144
- return Data_Wrap_Struct(cgsl_vector_col, 0, gsl_vector_free, vnew);
145
- break;
137
+ // vnew = gsl_vector_alloc(v->size);
138
+ vnew = gsl_vector_alloc(m->size1);
139
+ if (vnew == NULL) rb_raise(rb_eNoMemError, "gsl_vector_alloc failed");
140
+ gsl_matrix_mul_vector(vnew, m, v);
141
+ return Data_Wrap_Struct(cgsl_vector_col, 0, gsl_vector_free, vnew);
142
+ break;
146
143
  case GSL_MATRIX_DIV:
147
- return rb_gsl_linalg_LU_solve(1, &bb, obj);
148
- break;
144
+ return rb_gsl_linalg_LU_solve(1, &bb, obj);
145
+ break;
149
146
  default:
150
- rb_raise(rb_eRuntimeError, "operation is not defined %s and Matrix",
151
- rb_class2name(CLASS_OF(bb)));
152
- break;
147
+ rb_raise(rb_eRuntimeError, "operation is not defined %s and Matrix",
148
+ rb_class2name(CLASS_OF(bb)));
149
+ break;
153
150
  }
154
151
  } else if (rb_obj_is_kind_of(bb, cgsl_vector_complex)) {
155
152
  Data_Get_Struct(bb, gsl_vector_complex, cv);
156
153
  switch (flag) {
157
154
  case GSL_MATRIX_MUL:
158
- cm = matrix_to_complex(m);
159
- // cvnew = gsl_vector_complex_alloc(cv->size);
160
- cvnew = gsl_vector_complex_alloc(m->size1);
161
- if (cvnew == NULL) rb_raise(rb_eNoMemError, "gsl_vector_complex_alloc failed");
162
- gsl_matrix_complex_mul_vector(cvnew, cm, cv);
163
- gsl_matrix_complex_free(cm);
164
- return Data_Wrap_Struct(cgsl_vector_complex, 0, gsl_vector_complex_free, cvnew);
165
- break;
155
+ cm = matrix_to_complex(m);
156
+ // cvnew = gsl_vector_complex_alloc(cv->size);
157
+ cvnew = gsl_vector_complex_alloc(m->size1);
158
+ if (cvnew == NULL) rb_raise(rb_eNoMemError, "gsl_vector_complex_alloc failed");
159
+ gsl_matrix_complex_mul_vector(cvnew, cm, cv);
160
+ gsl_matrix_complex_free(cm);
161
+ return Data_Wrap_Struct(cgsl_vector_complex, 0, gsl_vector_complex_free, cvnew);
162
+ break;
166
163
  default:
167
- rb_raise(rb_eRuntimeError, "operation is not defined %s and Matrix",
168
- rb_class2name(CLASS_OF(bb)));
169
- break;
164
+ rb_raise(rb_eRuntimeError, "operation is not defined %s and Matrix",
165
+ rb_class2name(CLASS_OF(bb)));
166
+ break;
170
167
  }
171
168
  } else {
172
169
  rb_raise(rb_eTypeError, "wrong argument type %s", rb_class2name(CLASS_OF(bb)));
@@ -236,8 +233,8 @@ static VALUE rb_gsl_matrix_mul(VALUE obj, VALUE bb)
236
233
  return rb_gsl_matrix_mul_elements(obj, bb);
237
234
  break;
238
235
  default:
239
- rb_raise(rb_eTypeError,
240
- "wrong argument type %s", rb_class2name(CLASS_OF(bb)));
236
+ rb_raise(rb_eTypeError,
237
+ "wrong argument type %s", rb_class2name(CLASS_OF(bb)));
241
238
  break;
242
239
  }
243
240
  }
@@ -271,8 +268,8 @@ static VALUE rb_gsl_matrix_mul_bang(VALUE obj, VALUE bb)
271
268
  return obj;
272
269
  break;
273
270
  default:
274
- rb_raise(rb_eTypeError,
275
- "wrong argument type %s", rb_class2name(CLASS_OF(bb)));
271
+ rb_raise(rb_eTypeError,
272
+ "wrong argument type %s", rb_class2name(CLASS_OF(bb)));
276
273
  break;
277
274
  }
278
275
  }
@@ -336,8 +333,8 @@ static VALUE rb_gsl_matrix_coerce(VALUE obj, VALUE other)
336
333
  vcm = Data_Wrap_Struct(cgsl_matrix_complex, 0, gsl_matrix_complex_free, cm);
337
334
  return rb_ary_new3(2, other, vcm);
338
335
  } else {
339
- rb_raise(rb_eTypeError, "cannot coerce %s to Matrix",
340
- rb_class2name(CLASS_OF(other)));
336
+ rb_raise(rb_eTypeError, "cannot coerce %s to Matrix",
337
+ rb_class2name(CLASS_OF(other)));
341
338
  }
342
339
  break;
343
340
  }
@@ -384,7 +381,7 @@ static VALUE rb_gsl_matrix_clean(int argc, VALUE *argv, VALUE obj)
384
381
  mnew = make_matrix_clone(m);
385
382
  n = m->size1*m->size2;
386
383
  for (i = 0; i < n; i++) if (fabs(mnew->data[i]) < eps) mnew->data[i] = 0.0;
387
- return Data_Wrap_Struct(cgsl_matrix, 0, gsl_matrix_free, mnew);;
384
+ return Data_Wrap_Struct(cgsl_matrix, 0, gsl_matrix_free, mnew);
388
385
  }
389
386
 
390
387
  static VALUE rb_gsl_matrix_clean_bang(int argc, VALUE *argv, VALUE obj)
@@ -411,8 +408,8 @@ static VALUE rb_gsl_matrix_clean_bang(int argc, VALUE *argv, VALUE obj)
411
408
  }
412
409
 
413
410
 
414
- static VALUE rb_gsl_matrix_op_inplace(VALUE mm1, VALUE mm2,
415
- int (*f)(gsl_matrix*, const gsl_matrix*))
411
+ static VALUE rb_gsl_matrix_op_inplace(VALUE mm1, VALUE mm2,
412
+ int (*f)(gsl_matrix*, const gsl_matrix*))
416
413
  {
417
414
  gsl_matrix *m1, *m2;
418
415
  Data_Get_Struct(mm1, gsl_matrix, m1);
@@ -467,7 +464,7 @@ static VALUE rb_gsl_matrix_log10(VALUE obj)
467
464
  #include <gsl/gsl_randist.h>
468
465
  #include "include/rb_gsl_rng.h"
469
466
  static VALUE rb_gsl_matrix_randx(int argc, VALUE *argv, VALUE klass,
470
- double (*f)(const gsl_rng*));
467
+ double (*f)(const gsl_rng*));
471
468
  static VALUE rb_gsl_matrix_rand(int argc, VALUE *argv, VALUE klass)
472
469
  {
473
470
  return rb_gsl_matrix_randx(argc, argv, klass, gsl_rng_uniform);
@@ -479,7 +476,7 @@ static VALUE rb_gsl_matrix_randn(int argc, VALUE *argv, VALUE klass)
479
476
  }
480
477
 
481
478
  static VALUE rb_gsl_matrix_randx(int argc, VALUE *argv, VALUE klass,
482
- double (*f)(const gsl_rng*))
479
+ double (*f)(const gsl_rng*))
483
480
  {
484
481
  gsl_matrix *m;
485
482
  gsl_rng *rng;
@@ -488,8 +485,8 @@ static VALUE rb_gsl_matrix_randx(int argc, VALUE *argv, VALUE klass,
488
485
  switch (argc) {
489
486
  case 3:
490
487
  if (!rb_obj_is_kind_of(argv[2], cgsl_rng)) {
491
- rb_raise(rb_eTypeError,
492
- "Wrong argument type (GSL::Rng expected)");
488
+ rb_raise(rb_eTypeError,
489
+ "Wrong argument type (GSL::Rng expected)");
493
490
  }
494
491
  Data_Get_Struct(argv[2], gsl_rng, rng);
495
492
  size1 = FIX2INT(argv[0]);
@@ -530,7 +527,7 @@ void Init_gsl_matrix(VALUE module)
530
527
  rb_define_alias(cgsl_matrix, "*", "mul");
531
528
  rb_define_method(cgsl_matrix, "mul!", rb_gsl_matrix_mul_bang, 1);
532
529
  /***/
533
-
530
+
534
531
  rb_define_method(cgsl_matrix, "to_complex", rb_gsl_matrix_to_complex, 0);
535
532
 
536
533
  rb_define_method(cgsl_matrix, "coerce", rb_gsl_matrix_coerce, 1);
@@ -2,7 +2,7 @@
2
2
  matrix_int.c
3
3
  Ruby/GSL: Ruby extension library for GSL (GNU Scientific Library)
4
4
  (C) Copyright 2001-2006 by Yoshiki Tsunesada
5
-
5
+
6
6
  Ruby/GSL is free software: you can redistribute it and/or modify it
7
7
  under the terms of the GNU General Public License.
8
8
  This library is distributed in the hope that it will be useful, but
@@ -15,8 +15,8 @@
15
15
  #include "include/rb_gsl_with_narray.h"
16
16
  #endif
17
17
 
18
- int gsl_linalg_matmult_int(const gsl_matrix_int *A,
19
- const gsl_matrix_int *B, gsl_matrix_int *C);
18
+ int gsl_linalg_matmult_int(const gsl_matrix_int *A,
19
+ const gsl_matrix_int *B, gsl_matrix_int *C);
20
20
 
21
21
 
22
22
  VALUE rb_gsl_matrix_to_i(VALUE obj);
@@ -85,16 +85,16 @@ static VALUE rb_gsl_matrix_int_operation1(VALUE obj, VALUE other, int flag)
85
85
  bval = NUM2INT(other);
86
86
  anew = make_matrix_int_clone(a);
87
87
  switch (flag) {
88
- case GSL_MATRIX_INT_ADD:
88
+ case GSL_MATRIX_INT_ADD:
89
89
  /*result =*/ gsl_matrix_int_add_constant(anew, bval);
90
90
  break;
91
- case GSL_MATRIX_INT_SUB:
91
+ case GSL_MATRIX_INT_SUB:
92
92
  /*result =*/ gsl_matrix_int_add_constant(anew, -bval);
93
93
  break;
94
- case GSL_MATRIX_INT_MUL:
94
+ case GSL_MATRIX_INT_MUL:
95
95
  /*result =*/ gsl_matrix_int_scale(anew, bval);
96
96
  break;
97
- case GSL_MATRIX_INT_DIV:
97
+ case GSL_MATRIX_INT_DIV:
98
98
  /*result =*/ gsl_matrix_int_scale(anew, 1.0/bval);
99
99
  break;
100
100
  default:
@@ -109,34 +109,34 @@ static VALUE rb_gsl_matrix_int_operation1(VALUE obj, VALUE other, int flag)
109
109
  Data_Get_Struct(other, gsl_matrix_int, b);
110
110
  switch (flag) {
111
111
  case GSL_MATRIX_INT_ADD:
112
- /*result =*/ gsl_matrix_int_add(anew, b);
113
- break;
112
+ /*result =*/ gsl_matrix_int_add(anew, b);
113
+ break;
114
114
  case GSL_MATRIX_INT_SUB:
115
- /*result =*/ gsl_matrix_int_sub(anew, b);
116
- break;
115
+ /*result =*/ gsl_matrix_int_sub(anew, b);
116
+ break;
117
117
  case GSL_MATRIX_INT_MUL:
118
- /*result =*/ gsl_matrix_int_mul_elements(anew, b);
119
- break;
118
+ /*result =*/ gsl_matrix_int_mul_elements(anew, b);
119
+ break;
120
120
  case GSL_MATRIX_INT_DIV:
121
- /*result =*/ gsl_matrix_int_div_elements(anew, b);
122
- break;
121
+ /*result =*/ gsl_matrix_int_div_elements(anew, b);
122
+ break;
123
123
  default:
124
- break;
124
+ break;
125
125
  }
126
126
  } else if (VECTOR_INT_COL_P(other)) {
127
127
  switch (flag) {
128
128
  case GSL_MATRIX_INT_MUL:
129
- Data_Get_Struct(other, gsl_vector_int, vi);
130
- vinew = gsl_vector_int_alloc(vi->size);
131
- gsl_matrix_int_mul_vector(vinew, a, vi);
132
- return Data_Wrap_Struct(cgsl_vector_int_col, 0, gsl_vector_int_free, vinew);
133
- break;
129
+ Data_Get_Struct(other, gsl_vector_int, vi);
130
+ vinew = gsl_vector_int_alloc(vi->size);
131
+ gsl_matrix_int_mul_vector(vinew, a, vi);
132
+ return Data_Wrap_Struct(cgsl_vector_int_col, 0, gsl_vector_int_free, vinew);
133
+ break;
134
134
  default:
135
- rb_raise(rb_eRuntimeError, "Operation not defined");
135
+ rb_raise(rb_eRuntimeError, "Operation not defined");
136
136
  }
137
137
  } else {
138
138
  rb_raise(rb_eTypeError, "Operation not defined with %s",
139
- rb_class2name(CLASS_OF(other)));
139
+ rb_class2name(CLASS_OF(other)));
140
140
  }
141
141
  break;
142
142
  }
@@ -183,48 +183,47 @@ static VALUE rb_gsl_matrix_int_matrix_mul(VALUE obj, VALUE bb)
183
183
  switch (TYPE(bb)) {
184
184
  case T_FIXNUM:
185
185
  return rb_gsl_matrix_int_mul(obj, bb);
186
- /* return rb_gsl_matrix_int_power(obj, bb);*/
186
+ /* return rb_gsl_matrix_int_power(obj, bb);*/
187
187
  break;
188
188
  default:
189
189
  rb_raise(rb_eTypeError, "wrong argument type %s (Matrix::Int, Vector::Int::Col or Fixnum expected)",
190
- rb_class2name(CLASS_OF(bb)));
190
+ rb_class2name(CLASS_OF(bb)));
191
191
  break;
192
192
  }
193
193
  }
194
194
  }
195
195
 
196
- int gsl_linalg_matmult_int(const gsl_matrix_int *A,
197
- const gsl_matrix_int *B, gsl_matrix_int *C)
196
+ int gsl_linalg_matmult_int(const gsl_matrix_int *A,
197
+ const gsl_matrix_int *B, gsl_matrix_int *C)
198
198
  {
199
199
  if (A->size2 != B->size1 || A->size1 != C->size1 || B->size2 != C->size2)
200
- {
201
- GSL_ERROR ("matrix sizes are not conformant", GSL_EBADLEN);
202
- }
200
+ {
201
+ GSL_ERROR ("matrix sizes are not conformant", GSL_EBADLEN);
202
+ }
203
203
  else
204
+ {
205
+ int a, b;
206
+ int temp;
207
+ size_t i, j, k;
208
+
209
+ for (i = 0; i < C->size1; i++)
204
210
  {
205
- int a, b;
206
- int temp;
207
- size_t i, j, k;
208
-
209
- for (i = 0; i < C->size1; i++)
211
+ for (j = 0; j < C->size2; j++)
212
+ {
213
+ a = gsl_matrix_int_get(A, i, 0);
214
+ b = gsl_matrix_int_get(B, 0, j);
215
+ temp = a * b;
216
+ for (k = 1; k < A->size2; k++)
210
217
  {
211
- for (j = 0; j < C->size2; j++)
212
- {
213
- a = gsl_matrix_int_get(A, i, 0);
214
- b = gsl_matrix_int_get(B, 0, j);
215
- temp = a * b;
216
- for (k = 1; k < A->size2; k++)
217
- {
218
- a = gsl_matrix_int_get(A, i, k);
219
- b = gsl_matrix_int_get(B, k, j);
220
- temp += a * b;
221
- }
222
- gsl_matrix_int_set(C, i, j, temp);
223
- }
218
+ a = gsl_matrix_int_get(A, i, k);
219
+ b = gsl_matrix_int_get(B, k, j);
220
+ temp += a * b;
224
221
  }
225
-
226
- return GSL_SUCCESS;
222
+ gsl_matrix_int_set(C, i, j, temp);
223
+ }
227
224
  }
225
+ return GSL_SUCCESS;
226
+ }
228
227
  }
229
228
 
230
229
  void Init_gsl_matrix_int_init(VALUE module);
@@ -52,14 +52,14 @@ void FUNCTION(get_range,beg_en_n)(VALUE range, BASE *beg, BASE *en, size_t *n, i
52
52
 
53
53
  // From ext/vector_source.c
54
54
  void get_range_beg_en_n_for_size(VALUE range,
55
- int *beg, int *en, size_t *n, int *step, size_t size);
55
+ int *beg, int *en, size_t *n, int *step, size_t size);
56
56
 
57
57
  void parse_submatrix_args(int argc, VALUE *argv, size_t size1, size_t size2,
58
- size_t *i, size_t *j, size_t *n1, size_t *n2);
58
+ size_t *i, size_t *j, size_t *n1, size_t *n2);
59
59
 
60
60
  #ifdef BASE_DOUBLE
61
61
  void parse_submatrix_args(int argc, VALUE *argv, size_t size1, size_t size2,
62
- size_t *i, size_t *j, size_t *n1, size_t *n2)
62
+ size_t *i, size_t *j, size_t *n1, size_t *n2)
63
63
  {
64
64
  int ii, ij, in1, in2, end, step;
65
65
 
@@ -91,7 +91,7 @@ void parse_submatrix_args(int argc, VALUE *argv, size_t size1, size_t size2,
91
91
  // Fixnum, nil -> single row, all cols (Vector::View)
92
92
  // Fixnum, Range -> single row, Range cols (Vector::View)
93
93
  // Fixnum, Fixnum -> single row, single col (Matrix::View)
94
- case 2:
94
+ case 2:
95
95
  // nil, ...
96
96
  if(NIL_P(argv[0])) {
97
97
  // Parse second arg
@@ -114,7 +114,7 @@ void parse_submatrix_args(int argc, VALUE *argv, size_t size1, size_t size2,
114
114
  *i = 0; *j = (size_t)ij;
115
115
  *n1 = size1; *n2 = 0; // *n2 == 0 tells #submatrix to return Vector::Col::View
116
116
  }
117
- // Range, ...
117
+ // Range, ...
118
118
  } else if(rb_obj_is_kind_of(argv[0], rb_cRange)) {
119
119
  get_range_beg_en_n_for_size(argv[0], &ii, &end, n1, &step, size1);
120
120
  if(step < 0 || *n1 <= 0) {
@@ -139,7 +139,7 @@ void parse_submatrix_args(int argc, VALUE *argv, size_t size1, size_t size2,
139
139
  *j = (size_t) ij;
140
140
  *n2 = 0; // *n2 == 0 tells #submatrix to return Vector::Col::View
141
141
  }
142
- // Fixnum, ...
142
+ // Fixnum, ...
143
143
  } else {
144
144
  ii = NUM2INT(argv[0]);
145
145
  if(ii < 0) ii += size1;
@@ -182,7 +182,7 @@ void parse_submatrix_args(int argc, VALUE *argv, size_t size1, size_t size2,
182
182
  if(ij < 0) ij += size2;
183
183
  *j = (size_t) ij;
184
184
  *n2 = (size_t) in2;
185
- // Range, Fixnum, Fixnum
185
+ // Range, Fixnum, Fixnum
186
186
  } else if(rb_obj_is_kind_of(argv[0], rb_cRange)) {
187
187
  // Range, Fixnum, Fixnum -> Range rows, some cols
188
188
  CHECK_FIXNUM(argv[1]); CHECK_FIXNUM(argv[2]);
@@ -196,11 +196,11 @@ void parse_submatrix_args(int argc, VALUE *argv, size_t size1, size_t size2,
196
196
  *i = (size_t)ii;
197
197
  *j = (size_t) ij;
198
198
  *n2 = (size_t) in2;
199
- // Fixnum, Fixnum, ...
199
+ // Fixnum, Fixnum, ...
200
200
  } else {
201
201
  CHECK_FIXNUM(argv[0]); CHECK_FIXNUM(argv[1]);
202
202
  ii = FIX2INT(argv[0]);
203
- if(ii < 0) ii += size1;
203
+ if(ii < 0) ii += size1;
204
204
  in1 = FIX2INT(argv[1]);
205
205
  *i = (size_t)ii;
206
206
  *n1 = (size_t)in1;
@@ -218,7 +218,7 @@ void parse_submatrix_args(int argc, VALUE *argv, size_t size1, size_t size2,
218
218
  *j = (size_t)ij;
219
219
  } else {
220
220
  rb_raise(rb_eArgError, "expected third argument to be nil or Range, not %s",
221
- rb_class2name(CLASS_OF(argv[2])));
221
+ rb_class2name(CLASS_OF(argv[2])));
222
222
  }
223
223
  }
224
224
  break;
@@ -241,7 +241,7 @@ void parse_submatrix_args(int argc, VALUE *argv, size_t size1, size_t size2,
241
241
  }
242
242
  #endif
243
243
 
244
- VALUE FUNCTION(rb_gsl_matrix,do_something)(VALUE obj, void (*f)(GSL_TYPE(gsl_matrix) *))
244
+ VALUE FUNCTION(rb_gsl_matrix,do_something)(VALUE obj, void (*f)(GSL_TYPE (gsl_matrix) *))
245
245
  {
246
246
  GSL_TYPE(gsl_matrix) *m = NULL;
247
247
  Data_Get_Struct(obj, GSL_TYPE(gsl_matrix), m);
@@ -257,16 +257,13 @@ static VALUE FUNCTION(rb_gsl_matrix,alloc)(int argc, VALUE *argv, VALUE klass)
257
257
  {
258
258
  GSL_TYPE(gsl_matrix) *m = NULL;
259
259
  size_t n1, n2;
260
- #ifdef HAVE_NARRAY_H
261
- size_t n;
262
- VALUE ary;
263
- struct NARRAY *na;
264
- #endif
265
- if (argc < 1) rb_raise(rb_eArgError,
266
- "wrong number of arguments (%d for >= 1)", argc);
267
-
260
+ if (argc < 1) rb_raise(rb_eArgError,
261
+ "wrong number of arguments (%d for >= 1)", argc);
268
262
  #ifdef HAVE_NARRAY_H
269
263
  if (NA_IsNArray(argv[0])) {
264
+ size_t n;
265
+ VALUE ary;
266
+ struct NARRAY *na;
270
267
  GetNArray(argv[0], na);
271
268
  n = na->shape[0]*na->shape[1];
272
269
  m = FUNCTION(gsl_matrix,alloc)(na->shape[1], na->shape[0]);
@@ -282,8 +279,8 @@ static VALUE FUNCTION(rb_gsl_matrix,alloc)(int argc, VALUE *argv, VALUE klass)
282
279
  #endif
283
280
  switch (TYPE(argv[0])) {
284
281
  case T_FIXNUM:
285
- if (argc != 2) rb_raise(rb_eArgError, "wrong number of arguments (%d for 2)",
286
- argc);
282
+ if (argc != 2) rb_raise(rb_eArgError, "wrong number of arguments (%d for 2)",
283
+ argc);
287
284
  CHECK_FIXNUM(argv[1]);
288
285
  n1 = FIX2INT(argv[0]); n2 = FIX2INT(argv[1]);
289
286
  m = FUNCTION(gsl_matrix,calloc)(n1, n2);
@@ -300,38 +297,38 @@ static VALUE FUNCTION(rb_gsl_matrix,alloc)(int argc, VALUE *argv, VALUE klass)
300
297
  break;
301
298
  case T_FIXNUM:
302
299
  if (argc != 3) rb_raise(rb_eArgError, "wrong number of arguments (%d for 3)",
303
- argc);
300
+ argc);
304
301
  CHECK_FIXNUM(argv[2]);
305
302
  m = FUNCTION(gsl_matrix,alloc_from_array_sizes)(argv[0], argv[1], argv[2]);
306
303
  break;
307
304
  default:
308
- rb_raise(rb_eTypeError,
309
- "wrong argument type %s\nUsage: new(n1, n2), "
310
- "new([], [], [], ...), new([], n1, n2)",
311
- rb_class2name(CLASS_OF(argv[1])));
305
+ rb_raise(rb_eTypeError,
306
+ "wrong argument type %s\nUsage: new(n1, n2), "
307
+ "new([], [], [], ...), new([], n1, n2)",
308
+ rb_class2name(CLASS_OF(argv[1])));
312
309
  break;
313
310
  }
314
311
  break;
315
312
  default:
316
313
  if (CLASS_OF(argv[0]) == rb_cRange) {
317
314
  if (argc==3 && TYPE(argv[1]) == T_FIXNUM && TYPE(argv[2]) == T_FIXNUM)
318
- return FUNCTION(create_matrix,from_range_shape)(argv[0], argv[1], argv[2]);
315
+ return FUNCTION(create_matrix,from_range_shape)(argv[0], argv[1], argv[2]);
319
316
  else
320
- return FUNCTION(create_matrix,from_ranges)(argc, argv);
317
+ return FUNCTION(create_matrix,from_ranges)(argc, argv);
321
318
  } else if (VEC_P(argv[0])) {
322
319
  if (argc == 3 && FIXNUM_P(argv[1]) && FIXNUM_P(argv[2])) {
323
- m = FUNCTION(gsl_matrix,alloc_from_vector_sizes)(argv[0], argv[1], argv[2]);
320
+ m = FUNCTION(gsl_matrix,alloc_from_vector_sizes)(argv[0], argv[1], argv[2]);
324
321
  } else {
325
- if (VEC_COL_P(argv[0])) {
326
- m = FUNCTION(gsl_matrix,alloc_from_colvectors)(argc, argv);
327
- } else {
328
- m = FUNCTION(gsl_matrix,alloc_from_vectors)(argc, argv);
329
- }
322
+ if (VEC_COL_P(argv[0])) {
323
+ m = FUNCTION(gsl_matrix,alloc_from_colvectors)(argc, argv);
324
+ } else {
325
+ m = FUNCTION(gsl_matrix,alloc_from_vectors)(argc, argv);
326
+ }
330
327
  }
331
328
  } else {
332
329
  rb_raise(rb_eTypeError, "wrong argument type %s\n"
333
- "Usage: new(n1, n2), new([], [], [], ...), new([], n1, n2)",
334
- rb_class2name(CLASS_OF(argv[0])));
330
+ "Usage: new(n1, n2), new([], [], [], ...), new([], n1, n2)",
331
+ rb_class2name(CLASS_OF(argv[0])));
335
332
  }
336
333
  break;
337
334
  }
@@ -350,9 +347,9 @@ static GSL_TYPE(gsl_matrix)* FUNCTION(cr_matrix,from_ranges)(int argc, VALUE *ar
350
347
  m = FUNCTION(gsl_matrix,calloc)(argc, n);
351
348
  FUNCTION(set_ptr_data,by_range)(m->data, n, argv[0]);
352
349
  for (i = 1; (int) i < argc; i++) {
353
- if (CLASS_OF(argv[i]) != rb_cRange)
350
+ if (CLASS_OF(argv[i]) != rb_cRange)
354
351
  rb_raise(rb_eTypeError, "wrong argument type %s (Range expected)",
355
- rb_class2name(CLASS_OF(argv[i])));
352
+ rb_class2name(CLASS_OF(argv[i])));
356
353
  FUNCTION(set_ptr_data,by_range)(m->data+i*n, n, argv[i]);
357
354
  }
358
355
  return m;
@@ -430,7 +427,7 @@ GSL_TYPE(gsl_matrix)* FUNCTION(gsl_matrix,alloc_from_colvectors)(int argc, VALUE
430
427
  CHECK_VEC(argv[0]);
431
428
  Data_Get_Struct(argv[0], GSL_TYPE(gsl_vector), v);
432
429
  // m = FUNCTION(gsl_matrix,alloc)(argc, v->size);
433
- m = FUNCTION(gsl_matrix,alloc)(v->size, argc);
430
+ m = FUNCTION(gsl_matrix,alloc)(v->size, argc);
434
431
  if (m == NULL) rb_raise(rb_eNoMemError, "gsl_matrix_alloc failed");
435
432
  for (i = 0; (int) i < argc; i++) {
436
433
  CHECK_VEC(argv[i]);
@@ -442,7 +439,7 @@ GSL_TYPE(gsl_matrix)* FUNCTION(gsl_matrix,alloc_from_colvectors)(int argc, VALUE
442
439
 
443
440
  /* create a matrix from two sizes and an array */
444
441
  GSL_TYPE(gsl_matrix)* FUNCTION(gsl_matrix,alloc_from_array_sizes)(VALUE ary,
445
- VALUE nn1, VALUE nn2)
442
+ VALUE nn1, VALUE nn2)
446
443
  {
447
444
  size_t n1, n2, len;
448
445
  GSL_TYPE(gsl_matrix) *m = NULL;
@@ -458,17 +455,16 @@ GSL_TYPE(gsl_matrix)* FUNCTION(gsl_matrix,alloc_from_array_sizes)(VALUE ary,
458
455
  for (i = 0; i < n1; i++) {
459
456
  for (j = 0; j < n2; j++, k++) {
460
457
  if (k >= len)
461
- FUNCTION(gsl_matrix,set)(m, i, j, (BASE) 0);
458
+ FUNCTION(gsl_matrix,set)(m, i, j, (BASE) 0);
462
459
  else
463
- FUNCTION(gsl_matrix,set)(m, i, j, (BASE) NUMCONV2(rb_ary_entry(ary, k)));
464
-
460
+ FUNCTION(gsl_matrix,set)(m, i, j, (BASE) NUMCONV2(rb_ary_entry(ary, k)));
465
461
  }
466
462
  }
467
463
  return m;
468
464
  }
469
465
 
470
466
  GSL_TYPE(gsl_matrix)* FUNCTION(gsl_matrix,alloc_from_vector_sizes)(VALUE ary,
471
- VALUE nn1, VALUE nn2)
467
+ VALUE nn1, VALUE nn2)
472
468
  {
473
469
  size_t n1, n2;
474
470
  GSL_TYPE(gsl_matrix) *m = NULL;
@@ -483,10 +479,10 @@ GSL_TYPE(gsl_matrix)* FUNCTION(gsl_matrix,alloc_from_vector_sizes)(VALUE ary,
483
479
  k = 0;
484
480
  for (i = 0; i < n1; i++) {
485
481
  for (j = 0; j < n2; j++, k++) {
486
- if (k >= v->size)
487
- FUNCTION(gsl_matrix,set)(m, i, j, (BASE) 0);
482
+ if (k >= v->size)
483
+ FUNCTION(gsl_matrix,set)(m, i, j, (BASE) 0);
488
484
  else
489
- FUNCTION(gsl_matrix,set)(m, i, j, FUNCTION(gsl_vector,get)(v, k));
485
+ FUNCTION(gsl_matrix,set)(m, i, j, FUNCTION(gsl_vector,get)(v, k));
490
486
  }
491
487
  }
492
488
  return m;
@@ -515,7 +511,7 @@ static VALUE FUNCTION(rb_gsl_matrix,diagonal_singleton)(int argc, VALUE *argv, V
515
511
  len = FIX2INT(argv[0]);
516
512
  m = FUNCTION(gsl_matrix,alloc)(len, len);
517
513
  for (i = 0; i < len; i++)
518
- FUNCTION(gsl_matrix,set)(m, i, i, 1);
514
+ FUNCTION(gsl_matrix,set)(m, i, i, 1);
519
515
  return Data_Wrap_Struct(klass, 0, FUNCTION(gsl_matrix,free), m);
520
516
  break;
521
517
  default:
@@ -530,8 +526,8 @@ static VALUE FUNCTION(rb_gsl_matrix,diagonal_singleton)(int argc, VALUE *argv, V
530
526
  len = RARRAY_LEN(ary);
531
527
  m = FUNCTION(gsl_matrix,calloc)(len, len);
532
528
  for (i = 0; i < len; i++) {
533
- tmp = rb_ary_entry(ary, i);
534
- FUNCTION(gsl_matrix,set)(m, i, i, NUMCONV2(tmp));
529
+ tmp = rb_ary_entry(ary, i);
530
+ FUNCTION(gsl_matrix,set)(m, i, i, NUMCONV2(tmp));
535
531
  }
536
532
  break;
537
533
  default:
@@ -540,7 +536,7 @@ static VALUE FUNCTION(rb_gsl_matrix,diagonal_singleton)(int argc, VALUE *argv, V
540
536
  len = v->size;
541
537
  m = FUNCTION(gsl_matrix,calloc)(len, len);
542
538
  for (i = 0; i < len; i++) {
543
- FUNCTION(gsl_matrix,set)(m, i, i, FUNCTION(gsl_vector,get)(v, i));
539
+ FUNCTION(gsl_matrix,set)(m, i, i, FUNCTION(gsl_vector,get)(v, i));
544
540
  }
545
541
  break;
546
542
  }
@@ -711,7 +707,6 @@ static VALUE FUNCTION(rb_gsl_matrix,get)(int argc, VALUE *argv, VALUE obj)
711
707
  } else {
712
708
  retval = FUNCTION(rb_gsl_matrix,submatrix)(argc, argv, obj);
713
709
  }
714
-
715
710
  return retval;
716
711
  }
717
712
 
@@ -729,7 +724,6 @@ static VALUE FUNCTION(rb_gsl_matrix,set)(int argc, VALUE *argv, VALUE obj)
729
724
  if(argc < 1 || argc > 5) {
730
725
  rb_raise(rb_eArgError, "wrong number of arguments (%d for 1-5)", argc);
731
726
  }
732
-
733
727
  Data_Get_Struct(obj, GSL_TYPE(gsl_matrix), m);
734
728
  other = argv[argc-1];
735
729
 
@@ -783,7 +777,7 @@ static VALUE FUNCTION(rb_gsl_matrix,set)(int argc, VALUE *argv, VALUE obj)
783
777
  Data_Get_Struct(other, GSL_TYPE(gsl_matrix), mother);
784
778
  if(n1 * n2 != mother->size1 * mother->size2) {
785
779
  rb_raise(rb_eRangeError, "sizes do not match (%d x %d != %d x %d)",
786
- (int) n1, (int) n2, (int) mother->size1, (int) mother->size2);
780
+ (int) n1, (int) n2, (int) mother->size1, (int) mother->size2);
787
781
  }
788
782
  // TODO Change to gsl_matrix_memmove if/when GSL has such a function
789
783
  // because gsl_matrix_memcpy does not handle overlapping regions (e.g.
@@ -801,7 +795,7 @@ static VALUE FUNCTION(rb_gsl_matrix,set)(int argc, VALUE *argv, VALUE obj)
801
795
  // m[...] = [[row0], [row1], ...] # multiple rows
802
796
  if((int) n1 != RARRAY_LEN(other)) {
803
797
  rb_raise(rb_eRangeError, "row counts do not match (%d != %d)",
804
- (int) n1, (int) RARRAY_LEN(other));
798
+ (int) n1, (int) RARRAY_LEN(other));
805
799
  }
806
800
  for(k = 0; k < n1; k++) {
807
801
  vv = FUNCTION(gsl_matrix,row)(&mv.matrix, k);
@@ -824,7 +818,6 @@ static VALUE FUNCTION(rb_gsl_matrix,set)(int argc, VALUE *argv, VALUE obj)
824
818
  FUNCTION(gsl_matrix,set_all)(&mv.matrix, NUMCONV2(other));
825
819
  }
826
820
  }
827
-
828
821
  return obj;
829
822
  }
830
823
 
@@ -893,7 +886,7 @@ static VALUE FUNCTION(rb_gsl_matrix,to_s)(VALUE obj)
893
886
  strcpy(format2, format);
894
887
  #else
895
888
  strcpy(format, PRINTF_FORMAT);
896
- strcpy(format2, " "PRINTF_FORMAT);
889
+ strcpy(format2, " " PRINTF_FORMAT);
897
890
  #endif
898
891
  str = rb_str_new2("[ ");
899
892
  for (i = 0; i < m->size1; i++) {
@@ -904,9 +897,9 @@ static VALUE FUNCTION(rb_gsl_matrix,to_s)(VALUE obj)
904
897
  for (j = 0; j < m->size2; j++) {
905
898
  x = FUNCTION(gsl_matrix,get)(m, i, j);
906
899
  if (x < 0)
907
- sprintf(buf, format, x);
900
+ sprintf(buf, format, x);
908
901
  else
909
- sprintf(buf, format2, x);
902
+ sprintf(buf, format2, x);
910
903
  rb_str_cat(str, buf, strlen(buf));
911
904
  if ((int) j >= (55/dig)) {
912
905
  strcpy(buf, "... ");
@@ -1015,11 +1008,11 @@ static VALUE FUNCTION(rb_gsl_matrix,set_diagonal)(VALUE obj, VALUE diag)
1015
1008
  Data_Get_Struct(diag, GSL_TYPE(gsl_vector), v);
1016
1009
  len = GSL_MIN_INT(m->size1, v->size);
1017
1010
  for (i = 0; i < len; i++) {
1018
- FUNCTION(gsl_matrix,set)(m, i, i, FUNCTION(gsl_vector,get)(v, i));
1011
+ FUNCTION(gsl_matrix,set)(m, i, i, FUNCTION(gsl_vector,get)(v, i));
1019
1012
  }
1020
1013
  } else {
1021
1014
  rb_raise(rb_eTypeError, "wrong argument type %s (GSL::Vector or Array expected)",
1022
- rb_class2name(CLASS_OF(diag)));
1015
+ rb_class2name(CLASS_OF(diag)));
1023
1016
  }
1024
1017
  break;
1025
1018
  }
@@ -1268,7 +1261,7 @@ static VALUE FUNCTION(rb_gsl_matrix,minmax_index)(VALUE obj)
1268
1261
  Data_Get_Struct(obj, GSL_TYPE(gsl_matrix), m);
1269
1262
  FUNCTION(gsl_matrix,minmax_index)(m, &imin, &jmin, &imax, &jmax);
1270
1263
  return rb_ary_new3(2, rb_ary_new3(2, INT2FIX(imin), INT2FIX(jmin)),
1271
- rb_ary_new3(2, INT2FIX(imax), INT2FIX(jmax)));
1264
+ rb_ary_new3(2, INT2FIX(imax), INT2FIX(jmax)));
1272
1265
  }
1273
1266
 
1274
1267
  static VALUE FUNCTION(rb_gsl_matrix,fwrite)(VALUE obj, VALUE io)
@@ -1333,7 +1326,7 @@ VALUE FUNCTION(rb_gsl_matrix,power)(VALUE obj, VALUE bb)
1333
1326
  size_t i, b;
1334
1327
  CHECK_FIXNUM(bb);
1335
1328
  Data_Get_Struct(obj, GSL_TYPE(gsl_matrix), m);
1336
- b = FIX2INT(bb);
1329
+ b = FIX2INT(bb);
1337
1330
  mtmp = FUNCTION(gsl_matrix,alloc)(m->size1, m->size2);
1338
1331
  mnew = FUNCTION(gsl_matrix,alloc)(m->size1, m->size2);
1339
1332
  FUNCTION(gsl_matrix,memcpy)(mnew, m);
@@ -1374,8 +1367,8 @@ static VALUE FUNCTION(rb_gsl_matrix,submatrix)(int argc, VALUE *argv, VALUE obj)
1374
1367
  }
1375
1368
 
1376
1369
  static VALUE FUNCTION(rb_gsl_matrix,return_vector_view)(VALUE obj, VALUE index,
1377
- QUALIFIED_VIEW(gsl_vector,view) (*f)(GSL_TYPE(gsl_matrix)*,
1378
- size_t))
1370
+ QUALIFIED_VIEW(gsl_vector,view) (*f)(GSL_TYPE(gsl_matrix)*,
1371
+ size_t))
1379
1372
  {
1380
1373
  GSL_TYPE(gsl_matrix) *m = NULL;
1381
1374
  QUALIFIED_VIEW(gsl_vector,view) *vv = NULL;
@@ -1402,9 +1395,8 @@ static VALUE FUNCTION(rb_gsl_matrix,column)(VALUE obj, VALUE j)
1402
1395
  return Data_Wrap_Struct(QUALIFIED_VIEW(cgsl_vector,col_view), 0, free, vv);
1403
1396
  }
1404
1397
 
1405
- #ifdef GSL_1_10_LATER
1406
1398
  static VALUE FUNCTION(rb_gsl_matrix,subrow)(VALUE obj, VALUE i, VALUE offset,
1407
- VALUE n)
1399
+ VALUE n)
1408
1400
  {
1409
1401
  GSL_TYPE(gsl_matrix) *m = NULL;
1410
1402
  QUALIFIED_VIEW(gsl_vector,view) *vv = NULL;
@@ -1414,7 +1406,7 @@ static VALUE FUNCTION(rb_gsl_matrix,subrow)(VALUE obj, VALUE i, VALUE offset,
1414
1406
  return Data_Wrap_Struct(QUALIFIED_VIEW(cgsl_vector,view), 0, free, vv);
1415
1407
  }
1416
1408
  static VALUE FUNCTION(rb_gsl_matrix,subcolumn)(VALUE obj, VALUE j, VALUE offset,
1417
- VALUE n)
1409
+ VALUE n)
1418
1410
  {
1419
1411
  GSL_TYPE(gsl_matrix) *m = NULL;
1420
1412
  QUALIFIED_VIEW(gsl_vector,view) *vv = NULL;
@@ -1423,7 +1415,6 @@ static VALUE FUNCTION(rb_gsl_matrix,subcolumn)(VALUE obj, VALUE j, VALUE offset,
1423
1415
  *vv = FUNCTION(gsl_matrix,subcolumn)(m, FIX2INT(j), FIX2INT(offset), FIX2INT(n));
1424
1416
  return Data_Wrap_Struct(QUALIFIED_VIEW(cgsl_vector,col_view), 0, free, vv);
1425
1417
  }
1426
- #endif
1427
1418
 
1428
1419
  static VALUE FUNCTION(rb_gsl_matrix,diagonal)(VALUE obj)
1429
1420
  {
@@ -1499,7 +1490,7 @@ static VALUE FUNCTION(rb_gsl_matrix,scale_bang)(VALUE obj, VALUE x)
1499
1490
  {
1500
1491
  GSL_TYPE(gsl_matrix) *m;
1501
1492
  Data_Get_Struct(obj, GSL_TYPE(gsl_matrix), m);
1502
- FUNCTION(gsl_matrix,scale)(m, NUMCONV(x));
1493
+ FUNCTION(gsl_matrix,scale)(m, NUMCONV2(x));
1503
1494
  return obj;
1504
1495
  }
1505
1496
 
@@ -1508,7 +1499,7 @@ static VALUE FUNCTION(rb_gsl_matrix,scale)(VALUE obj, VALUE b)
1508
1499
  GSL_TYPE(gsl_matrix) *m = NULL, *mnew;
1509
1500
  Data_Get_Struct(obj, GSL_TYPE(gsl_matrix), m);
1510
1501
  mnew = FUNCTION(make_matrix,clone)(m);
1511
- FUNCTION(gsl_matrix,scale)(mnew, NUMCONV(b));
1502
+ FUNCTION(gsl_matrix,scale)(mnew, NUMCONV2(b));
1512
1503
  return Data_Wrap_Struct(GSL_TYPE(cgsl_matrix), 0, FUNCTION(gsl_matrix,free), mnew);
1513
1504
  }
1514
1505
 
@@ -1516,7 +1507,7 @@ static VALUE FUNCTION(rb_gsl_matrix,add_constant_bang)(VALUE obj, VALUE x)
1516
1507
  {
1517
1508
  GSL_TYPE(gsl_matrix) *m;
1518
1509
  Data_Get_Struct(obj, GSL_TYPE(gsl_matrix), m);
1519
- FUNCTION(gsl_matrix,add_constant)(m, NUMCONV(x));
1510
+ FUNCTION(gsl_matrix,add_constant)(m, NUMCONV2(x));
1520
1511
  return obj;
1521
1512
  }
1522
1513
 
@@ -1525,7 +1516,7 @@ static VALUE FUNCTION(rb_gsl_matrix,add_constant)(VALUE obj, VALUE b)
1525
1516
  GSL_TYPE(gsl_matrix) *m = NULL, *mnew;
1526
1517
  Data_Get_Struct(obj, GSL_TYPE(gsl_matrix), m);
1527
1518
  mnew = FUNCTION(make_matrix,clone)(m);
1528
- FUNCTION(gsl_matrix,add_constant)(mnew, NUMCONV(b));
1519
+ FUNCTION(gsl_matrix,add_constant)(mnew, NUMCONV2(b));
1529
1520
  return Data_Wrap_Struct(GSL_TYPE(cgsl_matrix), 0, FUNCTION(gsl_matrix,free), mnew);
1530
1521
  }
1531
1522
 
@@ -1543,7 +1534,7 @@ static int FUNCTION(mygsl_matrix,equal)(GSL_TYPE(gsl_matrix) *a, GSL_TYPE(gsl_ma
1543
1534
  }
1544
1535
  return 1;
1545
1536
  }
1546
-
1537
+
1547
1538
  #ifdef HAVE_TENSOR_TENSOR_H
1548
1539
  EXTERN VALUE cgsl_tensor, cgsl_tensor_int;
1549
1540
  VALUE rb_gsl_tensor_equal(int argc, VALUE *argv, VALUE obj);
@@ -1711,7 +1702,7 @@ static VALUE FUNCTION(rb_gsl_matrix,pascal1)(VALUE obj, VALUE n)
1711
1702
  for (i = 1; i < dim; i++) {
1712
1703
  FUNCTION(gsl_matrix,set)(m, i, 0, (BASE) 1);
1713
1704
  for (j = 1; j < dim; j++) {
1714
- x=FUNCTION(gsl_matrix,get)(m,i-1,j)+FUNCTION(gsl_matrix,get)(m,i,j-1);
1705
+ x = FUNCTION(gsl_matrix,get)(m,i-1,j)+FUNCTION(gsl_matrix,get)(m,i,j-1);
1715
1706
  FUNCTION(gsl_matrix,set)(m, i, j, x);
1716
1707
  }
1717
1708
  }
@@ -1785,7 +1776,7 @@ static VALUE FUNCTION(rb_gsl_matrix,vandermonde)(VALUE obj, VALUE vv)
1785
1776
  Data_Get_Struct(vv, GSL_TYPE(gsl_vector), v);
1786
1777
  } else {
1787
1778
  rb_raise(rb_eTypeError, "wrong argument type %s (Array or Vector expected)",
1788
- rb_class2name(CLASS_OF(vv)));
1779
+ rb_class2name(CLASS_OF(vv)));
1789
1780
  }
1790
1781
  m = FUNCTION(gsl_matrix,alloc)(v->size, v->size);
1791
1782
  FUNCTION(mygsl_matrix,vandermonde)(m, v);
@@ -1798,10 +1789,10 @@ static void FUNCTION(mygsl_matrix,toeplitz)(GSL_TYPE(gsl_matrix) *m, GSL_TYPE(gs
1798
1789
  size_t i, j;
1799
1790
  for (i = 0; i < v->size; i++) {
1800
1791
  for (j = 0; j < v->size; j++) {
1801
- if (j >= i)
1802
- FUNCTION(gsl_matrix,set)(m, i, j, FUNCTION(gsl_vector,get)(v, j-i));
1792
+ if (j >= i)
1793
+ FUNCTION(gsl_matrix,set)(m, i, j, FUNCTION(gsl_vector,get)(v, j-i));
1803
1794
  else
1804
- FUNCTION(gsl_matrix,set)(m, i, j, FUNCTION(gsl_vector,get)(v, i-j));
1795
+ FUNCTION(gsl_matrix,set)(m, i, j, FUNCTION(gsl_vector,get)(v, i-j));
1805
1796
  }
1806
1797
  }
1807
1798
  }
@@ -1818,7 +1809,7 @@ static VALUE FUNCTION(rb_gsl_matrix,toeplitz)(VALUE obj, VALUE vv)
1818
1809
  Data_Get_Struct(vv, GSL_TYPE(gsl_vector), v);
1819
1810
  } else {
1820
1811
  rb_raise(rb_eTypeError, "wrong argument type %s (Array or Vector expected)",
1821
- rb_class2name(CLASS_OF(vv)));
1812
+ rb_class2name(CLASS_OF(vv)));
1822
1813
  }
1823
1814
  m = FUNCTION(gsl_matrix,alloc)(v->size, v->size);
1824
1815
  FUNCTION(mygsl_matrix,toeplitz)(m, v);
@@ -1839,7 +1830,7 @@ static VALUE FUNCTION(rb_gsl_matrix,circulant)(VALUE obj, VALUE vv)
1839
1830
  Data_Get_Struct(vv, GSL_TYPE(gsl_vector), v);
1840
1831
  } else {
1841
1832
  rb_raise(rb_eTypeError, "wrong argument type %s (Array or Vector expected)",
1842
- rb_class2name(CLASS_OF(vv)));
1833
+ rb_class2name(CLASS_OF(vv)));
1843
1834
  }
1844
1835
  m = FUNCTION(gsl_matrix,alloc)(v->size, v->size);
1845
1836
  FUNCTION(mygsl_vector,to_m_circulant)(m, v);
@@ -1848,7 +1839,7 @@ static VALUE FUNCTION(rb_gsl_matrix,circulant)(VALUE obj, VALUE vv)
1848
1839
  }
1849
1840
 
1850
1841
  static void FUNCTION(mygsl_matrix,indgen)(GSL_TYPE(gsl_matrix) *m,
1851
- BASE start, BASE step)
1842
+ BASE start, BASE step)
1852
1843
  {
1853
1844
  size_t i, j;
1854
1845
  BASE n;
@@ -1869,10 +1860,10 @@ static VALUE FUNCTION(rb_gsl_matrix,indgen_singleton)(int argc, VALUE *argv, VAL
1869
1860
  switch (argc) {
1870
1861
  case 4:
1871
1862
  step = NUMCONV2(argv[3]);
1872
- /* no break */
1863
+ /* no break */
1873
1864
  case 3:
1874
1865
  start = NUMCONV2(argv[2]);
1875
- /* no break */
1866
+ /* no break */
1876
1867
  case 2:
1877
1868
  n1 = NUM2INT(argv[0]);
1878
1869
  n2 = NUM2INT(argv[1]);
@@ -1893,7 +1884,7 @@ static VALUE FUNCTION(rb_gsl_matrix,indgen)(int argc, VALUE *argv, VALUE obj)
1893
1884
  switch (argc) {
1894
1885
  case 2:
1895
1886
  step = NUMCONV2(argv[1]);
1896
- /* no break */
1887
+ /* no break */
1897
1888
  case 1:
1898
1889
  start = NUMCONV2(argv[0]);
1899
1890
  break;
@@ -1916,7 +1907,7 @@ static VALUE FUNCTION(rb_gsl_matrix,indgen_bang)(int argc, VALUE *argv, VALUE ob
1916
1907
  switch (argc) {
1917
1908
  case 2:
1918
1909
  step = NUMCONV2(argv[1]);
1919
- /* no break */
1910
+ /* no break */
1920
1911
  case 1:
1921
1912
  start = NUMCONV2(argv[0]);
1922
1913
  break;
@@ -1938,10 +1929,10 @@ static VALUE FUNCTION(rb_gsl_matrix,to_a)(VALUE obj)
1938
1929
  size_t i, j;
1939
1930
  Data_Get_Struct(obj, GSL_TYPE(gsl_matrix), m);
1940
1931
  ma = rb_ary_new2(m->size1);
1941
- for(i=0; i < m->size1; i++) {
1932
+ for(i = 0; i < m->size1; i++) {
1942
1933
  ra = rb_ary_new2(m->size2);
1943
1934
  rb_ary_store(ma, i, ra);
1944
- for(j=0; j < m->size2; j++) {
1935
+ for(j = 0; j < m->size2; j++) {
1945
1936
  rb_ary_store(ra, j, C_TO_VALUE(FUNCTION(gsl_matrix,get)(m, i, j)));
1946
1937
  }
1947
1938
  }
@@ -1961,7 +1952,6 @@ static VALUE FUNCTION(rb_gsl_matrix,to_v)(VALUE obj)
1961
1952
  FUNCTION(gsl_vector,set)(v, k, FUNCTION(gsl_matrix,get)(m, i, j));
1962
1953
  }
1963
1954
  }
1964
-
1965
1955
  if(m->size1 > 1 && m->size2 == 1) {
1966
1956
  return Data_Wrap_Struct(CONCAT2(GSL_TYPE(cgsl_vector),col), 0, FUNCTION(gsl_vector,free), v);
1967
1957
  } else {
@@ -1994,7 +1984,7 @@ static VALUE FUNCTION(rb_gsl_matrix,norm)(VALUE obj)
1994
1984
  }
1995
1985
 
1996
1986
  static int FUNCTION(mygsl_matrix,reverse_columns)(GSL_TYPE(gsl_matrix) *dst,
1997
- GSL_TYPE(gsl_matrix) *src)
1987
+ GSL_TYPE(gsl_matrix) *src)
1998
1988
  {
1999
1989
  size_t j;
2000
1990
  QUALIFIED_VIEW(gsl_vector,view) col;
@@ -2008,7 +1998,7 @@ static int FUNCTION(mygsl_matrix,reverse_columns)(GSL_TYPE(gsl_matrix) *dst,
2008
1998
  }
2009
1999
 
2010
2000
  static int FUNCTION(mygsl_matrix,reverse_rows)(GSL_TYPE(gsl_matrix) *dst,
2011
- GSL_TYPE(gsl_matrix) *src)
2001
+ GSL_TYPE(gsl_matrix) *src)
2012
2002
  {
2013
2003
  size_t i;
2014
2004
  QUALIFIED_VIEW(gsl_vector,view) row;
@@ -2112,14 +2102,14 @@ static VALUE FUNCTION(rb_gsl_matrix,all)(VALUE obj)
2112
2102
  vv = FUNCTION(gsl_matrix,column)(m, j);
2113
2103
  v = &vv.vector;
2114
2104
  /* if (FUNCTION(gsl_vector,isnull(v))) gsl_vector_int_set(vnew, j, 0);
2115
- else gsl_vector_int_set(vnew, j, 1);*/
2105
+ else gsl_vector_int_set(vnew, j, 1);*/
2116
2106
  for (i = 0; i < v->size; i++) {
2117
2107
  if (FUNCTION(gsl_vector,get)(v, i) == (BASE) 0) {
2118
- gsl_vector_int_set(vnew, j, 0);
2119
- flag = 0;
2120
- break;
2108
+ gsl_vector_int_set(vnew, j, 0);
2109
+ flag = 0;
2110
+ break;
2121
2111
  } else {
2122
- flag = 1;
2112
+ flag = 1;
2123
2113
  }
2124
2114
  }
2125
2115
  if (flag == 1) gsl_vector_int_set(vnew, j, 1);
@@ -2181,7 +2171,7 @@ static VALUE FUNCTION(rb_gsl_matrix,rot90)(int argc, VALUE *argv, VALUE obj)
2181
2171
  }
2182
2172
 
2183
2173
  void FUNCTION(mygsl_vector,diff)(GSL_TYPE(gsl_vector) *vdst,
2184
- GSL_TYPE(gsl_vector) *vsrc, size_t n);
2174
+ GSL_TYPE(gsl_vector) *vsrc, size_t n);
2185
2175
 
2186
2176
  static VALUE FUNCTION(rb_gsl_matrix,diff)(int argc, VALUE *argv, VALUE obj)
2187
2177
  {
@@ -2254,7 +2244,6 @@ static VALUE FUNCTION(rb_gsl_matrix,sgn)(VALUE obj)
2254
2244
  FUNCTION(gsl_matrix,set)(mnew, i, j, (BASE)(x>0 ? 1 : (x<0 ? -1 : 0)));
2255
2245
  }
2256
2246
  }
2257
-
2258
2247
  return Data_Wrap_Struct(GSL_TYPE(cgsl_matrix), 0, FUNCTION(gsl_matrix,free), mnew);
2259
2248
  }
2260
2249
 
@@ -2269,7 +2258,6 @@ static VALUE FUNCTION(rb_gsl_matrix,abs)(VALUE obj)
2269
2258
  FUNCTION(gsl_matrix,set)(mnew, i, j, (BASE) fabs(FUNCTION(gsl_matrix,get)(m, i, j)));
2270
2259
  }
2271
2260
  }
2272
-
2273
2261
  return Data_Wrap_Struct(GSL_TYPE(cgsl_matrix), 0, FUNCTION(gsl_matrix,free), mnew);
2274
2262
  }
2275
2263
 
@@ -2281,9 +2269,9 @@ static VALUE FUNCTION(rb_gsl_matrix,horzcat)(VALUE obj, VALUE mm2)
2281
2269
  CHECK_MAT(mm2);
2282
2270
  Data_Get_Struct(obj, GSL_TYPE(gsl_matrix), m);
2283
2271
  Data_Get_Struct(mm2, GSL_TYPE(gsl_matrix), m2);
2284
- if (m->size1 != m2->size1)
2272
+ if (m->size1 != m2->size1)
2285
2273
  rb_raise(rb_eRuntimeError, "Different number of rows (%d and %d).",
2286
- (int) m->size1, (int) m2->size1);
2274
+ (int) m->size1, (int) m2->size1);
2287
2275
  mnew = FUNCTION(gsl_matrix,alloc)(m->size1, m->size2 + m2->size2);
2288
2276
  for (j = 0, k = 0; j < m->size2; j++, k++) {
2289
2277
  v = FUNCTION(gsl_matrix,column)(m, j);
@@ -2311,9 +2299,9 @@ static VALUE FUNCTION(rb_gsl_matrix,vertcat)(VALUE obj, VALUE mm2)
2311
2299
  CHECK_MAT(mm2);
2312
2300
  Data_Get_Struct(obj, GSL_TYPE(gsl_matrix), m);
2313
2301
  Data_Get_Struct(mm2, GSL_TYPE(gsl_matrix), m2);
2314
- if (m->size2 != m2->size2)
2302
+ if (m->size2 != m2->size2)
2315
2303
  rb_raise(rb_eRuntimeError, "Different number of columns (%d and %d).",
2316
- (int) m->size2, (int) m2->size2);
2304
+ (int) m->size2, (int) m2->size2);
2317
2305
  mnew = FUNCTION(gsl_matrix,alloc)(m->size1 + m2->size1, m->size2);
2318
2306
  for (i = 0, k = 0; i < m->size1; i++, k++) {
2319
2307
  v = FUNCTION(gsl_matrix,row)(m, i);
@@ -2332,17 +2320,16 @@ static VALUE FUNCTION(rb_gsl_matrix,vertcat_singleton)(VALUE klass, VALUE mm, VA
2332
2320
  return FUNCTION(rb_gsl_matrix,vertcat)(mm, mm2);
2333
2321
  }
2334
2322
 
2335
- #ifdef GSL_1_9_LATER
2336
2323
  static VALUE FUNCTION(rb_gsl_matrix,property)(VALUE obj,
2337
- int (*f)(const GSL_TYPE(gsl_matrix)*)) {
2324
+ int (*f)(const GSL_TYPE (gsl_matrix)*)) {
2338
2325
  GSL_TYPE(gsl_matrix) *m;
2339
2326
  Data_Get_Struct(obj, GSL_TYPE(gsl_matrix), m);
2340
- return INT2FIX((*f)(m));
2327
+ return INT2FIX((*f)(m));
2341
2328
  }
2342
2329
 
2343
2330
  static VALUE FUNCTION(rb_gsl_matrix,property2)(VALUE obj,
2344
- int (*f)(const GSL_TYPE(gsl_matrix) *)) {
2345
- GSL_TYPE(gsl_matrix) *m;
2331
+ int (*f)(const GSL_TYPE (gsl_matrix) *)) {
2332
+ GSL_TYPE(gsl_matrix) *m;
2346
2333
  Data_Get_Struct(obj, GSL_TYPE(gsl_matrix), m);
2347
2334
  if ((*f)(m)) return Qtrue;
2348
2335
  else return Qfalse;
@@ -2353,28 +2340,25 @@ static VALUE FUNCTION(rb_gsl_matrix,ispos)(VALUE obj)
2353
2340
  }
2354
2341
  static VALUE FUNCTION(rb_gsl_matrix,ispos2)(VALUE obj)
2355
2342
  {
2356
- return FUNCTION(rb_gsl_matrix,property2)(obj, FUNCTION(gsl_matrix,ispos));
2343
+ return FUNCTION(rb_gsl_matrix,property2)(obj, FUNCTION(gsl_matrix,ispos));
2357
2344
  }
2358
2345
  static VALUE FUNCTION(rb_gsl_matrix,isneg)(VALUE obj)
2359
2346
  {
2360
- return FUNCTION(rb_gsl_matrix,property)(obj, FUNCTION(gsl_matrix,isneg));
2347
+ return FUNCTION(rb_gsl_matrix,property)(obj, FUNCTION(gsl_matrix,isneg));
2361
2348
  }
2362
2349
  static VALUE FUNCTION(rb_gsl_matrix,isneg2)(VALUE obj)
2363
2350
  {
2364
- return FUNCTION(rb_gsl_matrix,property2)(obj, FUNCTION(gsl_matrix,isneg));
2351
+ return FUNCTION(rb_gsl_matrix,property2)(obj, FUNCTION(gsl_matrix,isneg));
2365
2352
  }
2366
- #endif
2367
2353
 
2368
- #ifdef GSL_1_10_LATER
2369
2354
  static VALUE FUNCTION(rb_gsl_matrix,isnonneg)(VALUE obj)
2370
2355
  {
2371
- return FUNCTION(rb_gsl_matrix,property)(obj, FUNCTION(gsl_matrix,isnonneg));
2356
+ return FUNCTION(rb_gsl_matrix,property)(obj, FUNCTION(gsl_matrix,isnonneg));
2372
2357
  }
2373
2358
  static VALUE FUNCTION(rb_gsl_matrix,isnonneg2)(VALUE obj)
2374
2359
  {
2375
- return FUNCTION(rb_gsl_matrix,property2)(obj, FUNCTION(gsl_matrix,isnonneg));
2360
+ return FUNCTION(rb_gsl_matrix,property2)(obj, FUNCTION(gsl_matrix,isnonneg));
2376
2361
  }
2377
- #endif
2378
2362
 
2379
2363
  static VALUE FUNCTION(rb_gsl_matrix,symmetrize)(VALUE obj)
2380
2364
  {
@@ -2419,26 +2403,26 @@ void FUNCTION(Init_gsl_matrix,init)(VALUE module)
2419
2403
  rb_define_singleton_method(GSL_TYPE(cgsl_matrix), "eye", FUNCTION(rb_gsl_matrix,eye), -1);
2420
2404
  rb_define_singleton_method(GSL_TYPE(cgsl_matrix), "ones", FUNCTION(rb_gsl_matrix,ones), -1);
2421
2405
  rb_define_singleton_method(GSL_TYPE(cgsl_matrix), "zeros", FUNCTION(rb_gsl_matrix,zeros), -1);
2422
- rb_define_singleton_method(GSL_TYPE(cgsl_matrix), "diagonal",
2423
- FUNCTION(rb_gsl_matrix,diagonal_singleton), -1);
2424
- rb_define_singleton_method(GSL_TYPE(cgsl_matrix), "diag",
2425
- FUNCTION(rb_gsl_matrix,diagonal_singleton), -1);
2426
- rb_define_singleton_method(GSL_TYPE(cgsl_matrix), "identity",
2427
- FUNCTION(rb_gsl_matrix,identity), 1);
2428
- rb_define_singleton_method(GSL_TYPE(cgsl_matrix), "scalar",
2429
- FUNCTION(rb_gsl_matrix,identity), 1);
2430
- rb_define_singleton_method(GSL_TYPE(cgsl_matrix), "unit",
2431
- FUNCTION(rb_gsl_matrix,identity), 1);
2432
- rb_define_singleton_method(GSL_TYPE(cgsl_matrix), "I",
2433
- FUNCTION(rb_gsl_matrix,identity), 1);
2406
+ rb_define_singleton_method(GSL_TYPE(cgsl_matrix), "diagonal",
2407
+ FUNCTION(rb_gsl_matrix,diagonal_singleton), -1);
2408
+ rb_define_singleton_method(GSL_TYPE(cgsl_matrix), "diag",
2409
+ FUNCTION(rb_gsl_matrix,diagonal_singleton), -1);
2410
+ rb_define_singleton_method(GSL_TYPE(cgsl_matrix), "identity",
2411
+ FUNCTION(rb_gsl_matrix,identity), 1);
2412
+ rb_define_singleton_method(GSL_TYPE(cgsl_matrix), "scalar",
2413
+ FUNCTION(rb_gsl_matrix,identity), 1);
2414
+ rb_define_singleton_method(GSL_TYPE(cgsl_matrix), "unit",
2415
+ FUNCTION(rb_gsl_matrix,identity), 1);
2416
+ rb_define_singleton_method(GSL_TYPE(cgsl_matrix), "I",
2417
+ FUNCTION(rb_gsl_matrix,identity), 1);
2434
2418
 
2435
2419
  /*****/
2436
- rb_define_method(GSL_TYPE(cgsl_matrix), "size1",
2437
- FUNCTION(rb_gsl_matrix,size1), 0);
2438
- rb_define_method(GSL_TYPE(cgsl_matrix), "size2",
2439
- FUNCTION(rb_gsl_matrix,size2), 0);
2440
- rb_define_method(GSL_TYPE(cgsl_matrix), "shape",
2441
- FUNCTION(rb_gsl_matrix,shape), 0);
2420
+ rb_define_method(GSL_TYPE(cgsl_matrix), "size1",
2421
+ FUNCTION(rb_gsl_matrix,size1), 0);
2422
+ rb_define_method(GSL_TYPE(cgsl_matrix), "size2",
2423
+ FUNCTION(rb_gsl_matrix,size2), 0);
2424
+ rb_define_method(GSL_TYPE(cgsl_matrix), "shape",
2425
+ FUNCTION(rb_gsl_matrix,shape), 0);
2442
2426
  rb_define_alias(GSL_TYPE(cgsl_matrix), "size", "shape");
2443
2427
 
2444
2428
  rb_define_method(GSL_TYPE(cgsl_matrix), "get", FUNCTION(rb_gsl_matrix,get), -1);
@@ -2446,238 +2430,236 @@ void FUNCTION(Init_gsl_matrix,init)(VALUE module)
2446
2430
  rb_define_method(GSL_TYPE(cgsl_matrix), "set", FUNCTION(rb_gsl_matrix,set), -1);
2447
2431
  rb_define_alias(GSL_TYPE(cgsl_matrix), "[]=", "set");
2448
2432
 
2449
- rb_define_method(GSL_TYPE(cgsl_matrix), "set_all",
2450
- FUNCTION(rb_gsl_matrix,set_all), 1);
2451
- rb_define_method(GSL_TYPE(cgsl_matrix), "set_zero",
2452
- FUNCTION(rb_gsl_matrix,set_zero), 0);
2453
- rb_define_method(GSL_TYPE(cgsl_matrix), "set_identity",
2454
- FUNCTION(rb_gsl_matrix,set_identity), 0);
2455
-
2456
- rb_define_method(GSL_TYPE(cgsl_matrix), "print",
2457
- FUNCTION(rb_gsl_matrix,print), 0);
2458
- rb_define_method(GSL_TYPE(cgsl_matrix), "inspect",
2459
- FUNCTION(rb_gsl_matrix,inspect), 0);
2460
- rb_define_method(GSL_TYPE(cgsl_matrix), "to_s",
2461
- FUNCTION(rb_gsl_matrix,to_s), 0);
2462
-
2463
- rb_define_method(GSL_TYPE(cgsl_matrix), "set_diagonal",
2464
- FUNCTION(rb_gsl_matrix,set_diagonal), 1);
2465
-
2466
- rb_define_method(GSL_TYPE(cgsl_matrix), "get_row",
2467
- FUNCTION(rb_gsl_matrix,get_row), 1);
2468
- rb_define_method(GSL_TYPE(cgsl_matrix), "get_column",
2469
- FUNCTION(rb_gsl_matrix,get_col), 1);
2433
+ rb_define_method(GSL_TYPE(cgsl_matrix), "set_all",
2434
+ FUNCTION(rb_gsl_matrix,set_all), 1);
2435
+ rb_define_method(GSL_TYPE(cgsl_matrix), "set_zero",
2436
+ FUNCTION(rb_gsl_matrix,set_zero), 0);
2437
+ rb_define_method(GSL_TYPE(cgsl_matrix), "set_identity",
2438
+ FUNCTION(rb_gsl_matrix,set_identity), 0);
2439
+
2440
+ rb_define_method(GSL_TYPE(cgsl_matrix), "print",
2441
+ FUNCTION(rb_gsl_matrix,print), 0);
2442
+ rb_define_method(GSL_TYPE(cgsl_matrix), "inspect",
2443
+ FUNCTION(rb_gsl_matrix,inspect), 0);
2444
+ rb_define_method(GSL_TYPE(cgsl_matrix), "to_s",
2445
+ FUNCTION(rb_gsl_matrix,to_s), 0);
2446
+
2447
+ rb_define_method(GSL_TYPE(cgsl_matrix), "set_diagonal",
2448
+ FUNCTION(rb_gsl_matrix,set_diagonal), 1);
2449
+
2450
+ rb_define_method(GSL_TYPE(cgsl_matrix), "get_row",
2451
+ FUNCTION(rb_gsl_matrix,get_row), 1);
2452
+ rb_define_method(GSL_TYPE(cgsl_matrix), "get_column",
2453
+ FUNCTION(rb_gsl_matrix,get_col), 1);
2470
2454
  rb_define_alias(GSL_TYPE(cgsl_matrix), "get_col", "get_column");
2471
- rb_define_method(GSL_TYPE(cgsl_matrix), "set_column",
2472
- FUNCTION(rb_gsl_matrix,set_col), 2);
2455
+ rb_define_method(GSL_TYPE(cgsl_matrix), "set_column",
2456
+ FUNCTION(rb_gsl_matrix,set_col), 2);
2473
2457
  rb_define_alias(GSL_TYPE(cgsl_matrix), "set_col", "set_column");
2474
- rb_define_method(GSL_TYPE(cgsl_matrix), "set_row",
2475
- FUNCTION(rb_gsl_matrix,set_row), 2);
2476
-
2477
- rb_define_method(GSL_TYPE(cgsl_matrix), "clone",
2478
- FUNCTION(rb_gsl_matrix,clone), 0);
2458
+ rb_define_method(GSL_TYPE(cgsl_matrix), "set_row",
2459
+ FUNCTION(rb_gsl_matrix,set_row), 2);
2460
+
2461
+ rb_define_method(GSL_TYPE(cgsl_matrix), "clone",
2462
+ FUNCTION(rb_gsl_matrix,clone), 0);
2479
2463
  rb_define_alias(GSL_TYPE(cgsl_matrix), "duplicate", "clone");
2480
2464
  rb_define_alias(GSL_TYPE(cgsl_matrix), "dup", "clone");
2481
- rb_define_method(GSL_TYPE(cgsl_matrix), "isnull",
2482
- FUNCTION(rb_gsl_matrix,isnull), 0);
2483
- rb_define_method(GSL_TYPE(cgsl_matrix), "isnull?",
2484
- FUNCTION(rb_gsl_matrix,isnull2), 0);
2485
-
2486
- rb_define_singleton_method(GSL_TYPE(cgsl_matrix), "memcpy",
2487
- FUNCTION(rb_gsl_matrix,memcpy), 2);
2488
-
2489
- rb_define_method(GSL_TYPE(cgsl_matrix), "swap_rows",
2490
- FUNCTION(rb_gsl_matrix,swap_rows), 2);
2465
+ rb_define_method(GSL_TYPE(cgsl_matrix), "isnull",
2466
+ FUNCTION(rb_gsl_matrix,isnull), 0);
2467
+ rb_define_method(GSL_TYPE(cgsl_matrix), "isnull?",
2468
+ FUNCTION(rb_gsl_matrix,isnull2), 0);
2469
+
2470
+ rb_define_singleton_method(GSL_TYPE(cgsl_matrix), "memcpy",
2471
+ FUNCTION(rb_gsl_matrix,memcpy), 2);
2472
+
2473
+ rb_define_method(GSL_TYPE(cgsl_matrix), "swap_rows",
2474
+ FUNCTION(rb_gsl_matrix,swap_rows), 2);
2491
2475
  rb_define_method(GSL_TYPE(cgsl_matrix), "swap_rows!",
2492
- FUNCTION(rb_gsl_matrix,swap_rows_bang), 2);
2476
+ FUNCTION(rb_gsl_matrix,swap_rows_bang), 2);
2493
2477
  rb_define_method(GSL_TYPE(cgsl_matrix), "swap_columns",
2494
- FUNCTION(rb_gsl_matrix,swap_columns), 2);
2478
+ FUNCTION(rb_gsl_matrix,swap_columns), 2);
2495
2479
  rb_define_alias(GSL_TYPE(cgsl_matrix), "swap_cols", "swap_columns");
2496
2480
  rb_define_method(GSL_TYPE(cgsl_matrix), "swap_columns!",
2497
- FUNCTION(rb_gsl_matrix,swap_columns_bang), 2);
2481
+ FUNCTION(rb_gsl_matrix,swap_columns_bang), 2);
2498
2482
  rb_define_alias(GSL_TYPE(cgsl_matrix), "swap_cols!", "swap_columns!");
2499
- rb_define_method(GSL_TYPE(cgsl_matrix), "swap_rowcol",
2500
- FUNCTION(rb_gsl_matrix,swap_rowcol), 2);
2501
- rb_define_method(GSL_TYPE(cgsl_matrix), "swap_rowcol!",
2502
- FUNCTION(rb_gsl_matrix,swap_rowcol_bang), 2);
2483
+ rb_define_method(GSL_TYPE(cgsl_matrix), "swap_rowcol",
2484
+ FUNCTION(rb_gsl_matrix,swap_rowcol), 2);
2485
+ rb_define_method(GSL_TYPE(cgsl_matrix), "swap_rowcol!",
2486
+ FUNCTION(rb_gsl_matrix,swap_rowcol_bang), 2);
2503
2487
  rb_define_method(GSL_TYPE(cgsl_matrix), "transpose_memcpy",
2504
- FUNCTION(rb_gsl_matrix,transpose_memcpy), 0);
2488
+ FUNCTION(rb_gsl_matrix,transpose_memcpy), 0);
2505
2489
  rb_define_alias(GSL_TYPE(cgsl_matrix), "transpose", "transpose_memcpy");
2506
2490
  rb_define_alias(GSL_TYPE(cgsl_matrix), "trans", "transpose_memcpy");
2507
- rb_define_method(GSL_TYPE(cgsl_matrix), "transpose!",
2508
- FUNCTION(rb_gsl_matrix,transpose_bang), 0);
2491
+ rb_define_method(GSL_TYPE(cgsl_matrix), "transpose!",
2492
+ FUNCTION(rb_gsl_matrix,transpose_bang), 0);
2509
2493
  rb_define_alias(GSL_TYPE(cgsl_matrix), "trans!", "transpose!");
2510
- rb_define_method(GSL_TYPE(cgsl_matrix), "reverse_columns",
2511
- FUNCTION(rb_gsl_matrix,reverse_columns), 0);
2494
+ rb_define_method(GSL_TYPE(cgsl_matrix), "reverse_columns",
2495
+ FUNCTION(rb_gsl_matrix,reverse_columns), 0);
2512
2496
  rb_define_alias(GSL_TYPE(cgsl_matrix), "fliplr", "reverse_columns");
2513
- rb_define_method(GSL_TYPE(cgsl_matrix), "reverse_columns!",
2514
- FUNCTION(rb_gsl_matrix,reverse_columns_bang), 0);
2515
- rb_define_method(GSL_TYPE(cgsl_matrix), "reverse_rows",
2516
- FUNCTION(rb_gsl_matrix,reverse_rows), 0);
2497
+ rb_define_method(GSL_TYPE(cgsl_matrix), "reverse_columns!",
2498
+ FUNCTION(rb_gsl_matrix,reverse_columns_bang), 0);
2499
+ rb_define_method(GSL_TYPE(cgsl_matrix), "reverse_rows",
2500
+ FUNCTION(rb_gsl_matrix,reverse_rows), 0);
2517
2501
  rb_define_alias(GSL_TYPE(cgsl_matrix), "flipud", "reverse_rows");
2518
- rb_define_method(GSL_TYPE(cgsl_matrix), "reverse_rows!",
2519
- FUNCTION(rb_gsl_matrix,reverse_rows_bang), 0);
2502
+ rb_define_method(GSL_TYPE(cgsl_matrix), "reverse_rows!",
2503
+ FUNCTION(rb_gsl_matrix,reverse_rows_bang), 0);
2520
2504
  /*****/
2521
- rb_define_singleton_method(GSL_TYPE(cgsl_matrix), "swap",
2522
- FUNCTION(rb_gsl_matrix,swap), 2);
2505
+ rb_define_singleton_method(GSL_TYPE(cgsl_matrix), "swap",
2506
+ FUNCTION(rb_gsl_matrix,swap), 2);
2523
2507
 
2524
2508
  rb_define_method(GSL_TYPE(cgsl_matrix), "max", FUNCTION(rb_gsl_matrix,max), 0);
2525
2509
  rb_define_method(GSL_TYPE(cgsl_matrix), "min", FUNCTION(rb_gsl_matrix,min), 0);
2526
2510
  rb_define_method(GSL_TYPE(cgsl_matrix), "minmax",
2527
- FUNCTION(rb_gsl_matrix,minmax), 0);
2511
+ FUNCTION(rb_gsl_matrix,minmax), 0);
2528
2512
  rb_define_method(GSL_TYPE(cgsl_matrix), "max_index",
2529
- FUNCTION(rb_gsl_matrix,max_index), 0);
2530
- rb_define_method(GSL_TYPE(cgsl_matrix), "min_index",
2531
- FUNCTION(rb_gsl_matrix,min_index), 0);
2513
+ FUNCTION(rb_gsl_matrix,max_index), 0);
2514
+ rb_define_method(GSL_TYPE(cgsl_matrix), "min_index",
2515
+ FUNCTION(rb_gsl_matrix,min_index), 0);
2532
2516
  rb_define_method(GSL_TYPE(cgsl_matrix), "minmax_index",
2533
- FUNCTION(rb_gsl_matrix,minmax_index), 0);
2517
+ FUNCTION(rb_gsl_matrix,minmax_index), 0);
2534
2518
 
2535
- rb_define_method(GSL_TYPE(cgsl_matrix), "fwrite",
2536
- FUNCTION(rb_gsl_matrix,fwrite), 1);
2537
- rb_define_method(GSL_TYPE(cgsl_matrix), "fread",
2538
- FUNCTION(rb_gsl_matrix,fread), 1);
2519
+ rb_define_method(GSL_TYPE(cgsl_matrix), "fwrite",
2520
+ FUNCTION(rb_gsl_matrix,fwrite), 1);
2521
+ rb_define_method(GSL_TYPE(cgsl_matrix), "fread",
2522
+ FUNCTION(rb_gsl_matrix,fread), 1);
2539
2523
  rb_define_method(GSL_TYPE(cgsl_matrix), "fprintf",
2540
- FUNCTION(rb_gsl_matrix,fprintf), -1);
2541
- rb_define_method(GSL_TYPE(cgsl_matrix), "printf",
2542
- FUNCTION(rb_gsl_matrix,printf), -1);
2524
+ FUNCTION(rb_gsl_matrix,fprintf), -1);
2525
+ rb_define_method(GSL_TYPE(cgsl_matrix), "printf",
2526
+ FUNCTION(rb_gsl_matrix,printf), -1);
2543
2527
  rb_define_method(GSL_TYPE(cgsl_matrix), "fscanf",
2544
- FUNCTION(rb_gsl_matrix,fscanf), 1);
2528
+ FUNCTION(rb_gsl_matrix,fscanf), 1);
2545
2529
 
2546
- rb_define_method(GSL_TYPE(cgsl_matrix), "trace",
2547
- FUNCTION(rb_gsl_matrix,trace), 0);
2530
+ rb_define_method(GSL_TYPE(cgsl_matrix), "trace",
2531
+ FUNCTION(rb_gsl_matrix,trace), 0);
2548
2532
 
2549
- rb_define_method(GSL_TYPE(cgsl_matrix), "-@",
2550
- FUNCTION(rb_gsl_matrix,uminus), 0);
2551
- rb_define_method(GSL_TYPE(cgsl_matrix), "+@",
2552
- FUNCTION(rb_gsl_matrix,uplus), 0);
2533
+ rb_define_method(GSL_TYPE(cgsl_matrix), "-@",
2534
+ FUNCTION(rb_gsl_matrix,uminus), 0);
2535
+ rb_define_method(GSL_TYPE(cgsl_matrix), "+@",
2536
+ FUNCTION(rb_gsl_matrix,uplus), 0);
2553
2537
 
2554
2538
 
2555
2539
  /*****/
2556
- rb_define_method(GSL_TYPE(cgsl_matrix), "submatrix",
2557
- FUNCTION(rb_gsl_matrix,submatrix), -1);
2540
+ rb_define_method(GSL_TYPE(cgsl_matrix), "submatrix",
2541
+ FUNCTION(rb_gsl_matrix,submatrix), -1);
2558
2542
  rb_define_alias(GSL_TYPE(cgsl_matrix), "view", "submatrix");
2559
2543
 
2560
2544
  rb_define_method(GSL_TYPE(cgsl_matrix), "row", FUNCTION(rb_gsl_matrix,row), 1);
2561
2545
  /* rb_define_alias(GSL_TYPE(cgsl_matrix), "[]", "row");*/
2562
- rb_define_method(GSL_TYPE(cgsl_matrix), "column",
2563
- FUNCTION(rb_gsl_matrix,column), 1);
2546
+ rb_define_method(GSL_TYPE(cgsl_matrix), "column",
2547
+ FUNCTION(rb_gsl_matrix,column), 1);
2564
2548
  rb_define_alias(GSL_TYPE(cgsl_matrix), "col", "column");
2565
2549
 
2566
- #ifdef GSL_1_10_LATER
2567
- rb_define_method(GSL_TYPE(cgsl_matrix), "subrow",
2568
- FUNCTION(rb_gsl_matrix,subrow), 3);
2569
- rb_define_method(GSL_TYPE(cgsl_matrix), "subcolumn",
2570
- FUNCTION(rb_gsl_matrix,subcolumn), 3);
2571
- rb_define_alias(GSL_TYPE(cgsl_matrix), "subcol", "subcolumn");
2572
- #endif
2550
+ rb_define_method(GSL_TYPE(cgsl_matrix), "subrow",
2551
+ FUNCTION(rb_gsl_matrix,subrow), 3);
2552
+ rb_define_method(GSL_TYPE(cgsl_matrix), "subcolumn",
2553
+ FUNCTION(rb_gsl_matrix,subcolumn), 3);
2554
+ rb_define_alias(GSL_TYPE(cgsl_matrix), "subcol", "subcolumn");
2573
2555
 
2574
- rb_define_method(GSL_TYPE(cgsl_matrix), "diagonal",
2575
- FUNCTION(rb_gsl_matrix,diagonal), 0);
2556
+ rb_define_method(GSL_TYPE(cgsl_matrix), "diagonal",
2557
+ FUNCTION(rb_gsl_matrix,diagonal), 0);
2576
2558
  rb_define_alias(GSL_TYPE(cgsl_matrix), "diag", "diagonal");
2577
2559
 
2578
- rb_define_method(GSL_TYPE(cgsl_matrix), "subdiagonal",
2579
- FUNCTION(rb_gsl_matrix,subdiagonal), 1);
2580
- rb_define_method(GSL_TYPE(cgsl_matrix), "superdiagonal",
2581
- FUNCTION(rb_gsl_matrix,superdiagonal), 1);
2582
- rb_define_method(GSL_TYPE(cgsl_matrix), "vector_view",
2583
- FUNCTION(rb_gsl_matrix,vector_view), 0);
2560
+ rb_define_method(GSL_TYPE(cgsl_matrix), "subdiagonal",
2561
+ FUNCTION(rb_gsl_matrix,subdiagonal), 1);
2562
+ rb_define_method(GSL_TYPE(cgsl_matrix), "superdiagonal",
2563
+ FUNCTION(rb_gsl_matrix,superdiagonal), 1);
2564
+ rb_define_method(GSL_TYPE(cgsl_matrix), "vector_view",
2565
+ FUNCTION(rb_gsl_matrix,vector_view), 0);
2584
2566
 
2585
- rb_define_method(GSL_TYPE(cgsl_matrix), "each_row",
2586
- FUNCTION(rb_gsl_matrix,each_row), 0);
2567
+ rb_define_method(GSL_TYPE(cgsl_matrix), "each_row",
2568
+ FUNCTION(rb_gsl_matrix,each_row), 0);
2587
2569
  rb_define_method(GSL_TYPE(cgsl_matrix), "each_col",
2588
- FUNCTION(rb_gsl_matrix,each_col), 0);
2570
+ FUNCTION(rb_gsl_matrix,each_col), 0);
2589
2571
  rb_define_alias(GSL_TYPE(cgsl_matrix), "each_column", "each_col");
2590
2572
 
2591
- rb_define_method(GSL_TYPE(cgsl_matrix), "scale",
2592
- FUNCTION(rb_gsl_matrix,scale), 1);
2573
+ rb_define_method(GSL_TYPE(cgsl_matrix), "scale",
2574
+ FUNCTION(rb_gsl_matrix,scale), 1);
2593
2575
  rb_define_method(GSL_TYPE(cgsl_matrix), "scale!",
2594
- FUNCTION(rb_gsl_matrix,scale_bang), 1);
2576
+ FUNCTION(rb_gsl_matrix,scale_bang), 1);
2595
2577
  rb_define_method(GSL_TYPE(cgsl_matrix), "add_constant",
2596
- FUNCTION(rb_gsl_matrix,add_constant), 1);
2597
- rb_define_method(GSL_TYPE(cgsl_matrix), "add_constant!",
2598
- FUNCTION(rb_gsl_matrix,add_constant_bang), 1);
2578
+ FUNCTION(rb_gsl_matrix,add_constant), 1);
2579
+ rb_define_method(GSL_TYPE(cgsl_matrix), "add_constant!",
2580
+ FUNCTION(rb_gsl_matrix,add_constant_bang), 1);
2599
2581
 
2600
- rb_define_method(GSL_TYPE(cgsl_matrix), "equal?",
2601
- FUNCTION(rb_gsl_matrix,equal), -1);
2582
+ rb_define_method(GSL_TYPE(cgsl_matrix), "equal?",
2583
+ FUNCTION(rb_gsl_matrix,equal), -1);
2602
2584
  rb_define_alias(GSL_TYPE(cgsl_matrix), "==", "equal?");
2603
- rb_define_singleton_method(GSL_TYPE(cgsl_matrix), "equal?",
2604
- FUNCTION(rb_gsl_matrix,equal_singleton), -1);
2585
+ rb_define_singleton_method(GSL_TYPE(cgsl_matrix), "equal?",
2586
+ FUNCTION(rb_gsl_matrix,equal_singleton), -1);
2605
2587
 
2606
- rb_define_method(GSL_TYPE(cgsl_matrix), "power",
2607
- FUNCTION(rb_gsl_matrix,power), 1);
2588
+ rb_define_method(GSL_TYPE(cgsl_matrix), "power",
2589
+ FUNCTION(rb_gsl_matrix,power), 1);
2608
2590
  rb_define_alias(GSL_TYPE(cgsl_matrix), "**", "power");
2609
2591
  rb_define_alias(GSL_TYPE(cgsl_matrix), "^", "power");
2610
2592
 
2611
- rb_define_method(GSL_TYPE(cgsl_matrix), "collect",
2612
- FUNCTION(rb_gsl_matrix,collect), 0);
2613
- rb_define_method(GSL_TYPE(cgsl_matrix), "collect!",
2614
- FUNCTION(rb_gsl_matrix,collect_bang), 0);
2593
+ rb_define_method(GSL_TYPE(cgsl_matrix), "collect",
2594
+ FUNCTION(rb_gsl_matrix,collect), 0);
2595
+ rb_define_method(GSL_TYPE(cgsl_matrix), "collect!",
2596
+ FUNCTION(rb_gsl_matrix,collect_bang), 0);
2615
2597
  rb_define_alias(GSL_TYPE(cgsl_matrix), "map", "collect");
2616
2598
  rb_define_alias(GSL_TYPE(cgsl_matrix), "map!", "collect!");
2617
2599
  #ifdef HAVE_TENSOR_TENSOR_H
2618
- rb_define_method(GSL_TYPE(cgsl_matrix), "to_tensor",
2619
- FUNCTION(rb_gsl_matrix,to_tensor), 0);
2600
+ rb_define_method(GSL_TYPE(cgsl_matrix), "to_tensor",
2601
+ FUNCTION(rb_gsl_matrix,to_tensor), 0);
2620
2602
  #endif
2621
2603
 
2622
2604
  /*****/
2623
2605
 
2624
- rb_define_method(GSL_TYPE(cgsl_matrix), "to_a",
2625
- FUNCTION(rb_gsl_matrix,to_a), 0);
2626
- rb_define_method(GSL_TYPE(cgsl_matrix), "to_v",
2627
- FUNCTION(rb_gsl_matrix,to_v), 0);
2628
- rb_define_method(GSL_TYPE(cgsl_matrix), "to_vview",
2629
- FUNCTION(rb_gsl_matrix,to_vview), 0);
2606
+ rb_define_method(GSL_TYPE(cgsl_matrix), "to_a",
2607
+ FUNCTION(rb_gsl_matrix,to_a), 0);
2608
+ rb_define_method(GSL_TYPE(cgsl_matrix), "to_v",
2609
+ FUNCTION(rb_gsl_matrix,to_v), 0);
2610
+ rb_define_method(GSL_TYPE(cgsl_matrix), "to_vview",
2611
+ FUNCTION(rb_gsl_matrix,to_vview), 0);
2630
2612
  rb_define_alias(GSL_TYPE(cgsl_matrix), "data", "to_vview");
2631
2613
  rb_define_method(GSL_TYPE(cgsl_matrix), "norm",
2632
- FUNCTION(rb_gsl_matrix,norm), 0);
2614
+ FUNCTION(rb_gsl_matrix,norm), 0);
2633
2615
 
2634
- rb_define_method(GSL_TYPE(cgsl_matrix), "upper",
2635
- FUNCTION(rb_gsl_matrix,upper), 0);
2636
- rb_define_method(GSL_TYPE(cgsl_matrix), "lower",
2637
- FUNCTION(rb_gsl_matrix,lower), 0);
2638
- rb_define_method(GSL_TYPE(cgsl_matrix), "block",
2639
- FUNCTION(rb_gsl_matrix,block), 0);
2616
+ rb_define_method(GSL_TYPE(cgsl_matrix), "upper",
2617
+ FUNCTION(rb_gsl_matrix,upper), 0);
2618
+ rb_define_method(GSL_TYPE(cgsl_matrix), "lower",
2619
+ FUNCTION(rb_gsl_matrix,lower), 0);
2620
+ rb_define_method(GSL_TYPE(cgsl_matrix), "block",
2621
+ FUNCTION(rb_gsl_matrix,block), 0);
2640
2622
 
2641
2623
  /***** Special matrices *****/
2642
2624
  rb_define_singleton_method(GSL_TYPE(cgsl_matrix), "pascal",
2643
- FUNCTION(rb_gsl_matrix,pascal1), 1);
2644
- rb_define_singleton_method(GSL_TYPE(cgsl_matrix), "vandermonde",
2645
- FUNCTION(rb_gsl_matrix,vandermonde), 1);
2625
+ FUNCTION(rb_gsl_matrix,pascal1), 1);
2626
+ rb_define_singleton_method(GSL_TYPE(cgsl_matrix), "vandermonde",
2627
+ FUNCTION(rb_gsl_matrix,vandermonde), 1);
2646
2628
  rb_define_singleton_method(GSL_TYPE(cgsl_matrix), "vander",
2647
- FUNCTION(rb_gsl_matrix,vandermonde), 1);
2648
- rb_define_singleton_method(GSL_TYPE(cgsl_matrix), "toeplitz",
2649
- FUNCTION(rb_gsl_matrix,toeplitz), 1);
2650
- rb_define_singleton_method(GSL_TYPE(cgsl_matrix), "circulant",
2651
- FUNCTION(rb_gsl_matrix,circulant), 1);
2629
+ FUNCTION(rb_gsl_matrix,vandermonde), 1);
2630
+ rb_define_singleton_method(GSL_TYPE(cgsl_matrix), "toeplitz",
2631
+ FUNCTION(rb_gsl_matrix,toeplitz), 1);
2632
+ rb_define_singleton_method(GSL_TYPE(cgsl_matrix), "circulant",
2633
+ FUNCTION(rb_gsl_matrix,circulant), 1);
2652
2634
  rb_define_singleton_method(GSL_TYPE(cgsl_matrix), "indgen",
2653
- FUNCTION(rb_gsl_matrix,indgen_singleton), -1);
2654
- rb_define_method(GSL_TYPE(cgsl_matrix), "indgen",
2655
- FUNCTION(rb_gsl_matrix,indgen), -1);
2656
- rb_define_method(GSL_TYPE(cgsl_matrix), "indgen!",
2657
- FUNCTION(rb_gsl_matrix,indgen_bang), -1);
2658
-
2659
- rb_define_method(GSL_TYPE(cgsl_matrix), "info",
2660
- FUNCTION(rb_gsl_matrix,info), 0);
2635
+ FUNCTION(rb_gsl_matrix,indgen_singleton), -1);
2636
+ rb_define_method(GSL_TYPE(cgsl_matrix), "indgen",
2637
+ FUNCTION(rb_gsl_matrix,indgen), -1);
2638
+ rb_define_method(GSL_TYPE(cgsl_matrix), "indgen!",
2639
+ FUNCTION(rb_gsl_matrix,indgen_bang), -1);
2640
+
2641
+ rb_define_method(GSL_TYPE(cgsl_matrix), "info",
2642
+ FUNCTION(rb_gsl_matrix,info), 0);
2661
2643
  #ifdef BASE_DOUBLE
2662
- rb_define_singleton_method(GSL_TYPE(cgsl_matrix), "hilbert",
2663
- FUNCTION(rb_gsl_matrix,hilbert), 1);
2664
- rb_define_singleton_method(GSL_TYPE(cgsl_matrix), "hilb",
2665
- FUNCTION(rb_gsl_matrix,hilbert), 1);
2666
- rb_define_singleton_method(GSL_TYPE(cgsl_matrix), "invhilbert",
2667
- FUNCTION(rb_gsl_matrix,invhilbert), 1);
2668
- rb_define_singleton_method(GSL_TYPE(cgsl_matrix), "invhilb",
2669
- FUNCTION(rb_gsl_matrix,invhilbert), 1);
2644
+ rb_define_singleton_method(GSL_TYPE(cgsl_matrix), "hilbert",
2645
+ FUNCTION(rb_gsl_matrix,hilbert), 1);
2646
+ rb_define_singleton_method(GSL_TYPE(cgsl_matrix), "hilb",
2647
+ FUNCTION(rb_gsl_matrix,hilbert), 1);
2648
+ rb_define_singleton_method(GSL_TYPE(cgsl_matrix), "invhilbert",
2649
+ FUNCTION(rb_gsl_matrix,invhilbert), 1);
2650
+ rb_define_singleton_method(GSL_TYPE(cgsl_matrix), "invhilb",
2651
+ FUNCTION(rb_gsl_matrix,invhilbert), 1);
2670
2652
  #endif
2671
2653
 
2672
- rb_define_method(GSL_TYPE(cgsl_matrix), "any",
2673
- FUNCTION(rb_gsl_matrix,any), 0);
2674
- rb_define_method(GSL_TYPE(cgsl_matrix), "all",
2675
- FUNCTION(rb_gsl_matrix,all), 0);
2676
- rb_define_method(GSL_TYPE(cgsl_matrix), "rot90",
2677
- FUNCTION(rb_gsl_matrix,rot90), -1);
2654
+ rb_define_method(GSL_TYPE(cgsl_matrix), "any",
2655
+ FUNCTION(rb_gsl_matrix,any), 0);
2656
+ rb_define_method(GSL_TYPE(cgsl_matrix), "all",
2657
+ FUNCTION(rb_gsl_matrix,all), 0);
2658
+ rb_define_method(GSL_TYPE(cgsl_matrix), "rot90",
2659
+ FUNCTION(rb_gsl_matrix,rot90), -1);
2678
2660
 
2679
- rb_define_method(GSL_TYPE(cgsl_matrix), "diff",
2680
- FUNCTION(rb_gsl_matrix,diff), -1);
2661
+ rb_define_method(GSL_TYPE(cgsl_matrix), "diff",
2662
+ FUNCTION(rb_gsl_matrix,diff), -1);
2681
2663
  rb_define_method(GSL_TYPE(cgsl_matrix), "isnan", FUNCTION(rb_gsl_matrix,isnan), 0);
2682
2664
  rb_define_method(GSL_TYPE(cgsl_matrix), "isinf", FUNCTION(rb_gsl_matrix,isinf), 0);
2683
2665
  rb_define_method(GSL_TYPE(cgsl_matrix), "finite", FUNCTION(rb_gsl_matrix,finite), 0);
@@ -2694,17 +2676,13 @@ void FUNCTION(Init_gsl_matrix,init)(VALUE module)
2694
2676
  rb_define_method(GSL_TYPE(cgsl_matrix), "vertcat", FUNCTION(rb_gsl_matrix,vertcat), 1);
2695
2677
  rb_define_singleton_method(GSL_TYPE(cgsl_matrix), "vertcat", FUNCTION(rb_gsl_matrix,vertcat_singleton), 2);
2696
2678
 
2697
- #ifdef GSL_1_9_LATER
2698
2679
  rb_define_method(GSL_TYPE(cgsl_matrix), "ispos", FUNCTION(rb_gsl_matrix,ispos), 0);
2699
- rb_define_method(GSL_TYPE(cgsl_matrix), "ispos?", FUNCTION(rb_gsl_matrix,ispos2), 0);
2680
+ rb_define_method(GSL_TYPE(cgsl_matrix), "ispos?", FUNCTION(rb_gsl_matrix,ispos2), 0);
2700
2681
  rb_define_method(GSL_TYPE(cgsl_matrix), "isneg", FUNCTION(rb_gsl_matrix,isneg), 0);
2701
- rb_define_method(GSL_TYPE(cgsl_matrix), "isneg?", FUNCTION(rb_gsl_matrix,isneg2), 0);
2702
- #endif
2682
+ rb_define_method(GSL_TYPE(cgsl_matrix), "isneg?", FUNCTION(rb_gsl_matrix,isneg2), 0);
2703
2683
 
2704
- #ifdef GSL_1_10_LATER
2705
2684
  rb_define_method(GSL_TYPE(cgsl_matrix), "isnonneg", FUNCTION(rb_gsl_matrix,isnonneg), 0);
2706
2685
  rb_define_method(GSL_TYPE(cgsl_matrix), "isnonneg?", FUNCTION(rb_gsl_matrix,isnonneg2), 0);
2707
- #endif
2708
2686
 
2709
2687
  rb_define_method(GSL_TYPE(cgsl_matrix), "symmetrize", FUNCTION(rb_gsl_matrix,symmetrize), 0);
2710
2688
  rb_define_method(GSL_TYPE(cgsl_matrix), "symmetrize!", FUNCTION(rb_gsl_matrix,symmetrize_bang), 0);