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
@@ -18,21 +18,19 @@
18
18
  #include "include/rb_gsl_histogram.h"
19
19
  #include "include/rb_gsl_complex.h"
20
20
  #include "include/rb_gsl_poly.h"
21
- #ifdef HAVE_NARRAY_H
22
21
  #include "include/rb_gsl_with_narray.h"
23
- #endif
24
22
 
25
- int gsl_linalg_matmult_int(const gsl_matrix_int *A,
26
- const gsl_matrix_int *B, gsl_matrix_int *C);
23
+ int gsl_linalg_matmult_int(const gsl_matrix_int *A,
24
+ const gsl_matrix_int *B, gsl_matrix_int *C);
27
25
 
28
26
  #define BASE_DOUBLE
29
27
  #include "include/templates_on.h"
30
- #include "matrix_source.c"
28
+ #include "matrix_source.h"
31
29
  #include "include/templates_off.h"
32
30
  #undef BASE_DOUBLE
33
31
 
34
32
  #define BASE_INT
35
33
  #include "include/templates_on.h"
36
- #include "matrix_source.c"
34
+ #include "matrix_source.h"
37
35
  #include "include/templates_off.h"
38
36
  #undef BASE_INT
@@ -27,7 +27,7 @@ void get_range_beg_en_n(VALUE range, double *beg, double *en, size_t *n, int *st
27
27
 
28
28
  // From ext/matrix_source.c
29
29
  void parse_submatrix_args(int argc, VALUE *argv, size_t size1, size_t size2,
30
- size_t *i, size_t *j, size_t *n1, size_t *n2);
30
+ size_t *i, size_t *j, size_t *n1, size_t *n2);
31
31
 
32
32
  static VALUE rb_gsl_matrix_complex_arithmetics(int flag, VALUE obj, VALUE bb)
33
33
  {
@@ -73,28 +73,28 @@ static VALUE rb_gsl_matrix_complex_arithmetics(int flag, VALUE obj, VALUE bb)
73
73
  Data_Get_Struct(bb, gsl_matrix_complex, cmb);
74
74
  switch (flag) {
75
75
  case GSL_MATRIX_COMPLEX_ADD:
76
- cmnew = make_matrix_complex_clone(cm);
77
- gsl_matrix_complex_add(cmnew, cmb);
78
- return Data_Wrap_Struct(cgsl_matrix_complex, 0, gsl_matrix_complex_free, cmnew);
79
- break;
76
+ cmnew = make_matrix_complex_clone(cm);
77
+ gsl_matrix_complex_add(cmnew, cmb);
78
+ return Data_Wrap_Struct(cgsl_matrix_complex, 0, gsl_matrix_complex_free, cmnew);
79
+ break;
80
80
  case GSL_MATRIX_COMPLEX_SUB:
81
- cmnew = make_matrix_complex_clone(cm);
82
- gsl_matrix_complex_sub(cmnew,cmb);
83
- return Data_Wrap_Struct(cgsl_matrix_complex, 0, gsl_matrix_complex_free, cmnew);
84
- break;
81
+ cmnew = make_matrix_complex_clone(cm);
82
+ gsl_matrix_complex_sub(cmnew,cmb);
83
+ return Data_Wrap_Struct(cgsl_matrix_complex, 0, gsl_matrix_complex_free, cmnew);
84
+ break;
85
85
  case GSL_MATRIX_COMPLEX_MUL:
86
- cmnew = make_matrix_complex_clone(cm);
87
- gsl_matrix_complex_mul_elements(cmnew, cmb);
88
- return Data_Wrap_Struct(cgsl_matrix_complex, 0, gsl_matrix_complex_free, cmnew);
89
- break;
86
+ cmnew = make_matrix_complex_clone(cm);
87
+ gsl_matrix_complex_mul_elements(cmnew, cmb);
88
+ return Data_Wrap_Struct(cgsl_matrix_complex, 0, gsl_matrix_complex_free, cmnew);
89
+ break;
90
90
  case GSL_MATRIX_COMPLEX_DIV:
91
- cmnew = make_matrix_complex_clone(cm);
92
- gsl_matrix_complex_div_elements(cmnew, cmb);
93
- return Data_Wrap_Struct(cgsl_matrix_complex, 0, gsl_matrix_complex_free, cmnew);
94
- break;
91
+ cmnew = make_matrix_complex_clone(cm);
92
+ gsl_matrix_complex_div_elements(cmnew, cmb);
93
+ return Data_Wrap_Struct(cgsl_matrix_complex, 0, gsl_matrix_complex_free, cmnew);
94
+ break;
95
95
  default:
96
- rb_raise(rb_eRuntimeError, "operation not defined");
97
- break;
96
+ rb_raise(rb_eRuntimeError, "operation not defined");
97
+ break;
98
98
  }
99
99
  } else if (rb_obj_is_kind_of(bb, cgsl_matrix)) {
100
100
  Data_Get_Struct(bb, gsl_matrix, m);
@@ -102,80 +102,80 @@ static VALUE rb_gsl_matrix_complex_arithmetics(int flag, VALUE obj, VALUE bb)
102
102
  cmnew = make_matrix_complex_clone(cm);
103
103
  switch (flag) {
104
104
  case GSL_MATRIX_COMPLEX_ADD:
105
- gsl_matrix_complex_add(cmnew, cmb);
106
- break;
105
+ gsl_matrix_complex_add(cmnew, cmb);
106
+ break;
107
107
  case GSL_MATRIX_COMPLEX_SUB:
108
- gsl_matrix_complex_sub(cmnew,cmb);
109
- break;
108
+ gsl_matrix_complex_sub(cmnew,cmb);
109
+ break;
110
110
  case GSL_MATRIX_COMPLEX_MUL:
111
- gsl_matrix_complex_mul_elements(cmnew, cmb);
112
- break;
111
+ gsl_matrix_complex_mul_elements(cmnew, cmb);
112
+ break;
113
113
  case GSL_MATRIX_COMPLEX_DIV:
114
- gsl_matrix_complex_div_elements(cmnew, cmb);
115
- break;
114
+ gsl_matrix_complex_div_elements(cmnew, cmb);
115
+ break;
116
116
  default:
117
- rb_raise(rb_eRuntimeError, "operation not defined");
118
- break;
117
+ rb_raise(rb_eRuntimeError, "operation not defined");
118
+ break;
119
119
  }
120
120
  return Data_Wrap_Struct(cgsl_matrix_complex, 0, gsl_matrix_complex_free, cmnew);
121
121
  } else if (rb_obj_is_kind_of(bb, cgsl_complex)) {
122
122
  Data_Get_Struct(bb, gsl_complex, c);
123
123
  switch (flag) {
124
124
  case GSL_MATRIX_COMPLEX_ADD:
125
- cmnew = make_matrix_complex_clone(cm);
126
- gsl_matrix_complex_add_constant(cmnew, *c);
127
- break;
125
+ cmnew = make_matrix_complex_clone(cm);
126
+ gsl_matrix_complex_add_constant(cmnew, *c);
127
+ break;
128
128
  case GSL_MATRIX_COMPLEX_SUB:
129
- cmnew = make_matrix_complex_clone(cm);
130
- gsl_matrix_complex_add_constant(cmnew, gsl_complex_negative(*c));
131
- break;
129
+ cmnew = make_matrix_complex_clone(cm);
130
+ gsl_matrix_complex_add_constant(cmnew, gsl_complex_negative(*c));
131
+ break;
132
132
  case GSL_MATRIX_COMPLEX_MUL:
133
- cmnew = make_matrix_complex_clone(cm);
134
- gsl_matrix_complex_scale(cmnew, *c);
135
- break;
133
+ cmnew = make_matrix_complex_clone(cm);
134
+ gsl_matrix_complex_scale(cmnew, *c);
135
+ break;
136
136
  case GSL_MATRIX_COMPLEX_DIV:
137
- cmnew = make_matrix_complex_clone(cm);
138
- gsl_matrix_complex_scale(cmnew, gsl_complex_inverse(*c));
139
- break;
137
+ cmnew = make_matrix_complex_clone(cm);
138
+ gsl_matrix_complex_scale(cmnew, gsl_complex_inverse(*c));
139
+ break;
140
140
  default:
141
- rb_raise(rb_eRuntimeError, "operation not defined");
142
- break;
141
+ rb_raise(rb_eRuntimeError, "operation not defined");
142
+ break;
143
143
  }
144
144
  return Data_Wrap_Struct(cgsl_matrix_complex, 0, gsl_matrix_complex_free, cmnew);
145
145
  } else if (rb_obj_is_kind_of(bb, cgsl_vector)) {
146
146
  Data_Get_Struct(bb, gsl_vector, v);
147
147
  switch (flag) {
148
148
  case GSL_MATRIX_COMPLEX_MUL:
149
- cvb = vector_to_complex(v);
150
- cvnew = gsl_vector_complex_alloc(v->size);
151
- if (cvnew == NULL) rb_raise(rb_eNoMemError, "gsl_vector_complex_alloc failed");
152
- gsl_matrix_complex_mul_vector(cvnew, cm, cvb);
153
- gsl_vector_complex_free(cvb);
154
- return Data_Wrap_Struct(cgsl_vector_complex, 0, gsl_vector_complex_free, cvnew);
155
- break;
149
+ cvb = vector_to_complex(v);
150
+ cvnew = gsl_vector_complex_alloc(v->size);
151
+ if (cvnew == NULL) rb_raise(rb_eNoMemError, "gsl_vector_complex_alloc failed");
152
+ gsl_matrix_complex_mul_vector(cvnew, cm, cvb);
153
+ gsl_vector_complex_free(cvb);
154
+ return Data_Wrap_Struct(cgsl_vector_complex, 0, gsl_vector_complex_free, cvnew);
155
+ break;
156
156
  default:
157
- rb_raise(rb_eRuntimeError,
158
- "operation is not defined %s and Matrix_Complex",
159
- rb_class2name(CLASS_OF(bb)));
160
- break;
157
+ rb_raise(rb_eRuntimeError,
158
+ "operation is not defined %s and Matrix_Complex",
159
+ rb_class2name(CLASS_OF(bb)));
160
+ break;
161
161
  }
162
162
  } else if (rb_obj_is_kind_of(bb, cgsl_vector_complex)) {
163
163
  if (!VECTOR_COMPLEX_COL_P(bb))
164
- rb_raise(rb_eTypeError,
165
- "Operation is not defined with %s (Vector::Complex::Col expected)",
166
- rb_class2name(CLASS_OF(bb)));
164
+ rb_raise(rb_eTypeError,
165
+ "Operation is not defined with %s (Vector::Complex::Col expected)",
166
+ rb_class2name(CLASS_OF(bb)));
167
167
  Data_Get_Struct(bb, gsl_vector_complex, cv);
168
168
  switch (flag) {
169
169
  case GSL_MATRIX_COMPLEX_MUL:
170
- cvnew = gsl_vector_complex_alloc(cv->size);
171
- if (cvnew == NULL) rb_raise(rb_eNoMemError, "gsl_vector_complex_alloc failed");
172
- gsl_matrix_complex_mul_vector(cvnew, cm, cv);
173
- return Data_Wrap_Struct(cgsl_vector_complex_col, 0, gsl_vector_complex_free, cvnew);;
170
+ cvnew = gsl_vector_complex_alloc(cv->size);
171
+ if (cvnew == NULL) rb_raise(rb_eNoMemError, "gsl_vector_complex_alloc failed");
172
+ gsl_matrix_complex_mul_vector(cvnew, cm, cv);
173
+ return Data_Wrap_Struct(cgsl_vector_complex_col, 0, gsl_vector_complex_free, cvnew);
174
174
  default:
175
- rb_raise(rb_eRuntimeError,
176
- "operation is not defined %s and Matrix_Complex",
177
- rb_class2name(CLASS_OF(bb)));
178
- break;
175
+ rb_raise(rb_eRuntimeError,
176
+ "operation is not defined %s and Matrix_Complex",
177
+ rb_class2name(CLASS_OF(bb)));
178
+ break;
179
179
  }
180
180
  } else {
181
181
  rb_raise(rb_eTypeError, "wrong argument type %s", rb_class2name(CLASS_OF(bb)));
@@ -218,15 +218,15 @@ static VALUE rb_gsl_matrix_complex_eye(int argc, VALUE *argv, VALUE klass)
218
218
  // if (RARRAY(argv[1])->len < 2) rb_raise(rb_eArgError, "wrong argument");
219
219
  if (RARRAY_LEN(argv[1]) < 2) rb_raise(rb_eArgError, "wrong argument");
220
220
  z = gsl_complex_rect(NUM2DBL(rb_ary_entry(argv[1], 0)),
221
- NUM2DBL(rb_ary_entry(argv[1], 1)));
221
+ NUM2DBL(rb_ary_entry(argv[1], 1)));
222
222
  break;
223
223
  default:
224
224
  if (rb_obj_is_kind_of(argv[1], cgsl_complex)) {
225
- Data_Get_Struct(argv[1], gsl_complex, pz);
225
+ Data_Get_Struct(argv[1], gsl_complex, pz);
226
226
  z = *pz;
227
227
  } else {
228
- rb_raise(rb_eTypeError,
229
- "wrong argument type %s", rb_class2name(CLASS_OF(argv[1])));
228
+ rb_raise(rb_eTypeError,
229
+ "wrong argument type %s", rb_class2name(CLASS_OF(argv[1])));
230
230
  }
231
231
  break;
232
232
  }
@@ -244,7 +244,7 @@ static VALUE rb_gsl_matrix_complex_eye(int argc, VALUE *argv, VALUE klass)
244
244
  m = gsl_matrix_complex_calloc(n, n);
245
245
  if (m == NULL) rb_raise(rb_eNoMemError, "gsl_matrix_complex_alloc failed");
246
246
  for (i = 0; i < n; i++) gsl_matrix_complex_set(m, i, i, z);
247
- return Data_Wrap_Struct(klass, 0, gsl_matrix_complex_free, m);
247
+ return Data_Wrap_Struct(klass, 0, gsl_matrix_complex_free, m);
248
248
  }
249
249
 
250
250
  static VALUE rb_gsl_matrix_complex_identity(VALUE klass, VALUE nn)
@@ -258,7 +258,7 @@ static VALUE rb_gsl_matrix_complex_identity(VALUE klass, VALUE nn)
258
258
  if (m == NULL) rb_raise(rb_eNoMemError, "gsl_matrix_complex_calloc failed");
259
259
  z = gsl_complex_rect(1.0, 0.0);
260
260
  for (i = 0; i < n; i++) gsl_matrix_complex_set(m, i, i, z);
261
- return Data_Wrap_Struct(klass, 0, gsl_matrix_complex_free, m);
261
+ return Data_Wrap_Struct(klass, 0, gsl_matrix_complex_free, m);
262
262
  }
263
263
 
264
264
  static VALUE rb_gsl_matrix_complex_set_zero(VALUE obj)
@@ -300,8 +300,8 @@ static VALUE rb_gsl_matrix_complex_set_all(VALUE obj, VALUE s)
300
300
  Data_Get_Struct(s, gsl_complex, z);
301
301
  gsl_matrix_complex_set_all(m, *z);
302
302
  } else {
303
- rb_raise(rb_eTypeError,
304
- "wrong argument type %s", rb_class2name(CLASS_OF(s)));
303
+ rb_raise(rb_eTypeError,
304
+ "wrong argument type %s", rb_class2name(CLASS_OF(s)));
305
305
  }
306
306
  break;
307
307
  }
@@ -323,7 +323,6 @@ static VALUE rb_gsl_matrix_complex_set(int argc, VALUE *argv, VALUE obj)
323
323
  if(argc < 1 || argc > 5) {
324
324
  rb_raise(rb_eArgError, "wrong number of arguments (%d for 1-5)", argc);
325
325
  }
326
-
327
326
  Data_Get_Struct(obj, gsl_matrix_complex, m);
328
327
  other = argv[argc-1];
329
328
 
@@ -357,7 +356,7 @@ static VALUE rb_gsl_matrix_complex_set(int argc, VALUE *argv, VALUE obj)
357
356
  Data_Get_Struct(other, gsl_matrix_complex, mother);
358
357
  if(n1 * n2 != mother->size1 * mother->size2) {
359
358
  rb_raise(rb_eRangeError, "sizes do not match (%d x %d != %d x %d)",
360
- (int) n1, (int) n2, (int) mother->size1, (int) mother->size2);
359
+ (int) n1, (int) n2, (int) mother->size1, (int) mother->size2);
361
360
  }
362
361
  // TODO Change to gsl_matrix_memmove if/when GSL has such a function
363
362
  // because gsl_matrix_memcpy does not handle overlapping regions (e.g.
@@ -375,7 +374,7 @@ static VALUE rb_gsl_matrix_complex_set(int argc, VALUE *argv, VALUE obj)
375
374
  // m[...] = [[row0], [row1], ...] # multiple rows
376
375
  if((int) n1 != RARRAY_LEN(other)) {
377
376
  rb_raise(rb_eRangeError, "row counts do not match (%d != %d)",
378
- (int) n1, (int) RARRAY_LEN(other));
377
+ (int) n1, (int) RARRAY_LEN(other));
379
378
  }
380
379
  for(k = 0; k < n1; k++) {
381
380
  vv = gsl_matrix_complex_row(&mv.matrix, k);
@@ -399,7 +398,6 @@ static VALUE rb_gsl_matrix_complex_set(int argc, VALUE *argv, VALUE obj)
399
398
  gsl_matrix_complex_set_all(&mv.matrix, rb_gsl_obj_to_gsl_complex(other, NULL));
400
399
  }
401
400
  }
402
-
403
401
  return obj;
404
402
  }
405
403
 
@@ -409,7 +407,7 @@ static VALUE rb_gsl_matrix_complex_set_row(int argc, VALUE *argv, VALUE obj)
409
407
  size_t i, k;
410
408
  gsl_complex z, *pz = &z;
411
409
  if (argc < 2) rb_raise(rb_eArgError, "wrong number of arguments (%d for >= 2)",
412
- argc);
410
+ argc);
413
411
  CHECK_FIXNUM(argv[0]);
414
412
  Data_Get_Struct(obj, gsl_matrix_complex, A);
415
413
  i = FIX2INT(argv[0]);
@@ -436,7 +434,7 @@ static VALUE rb_gsl_matrix_complex_set_col(int argc, VALUE *argv, VALUE obj)
436
434
  int j, k;
437
435
  gsl_complex z, *pz = &z;
438
436
  if (argc < 2) rb_raise(rb_eArgError, "wrong number of arguments (%d for >= 2)",
439
- argc);
437
+ argc);
440
438
  CHECK_FIXNUM(argv[0]);
441
439
  Data_Get_Struct(obj, gsl_matrix_complex, A);
442
440
  j = FIX2INT(argv[0]);
@@ -473,7 +471,7 @@ static VALUE rb_gsl_matrix_complex_get(int argc, VALUE *argv, VALUE obj)
473
471
  if(ii < 0) ii += m->size1;
474
472
  if(ij < 0) ij += m->size2;
475
473
  c = ALLOC(gsl_complex);
476
- *c = gsl_matrix_complex_get(m, (size_t)ii, (size_t)ij);
474
+ *c = gsl_matrix_complex_get(m, (size_t)ii, (size_t)ij);
477
475
  retval = Data_Wrap_Struct(cgsl_complex, 0, free, c);
478
476
  } else if(argc == 1 && TYPE(argv[0]) == T_FIXNUM) {
479
477
  // m[i]
@@ -492,7 +490,7 @@ static VALUE rb_gsl_matrix_complex_get(int argc, VALUE *argv, VALUE obj)
492
490
  if(ii < 0) ii += m->size1;
493
491
  if(ij < 0) ij += m->size2;
494
492
  c = ALLOC(gsl_complex);
495
- *c = gsl_matrix_complex_get(m, (size_t)ii, (size_t)ij);
493
+ *c = gsl_matrix_complex_get(m, (size_t)ii, (size_t)ij);
496
494
  retval = Data_Wrap_Struct(cgsl_complex, 0, free, c);
497
495
  } else {
498
496
  rb_raise(rb_eArgError, "Array index must have length 2, not %d", (int) RARRAY_LEN(argv[0]));
@@ -500,7 +498,6 @@ static VALUE rb_gsl_matrix_complex_get(int argc, VALUE *argv, VALUE obj)
500
498
  } else {
501
499
  retval = rb_gsl_matrix_complex_submatrix(argc, argv, obj);
502
500
  }
503
-
504
501
  return retval;
505
502
  }
506
503
 
@@ -546,12 +543,12 @@ static VALUE rb_gsl_matrix_complex_to_a(VALUE obj)
546
543
  size_t i, j;
547
544
  Data_Get_Struct(obj, gsl_matrix_complex, m);
548
545
  ma = rb_ary_new2(m->size1);
549
- for(i=0; i < m->size1; i++) {
546
+ for(i = 0; i < m->size1; i++) {
550
547
  ra = rb_ary_new2(m->size2);
551
548
  rb_ary_store(ma, i, ra);
552
- for(j=0; j < m->size2; j++) {
549
+ for(j = 0; j < m->size2; j++) {
553
550
  c = ALLOC(gsl_complex);
554
- *c = gsl_matrix_complex_get(m, i, j);
551
+ *c = gsl_matrix_complex_get(m, i, j);
555
552
  rb_ary_store(ra, j, Data_Wrap_Struct(cgsl_complex, 0, free, c));
556
553
  }
557
554
  }
@@ -610,11 +607,11 @@ static VALUE rb_gsl_matrix_complex_to_s(int argc, VALUE *argv, VALUE obj)
610
607
  int max_rows = 4;
611
608
  int max_cols = 4;
612
609
 
613
- switch(argc){
614
- case 2: max_cols = NUM2INT(argv[1]);
615
- case 1: max_rows = NUM2INT(argv[0]);
616
- case 0: break;
617
- default:
610
+ switch(argc) {
611
+ case 2: max_cols = NUM2INT(argv[1]);
612
+ case 1: max_rows = NUM2INT(argv[0]);
613
+ case 0: break;
614
+ default:
618
615
  rb_raise(rb_eArgError, "wrong number of arguments (%d for 0, 1, or 2)", argc);
619
616
  }
620
617
 
@@ -628,7 +625,7 @@ static VALUE rb_gsl_matrix_complex_to_s(int argc, VALUE *argv, VALUE obj)
628
625
  for (j = 0; j < m->size2; j++) {
629
626
  z = gsl_matrix_complex_get(m, i, j);
630
627
  sprintf(buf,
631
- "%s[ %4.3e %4.3e ]", (j==0) ? "" : " ", GSL_REAL(z), GSL_IMAG(z));
628
+ "%s[ %4.3e %4.3e ]", (j==0) ? "" : " ", GSL_REAL(z), GSL_IMAG(z));
632
629
  rb_str_cat(str, buf, strlen(buf));
633
630
  // if too many cols
634
631
  if ((int) j >= max_cols-1 && j != m->size2-1) {
@@ -926,8 +923,8 @@ static VALUE rb_gsl_matrix_complex_add_diagonal(VALUE obj, VALUE s)
926
923
  Data_Get_Struct(s, gsl_complex, z);
927
924
  gsl_matrix_complex_add_diagonal(m, *z);
928
925
  } else {
929
- rb_raise(rb_eTypeError,
930
- "wrong argument type %s", rb_class2name(CLASS_OF(s)));
926
+ rb_raise(rb_eTypeError,
927
+ "wrong argument type %s", rb_class2name(CLASS_OF(s)));
931
928
  }
932
929
  break;
933
930
  }
@@ -1001,7 +998,7 @@ static VALUE rb_gsl_matrix_complex_set_diagonal(VALUE obj, VALUE diag)
1001
998
  for (i = 0; i < m->size1; i++) gsl_matrix_complex_set(m, i, i, gsl_vector_complex_get(v, i));
1002
999
  } else {
1003
1000
  rb_raise(rb_eTypeError, "wrong argument type %s (GSL::Vector_Complex or Array expected)",
1004
- rb_class2name(CLASS_OF(diag)));
1001
+ rb_class2name(CLASS_OF(diag)));
1005
1002
  }
1006
1003
  return obj;
1007
1004
  }
@@ -1055,7 +1052,7 @@ static VALUE rb_gsl_matrix_complex_coerce(VALUE obj, VALUE other)
1055
1052
  return rb_ary_new3(2, vcm, obj);
1056
1053
  } else {
1057
1054
  rb_raise(rb_eTypeError, "cannot coerce %s to GSL::Matrix::Complex",
1058
- rb_class2name(CLASS_OF(other)));
1055
+ rb_class2name(CLASS_OF(other)));
1059
1056
  }
1060
1057
  break;
1061
1058
  }
@@ -1273,8 +1270,8 @@ static VALUE rb_gsl_matrix_complex_logabs(VALUE obj)
1273
1270
  return rb_gsl_matrix_complex_XXX(obj, gsl_complex_logabs);
1274
1271
  }
1275
1272
 
1276
- static VALUE rb_gsl_matrix_complex_XXX_complex(VALUE obj,
1277
- gsl_complex (*f)(gsl_complex))
1273
+ static VALUE rb_gsl_matrix_complex_XXX_complex(VALUE obj,
1274
+ gsl_complex (*f)(gsl_complex))
1278
1275
  {
1279
1276
  gsl_matrix_complex *m, *mnew;
1280
1277
  size_t i, j;
@@ -1525,14 +1522,14 @@ static VALUE rb_gsl_matrix_complex_indgen_singleton(int argc, VALUE *argv, VALUE
1525
1522
  // function, but it only determines absolute equality (i.e. is has no epsilon
1526
1523
  // argument).
1527
1524
  static int gsl_matrix_complex_equal_eps(const gsl_matrix_complex *m1,
1528
- const gsl_matrix_complex *m2, double eps)
1525
+ const gsl_matrix_complex *m2, double eps)
1529
1526
  {
1530
1527
  gsl_complex z1, z2;
1531
1528
  size_t i, j;
1532
1529
  if (m1->size1 != m2->size1) return 0;
1533
- if (m1->size2 != m2->size2) return 0;
1530
+ if (m1->size2 != m2->size2) return 0;
1534
1531
  for (i = 0; i < m1->size1; i++) {
1535
- for (j = 0; j < m1->size2; j++) {
1532
+ for (j = 0; j < m1->size2; j++) {
1536
1533
  z1 = gsl_matrix_complex_get(m1, i, j);
1537
1534
  z2 = gsl_matrix_complex_get(m2, i, j);
1538
1535
  if (!rbgsl_complex_equal(&z1, &z2, eps)) return 0;
@@ -1602,7 +1599,7 @@ void Init_gsl_matrix_complex(VALUE module)
1602
1599
  rb_define_method(cgsl_matrix_complex, "fwrite", rb_gsl_matrix_complex_fwrite, 1);
1603
1600
  rb_define_method(cgsl_matrix_complex, "fread", rb_gsl_matrix_complex_fread, 1);
1604
1601
  rb_define_method(cgsl_matrix_complex, "fscanf", rb_gsl_matrix_complex_fscanf, 1);
1605
-
1602
+
1606
1603
  rb_define_singleton_method(cgsl_matrix_complex, "memcpy", rb_gsl_matrix_complex_memcpy, 2);
1607
1604
  rb_define_method(cgsl_matrix_complex, "clone", rb_gsl_matrix_complex_clone, 0);
1608
1605
  rb_define_alias(cgsl_matrix_complex, "duplicate", "clone");
@@ -1610,10 +1607,10 @@ void Init_gsl_matrix_complex(VALUE module)
1610
1607
  rb_define_method(cgsl_matrix_complex, "swap_rows", rb_gsl_matrix_complex_swap_rows, 2);
1611
1608
  rb_define_method(cgsl_matrix_complex, "swap_columns", rb_gsl_matrix_complex_swap_columns, 2);
1612
1609
  rb_define_method(cgsl_matrix_complex, "swap_rowcol", rb_gsl_matrix_complex_swap_rowcol, 2);
1613
-
1610
+
1614
1611
  rb_define_method(cgsl_matrix_complex, "transpose", rb_gsl_matrix_complex_transpose, 0);
1615
1612
  rb_define_method(cgsl_matrix_complex, "isnull", rb_gsl_matrix_complex_isnull, 0);
1616
-
1613
+
1617
1614
  rb_define_method(cgsl_matrix_complex, "add", rb_gsl_matrix_complex_add, 1);
1618
1615
  rb_define_alias(cgsl_matrix_complex, "add_constant", "add");
1619
1616
  rb_define_alias(cgsl_matrix_complex, "+", "add");
@@ -1624,13 +1621,13 @@ void Init_gsl_matrix_complex(VALUE module)
1624
1621
  rb_define_alias(cgsl_matrix_complex, "/", "div_elements");
1625
1622
  rb_define_method(cgsl_matrix_complex, "scale", rb_gsl_matrix_complex_scale, 1);
1626
1623
  rb_define_method(cgsl_matrix_complex, "scale!", rb_gsl_matrix_complex_scale_bang, 1);
1627
-
1624
+
1628
1625
  rb_define_method(cgsl_matrix_complex, "add_diagonal", rb_gsl_matrix_complex_add_diagonal, 1);
1629
-
1626
+
1630
1627
  rb_define_method(cgsl_matrix_complex, "set_zero", rb_gsl_matrix_complex_set_zero, 0);
1631
1628
  rb_define_method(cgsl_matrix_complex, "set_identity", rb_gsl_matrix_complex_set_identity, 0);
1632
1629
  rb_define_method(cgsl_matrix_complex, "set_all", rb_gsl_matrix_complex_set_all, 1);
1633
-
1630
+
1634
1631
  rb_define_method(cgsl_matrix_complex, "submatrix", rb_gsl_matrix_complex_submatrix, -1);
1635
1632
  rb_define_alias(cgsl_matrix_complex, "view", "submatrix");
1636
1633
  rb_define_method(cgsl_matrix_complex, "row", rb_gsl_matrix_complex_row, 1);
@@ -1642,13 +1639,13 @@ void Init_gsl_matrix_complex(VALUE module)
1642
1639
  rb_define_method(cgsl_matrix_complex, "set_diagonal", rb_gsl_matrix_complex_set_diagonal, 1);
1643
1640
  rb_define_method(cgsl_matrix_complex, "subdiagonal", rb_gsl_matrix_complex_subdiagonal, 1);
1644
1641
  rb_define_method(cgsl_matrix_complex, "superdiagonal", rb_gsl_matrix_complex_superdiagonal, 1);
1645
-
1642
+
1646
1643
  rb_define_method(cgsl_matrix_complex, "coerce", rb_gsl_matrix_complex_coerce, 1);
1647
-
1644
+
1648
1645
  rb_define_method(cgsl_matrix_complex, "mul", rb_gsl_matrix_complex_mul, 1);
1649
1646
  rb_define_alias(cgsl_matrix_complex, "*", "mul");
1650
1647
  rb_define_method(cgsl_matrix_complex, "mul!", rb_gsl_matrix_complex_mul2, 1);
1651
-
1648
+
1652
1649
  rb_define_method(cgsl_matrix_complex, "real", rb_gsl_matrix_complex_real, 0);
1653
1650
  rb_define_alias(cgsl_matrix_complex, "to_real", "real");
1654
1651
  rb_define_alias(cgsl_matrix_complex, "re", "real");
@@ -1662,7 +1659,7 @@ void Init_gsl_matrix_complex(VALUE module)
1662
1659
  rb_define_alias(cgsl_matrix_complex, "conj", "conjugate");
1663
1660
  rb_define_method(cgsl_matrix_complex, "dagger!", rb_gsl_matrix_complex_dagger, 0);
1664
1661
  rb_define_method(cgsl_matrix_complex, "dagger", rb_gsl_matrix_complex_dagger2, 0);
1665
-
1662
+
1666
1663
  rb_define_method(cgsl_matrix_complex, "trace", rb_gsl_matrix_complex_trace, 0);
1667
1664
  rb_define_method(cgsl_matrix_complex, "each_row", rb_gsl_matrix_complex_each_row, 0);
1668
1665
  rb_define_method(cgsl_matrix_complex, "each_col", rb_gsl_matrix_complex_each_col, 0);
@@ -1671,14 +1668,14 @@ void Init_gsl_matrix_complex(VALUE module)
1671
1668
  rb_define_method(cgsl_matrix_complex, "collect!", rb_gsl_matrix_complex_collect_bang, 0);
1672
1669
  rb_define_alias(cgsl_matrix_complex, "map", "collect");
1673
1670
  rb_define_alias(cgsl_matrix_complex, "map!", "collect!");
1674
-
1671
+
1675
1672
  rb_define_method(cgsl_matrix_complex, "to_a", rb_gsl_matrix_complex_to_a, 0);
1676
1673
 
1677
1674
  rb_define_method(cgsl_matrix_complex, "size1", rb_gsl_matrix_complex_size1, 0);
1678
1675
  rb_define_method(cgsl_matrix_complex, "size2", rb_gsl_matrix_complex_size2, 0);
1679
1676
  rb_define_method(cgsl_matrix_complex, "shape", rb_gsl_matrix_complex_shape, 0);
1680
1677
  rb_define_alias(cgsl_matrix_complex, "size", "shape");
1681
-
1678
+
1682
1679
  /*****/
1683
1680
  rb_define_method(cgsl_matrix_complex, "-@", rb_gsl_matrix_complex_uminus, 0);
1684
1681
  rb_define_method(cgsl_matrix_complex, "+@", rb_gsl_matrix_complex_uplus, 0);
@@ -1728,9 +1725,9 @@ void Init_gsl_matrix_complex(VALUE module)
1728
1725
  rb_define_method(cgsl_matrix_complex, "indgen", rb_gsl_matrix_complex_indgen, -1);
1729
1726
  rb_define_method(cgsl_matrix_complex, "indgen!", rb_gsl_matrix_complex_indgen_bang, -1);
1730
1727
  rb_define_singleton_method(cgsl_matrix_complex, "indgen", rb_gsl_matrix_complex_indgen_singleton, -1);
1731
-
1728
+
1732
1729
  rb_define_method(cgsl_matrix_complex, "equal?", rb_gsl_matrix_complex_equal, -1);
1733
1730
  rb_define_alias(cgsl_matrix_complex, "==", "equal?");
1734
1731
  rb_define_method(cgsl_matrix_complex, "not_equal?", rb_gsl_matrix_complex_not_equal, -1);
1735
- rb_define_alias(cgsl_matrix_complex, "!=", "not_equal?");
1732
+ rb_define_alias(cgsl_matrix_complex, "!=", "not_equal?");
1736
1733
  }