rb-gsl 1.15.3.1 → 1.15.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (222) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHORS +2 -2
  3. data/ChangeLog +8 -0
  4. data/Rakefile +39 -96
  5. data/VERSION +1 -1
  6. data/ext/array.c +2 -2
  7. data/ext/block_source.c +1 -1
  8. data/ext/dirac.c +1 -1
  9. data/ext/eigen.c +13 -13
  10. data/ext/extconf.rb +17 -11
  11. data/ext/function.c +5 -5
  12. data/ext/gsl_narray.c +6 -6
  13. data/ext/histogram.c +7 -6
  14. data/ext/histogram2d.c +4 -4
  15. data/ext/interp.c +1 -1
  16. data/ext/linalg.c +13 -11
  17. data/ext/linalg_complex.c +8 -6
  18. data/ext/math.c +1 -1
  19. data/ext/matrix_complex.c +6 -6
  20. data/ext/matrix_source.c +10 -10
  21. data/ext/monte.c +2 -2
  22. data/ext/multimin.c +4 -4
  23. data/ext/multiroots.c +8 -8
  24. data/ext/nmf.c +6 -6
  25. data/ext/ntuple.c +4 -4
  26. data/ext/odeiv.c +2 -2
  27. data/ext/permutation.c +1 -1
  28. data/ext/poly2.c +6 -6
  29. data/ext/poly_source.c +9 -6
  30. data/ext/sf.c +31 -45
  31. data/ext/signal.c +2 -2
  32. data/ext/vector_complex.c +11 -10
  33. data/ext/vector_double.c +7 -4
  34. data/ext/vector_source.c +29 -26
  35. data/ext/wavelet.c +1 -1
  36. data/include/rb_gsl_common.h +12 -0
  37. data/include/rb_gsl_config.h +10 -1
  38. data/rdoc/blas.rdoc +4 -4
  39. data/rdoc/bspline.rdoc +8 -8
  40. data/rdoc/cheb.rdoc +9 -9
  41. data/rdoc/cholesky_complex.rdoc +1 -1
  42. data/rdoc/combi.rdoc +10 -10
  43. data/rdoc/complex.rdoc +12 -12
  44. data/rdoc/const.rdoc +21 -21
  45. data/rdoc/dht.rdoc +7 -7
  46. data/rdoc/diff.rdoc +7 -7
  47. data/rdoc/ehandling.rdoc +4 -4
  48. data/rdoc/eigen.rdoc +12 -12
  49. data/rdoc/fft.rdoc +27 -27
  50. data/rdoc/fit.rdoc +19 -19
  51. data/rdoc/function.rdoc +1 -1
  52. data/rdoc/graph.rdoc +3 -3
  53. data/rdoc/hist.rdoc +17 -17
  54. data/rdoc/hist2d.rdoc +5 -5
  55. data/rdoc/hist3d.rdoc +4 -4
  56. data/rdoc/index.rdoc +4 -4
  57. data/rdoc/integration.rdoc +17 -17
  58. data/rdoc/interp.rdoc +12 -12
  59. data/rdoc/intro.rdoc +4 -4
  60. data/rdoc/linalg.rdoc +21 -21
  61. data/rdoc/linalg_complex.rdoc +1 -1
  62. data/rdoc/math.rdoc +14 -14
  63. data/rdoc/matrix.rdoc +21 -21
  64. data/rdoc/min.rdoc +10 -10
  65. data/rdoc/monte.rdoc +4 -4
  66. data/rdoc/multimin.rdoc +13 -13
  67. data/rdoc/multiroot.rdoc +13 -13
  68. data/rdoc/narray.rdoc +10 -10
  69. data/rdoc/ndlinear.rdoc +5 -5
  70. data/rdoc/nonlinearfit.rdoc +18 -18
  71. data/rdoc/ntuple.rdoc +6 -6
  72. data/rdoc/odeiv.rdoc +13 -13
  73. data/rdoc/perm.rdoc +12 -12
  74. data/rdoc/poly.rdoc +18 -18
  75. data/rdoc/qrng.rdoc +10 -10
  76. data/rdoc/randist.rdoc +11 -11
  77. data/rdoc/ref.rdoc +50 -50
  78. data/rdoc/rng.rdoc +10 -10
  79. data/rdoc/rngextra.rdoc +5 -5
  80. data/rdoc/roots.rdoc +13 -13
  81. data/rdoc/sf.rdoc +36 -36
  82. data/rdoc/siman.rdoc +4 -4
  83. data/rdoc/sort.rdoc +7 -7
  84. data/rdoc/start.rdoc +1 -1
  85. data/rdoc/stats.rdoc +14 -14
  86. data/rdoc/sum.rdoc +5 -5
  87. data/rdoc/tensor.rdoc +4 -4
  88. data/rdoc/tut.rdoc +1 -1
  89. data/rdoc/use.rdoc +5 -5
  90. data/rdoc/vector.rdoc +29 -29
  91. data/rdoc/vector_complex.rdoc +6 -6
  92. data/rdoc/wavelet.rdoc +9 -9
  93. data/test/gsl/blas_test.rb +79 -0
  94. data/test/gsl/bspline_test.rb +63 -0
  95. data/test/gsl/cdf_test.rb +1512 -0
  96. data/test/gsl/cheb_test.rb +80 -0
  97. data/test/gsl/combination_test.rb +100 -0
  98. data/test/gsl/complex_test.rb +20 -0
  99. data/test/gsl/const_test.rb +29 -0
  100. data/test/gsl/deriv_test.rb +62 -0
  101. data/test/gsl/dht_test.rb +79 -0
  102. data/test/gsl/diff_test.rb +53 -0
  103. data/test/gsl/eigen_test.rb +563 -0
  104. data/test/gsl/err_test.rb +23 -0
  105. data/test/gsl/fit_test.rb +101 -0
  106. data/test/gsl/histo_test.rb +14 -0
  107. data/test/gsl/integration_test.rb +274 -0
  108. data/test/gsl/interp_test.rb +27 -0
  109. data/test/gsl/linalg_test.rb +463 -0
  110. data/test/gsl/matrix_nmf_test.rb +37 -0
  111. data/test/gsl/matrix_test.rb +77 -0
  112. data/test/gsl/min_test.rb +89 -0
  113. data/test/gsl/monte_test.rb +77 -0
  114. data/test/gsl/multifit_test.rb +753 -0
  115. data/test/gsl/multimin_test.rb +157 -0
  116. data/test/gsl/multiroot_test.rb +135 -0
  117. data/test/gsl/multiset_test.rb +52 -0
  118. data/test/gsl/odeiv_test.rb +275 -0
  119. data/test/gsl/poly_test.rb +338 -0
  120. data/test/gsl/qrng_test.rb +94 -0
  121. data/test/gsl/quartic_test.rb +28 -0
  122. data/test/gsl/randist_test.rb +122 -0
  123. data/test/gsl/rng_test.rb +303 -0
  124. data/test/gsl/roots_test.rb +78 -0
  125. data/test/gsl/sf_test.rb +2079 -0
  126. data/test/gsl/stats_test.rb +122 -0
  127. data/test/gsl/sum_test.rb +69 -0
  128. data/test/gsl/tensor_test.rb +396 -0
  129. data/test/gsl/vector_test.rb +223 -0
  130. data/test/gsl/wavelet_test.rb +130 -0
  131. data/test/gsl_test.rb +321 -0
  132. data/test/test_helper.rb +42 -0
  133. metadata +107 -150
  134. data/setup.rb +0 -1585
  135. data/tests/blas/amax.rb +0 -14
  136. data/tests/blas/asum.rb +0 -16
  137. data/tests/blas/axpy.rb +0 -25
  138. data/tests/blas/copy.rb +0 -23
  139. data/tests/blas/dot.rb +0 -23
  140. data/tests/bspline.rb +0 -53
  141. data/tests/cdf.rb +0 -1388
  142. data/tests/cheb.rb +0 -112
  143. data/tests/combination.rb +0 -123
  144. data/tests/complex.rb +0 -17
  145. data/tests/const.rb +0 -24
  146. data/tests/deriv.rb +0 -85
  147. data/tests/dht/dht1.rb +0 -17
  148. data/tests/dht/dht2.rb +0 -23
  149. data/tests/dht/dht3.rb +0 -23
  150. data/tests/dht/dht4.rb +0 -23
  151. data/tests/diff.rb +0 -78
  152. data/tests/eigen/eigen.rb +0 -220
  153. data/tests/eigen/gen.rb +0 -105
  154. data/tests/eigen/genherm.rb +0 -66
  155. data/tests/eigen/gensymm.rb +0 -68
  156. data/tests/eigen/nonsymm.rb +0 -53
  157. data/tests/eigen/nonsymmv.rb +0 -53
  158. data/tests/eigen/symm-herm.rb +0 -74
  159. data/tests/err.rb +0 -58
  160. data/tests/fit.rb +0 -124
  161. data/tests/gsl_test.rb +0 -118
  162. data/tests/gsl_test2.rb +0 -110
  163. data/tests/histo.rb +0 -12
  164. data/tests/integration/integration1.rb +0 -72
  165. data/tests/integration/integration2.rb +0 -71
  166. data/tests/integration/integration3.rb +0 -71
  167. data/tests/integration/integration4.rb +0 -71
  168. data/tests/interp.rb +0 -45
  169. data/tests/linalg/HH.rb +0 -64
  170. data/tests/linalg/LU.rb +0 -47
  171. data/tests/linalg/QR.rb +0 -77
  172. data/tests/linalg/SV.rb +0 -24
  173. data/tests/linalg/TDN.rb +0 -116
  174. data/tests/linalg/TDS.rb +0 -122
  175. data/tests/linalg/bidiag.rb +0 -73
  176. data/tests/linalg/cholesky.rb +0 -20
  177. data/tests/linalg/linalg.rb +0 -158
  178. data/tests/matrix/matrix_complex_test.rb +0 -36
  179. data/tests/matrix/matrix_nmf_test.rb +0 -39
  180. data/tests/matrix/matrix_test.rb +0 -48
  181. data/tests/min.rb +0 -99
  182. data/tests/monte/miser.rb +0 -31
  183. data/tests/monte/vegas.rb +0 -45
  184. data/tests/multifit/test_2dgauss.rb +0 -112
  185. data/tests/multifit/test_brown.rb +0 -90
  186. data/tests/multifit/test_enso.rb +0 -246
  187. data/tests/multifit/test_filip.rb +0 -155
  188. data/tests/multifit/test_gauss.rb +0 -97
  189. data/tests/multifit/test_longley.rb +0 -110
  190. data/tests/multifit/test_multifit.rb +0 -52
  191. data/tests/multimin.rb +0 -139
  192. data/tests/multiroot.rb +0 -131
  193. data/tests/multiset.rb +0 -52
  194. data/tests/narray/blas_dnrm2.rb +0 -20
  195. data/tests/odeiv.rb +0 -353
  196. data/tests/poly/poly.rb +0 -290
  197. data/tests/poly/special.rb +0 -65
  198. data/tests/qrng.rb +0 -131
  199. data/tests/quartic.rb +0 -29
  200. data/tests/randist.rb +0 -134
  201. data/tests/rng.rb +0 -305
  202. data/tests/roots.rb +0 -76
  203. data/tests/run-test.sh +0 -17
  204. data/tests/sf/gsl_test_sf.rb +0 -249
  205. data/tests/sf/test_airy.rb +0 -83
  206. data/tests/sf/test_bessel.rb +0 -306
  207. data/tests/sf/test_coulomb.rb +0 -17
  208. data/tests/sf/test_dilog.rb +0 -25
  209. data/tests/sf/test_gamma.rb +0 -209
  210. data/tests/sf/test_hyperg.rb +0 -356
  211. data/tests/sf/test_legendre.rb +0 -227
  212. data/tests/sf/test_mathieu.rb +0 -59
  213. data/tests/sf/test_mode.rb +0 -19
  214. data/tests/sf/test_sf.rb +0 -839
  215. data/tests/stats.rb +0 -174
  216. data/tests/stats_mt.rb +0 -16
  217. data/tests/sum.rb +0 -98
  218. data/tests/sys.rb +0 -323
  219. data/tests/tensor.rb +0 -419
  220. data/tests/vector/vector_complex_test.rb +0 -101
  221. data/tests/vector/vector_test.rb +0 -141
  222. data/tests/wavelet.rb +0 -142
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2d0a4a08782d4daa47a3ebdff807ad6b354116bb
4
- data.tar.gz: 0f367375af61e42b676b9366b77a4742382ced5c
3
+ metadata.gz: c2881407d92b5a79d9a59dcef18de757e3b9bc52
4
+ data.tar.gz: f1c89f8bb663d1c65588d0254575fced093e6b2e
5
5
  SHA512:
6
- metadata.gz: ad021812eefcfec38ef757de79a9f3c59262397b520d73f91d971f7cbb2865bc30e2aaa7b720a52f30a138d68a4d24175451731dd16b7d720cba3f4125d923ae
7
- data.tar.gz: fe016c18cce8b11606ea69ba1cf4a342f541c0add47d22d14525b2b8411418f3927ded1dc8e366b59adba478db71ffedcd0f9a1e8d6a05cb30717a9dcb9018c5
6
+ metadata.gz: cbe15cdc58dc7e040309e91862b568eb3bd3144da086c9042867e80cf6a2da1a154ba125186dbaea39ce21f8f0a3dae50709b8dd24a4e287dbdddff44f247ddc
7
+ data.tar.gz: ee64e214328c06f4264adbfc254d408d46261050d3be142bf76bb8bf9e3a4ec6dacda77536634a20ec33d57b9288156ef5920fba4eb22f9c61d1d6cbfd3df3d6
data/AUTHORS CHANGED
@@ -2,5 +2,5 @@ Yoshiki Tsunesada
2
2
  y-tsunesada@mm.em-net.ne.jp
3
3
  David MacMahon
4
4
  davidm@astro.berkeley.edu
5
-
6
-
5
+ Jens Wille
6
+ jens.wille@gmail.com
data/ChangeLog CHANGED
@@ -1,3 +1,11 @@
1
+ Fri Jan 24 14:16:30 CET 2014
2
+ * Ruby/GSL 1.15.3.2
3
+ * Windows compatibility.
4
+ * Ruby 2.x compatibility.
5
+ * Ported tests to Test::Unit.
6
+ * Silenced compilation warnings.
7
+ * Switched to rake-compiler for compilation.
8
+
1
9
  Sat Feb 26 08:18:45 PST 2011
2
10
  * Ruby/GSL 1.14.7
3
11
  * Fix conversion of non-DFLOAT NArray to GSL::Vector and
data/Rakefile CHANGED
@@ -1,99 +1,42 @@
1
- require 'rubygems'
2
- require 'rubygems/package_task'
3
- require 'rdoc/task'
4
-
5
1
  RB_GSL_VERSION = File.readlines('VERSION')[0].chomp
6
2
 
7
- spec = Gem::Specification.new do |s|
8
- # Basics
9
- s.name = 'rb-gsl'
10
- s.version = RB_GSL_VERSION + '.1'
11
- s.summary = 'Ruby interface to GNU Scientific Library'
12
- s.description = 'Ruby/GSL is a Ruby interface to the GNU Scientific Library, for numerical computing with Ruby'
13
- #s.platform = Gem::Platform::Ruby
14
- s.required_ruby_version = '>= 1.8.1'
15
- s.requirements << 'GSL (http://www.gnu.org/software/gsl/)'
16
- # plotlib?
17
- s.add_dependency('narray', '>= 0.5.9')
18
-
19
- # About
20
- s.authors = ['Yoshiki Tsunesada', 'David MacMahon']
21
- s.email = 'y-tsunesada@mm.em-net.ne.jp'
22
- s.homepage = 'http://rb-gsl.rubyforge.org/'
23
- s.rubyforge_project = 'rb-gsl'
24
-
25
- # Files, Libraries, and Extensions
26
- s.files = FileList[
27
- 'AUTHORS',
28
- 'COPYING',
29
- 'ChangeLog',
30
- 'README',
31
- 'Rakefile',
32
- 'setup.rb',
33
- 'THANKS',
34
- 'VERSION',
35
- 'examples/**/*',
36
- 'ext/extconf.rb',
37
- 'ext/*.c',
38
- 'lib/**/*',
39
- 'include/*',
40
- 'rdoc/*',
41
- 'tests/**/*'
42
- ].to_a
43
- s.require_paths = ['lib', 'lib/gsl', 'lib/ool', 'ext']
44
- #s.autorequire = nil
45
- #s.bindir = 'bin'
46
- #s.executables = []
47
- #s.default_executable = nil
48
-
49
- # C compilation
50
- s.extensions = %w[ ext/extconf.rb ]
51
-
52
- # Documentation
53
- s.has_rdoc = true
54
- s.rdoc_options = [
55
- '--title', 'Ruby/GSL',
56
- '--main', 'rdoc/index.rdoc',
57
- '--exclude', 'ext/',
58
- '--exclude', 'include/',
59
- '--exclude', 'lib/',
60
- ]
61
- s.extra_rdoc_files = FileList['rdoc/*'].to_a
62
-
63
- # Testing TODO
64
- #s.test_files = []
65
- end
66
-
67
- Rake::PackageTask.new('rb-gsl', RB_GSL_VERSION) do |pkg|
68
- pkg.need_zip = true
69
- pkg.need_tar = true
70
- pkg.package_files = spec.files
71
- end
72
-
73
- Gem::PackageTask.new(spec) do |pkg|
74
- pkg.need_zip = false
75
- pkg.need_tar = false
76
- end
77
-
78
- task :default => [:package, :gem]
79
-
80
- # --------------------------------------------------------------------
81
- # Create a task to build the RDOC documentation tree.
82
-
83
- desc "Create the RDoc html files"
84
- Rake::RDocTask.new("rdoc") { |rdoc|
85
- rdoc.rdoc_dir = 'html'
86
- rdoc.title = 'Ruby/GSL'
87
- rdoc.main = 'rdoc/index.rdoc'
88
- rdoc.options << '--exclude' << 'ext/'
89
- rdoc.options << '--exclude' << 'include/'
90
- rdoc.options << '--exclude' << 'lib/'
91
- rdoc.rdoc_files.include('rdoc/*.rdoc')
92
- }
93
-
94
- desc "Publish the RDoc files on RubyForge"
95
- task :pub_rdoc => ["html/index.html"] do
96
- mkdir_p "emptydir"
97
- sh "scp -rq html/* www.rubyforge.org:/var/www/gforge-projects/rb-gsl/."
98
- rm_r "emptydir"
3
+ begin
4
+ require 'hen'
5
+
6
+ Hen.lay! {{
7
+ :gem => {
8
+ :name => %q{rb-gsl},
9
+ :version => RB_GSL_VERSION,
10
+ :summary => %q{Ruby interface to the GNU Scientific Library [Ruby 2.x compatible fork]},
11
+ :description => %q{Ruby/GSL is a Ruby interface to the GNU Scientific Library, for numerical computing with Ruby},
12
+ :authors => ['Yoshiki Tsunesada', 'David MacMahon', 'Jens Wille'],
13
+ :email => %q{jens.wille@gmail.com},
14
+ :license => %q{GPL-2.0},
15
+ :homepage => :blackwinter,
16
+ :dependencies => [['narray', '>= 0.5.9']],
17
+ :requirements => ['GSL (http://www.gnu.org/software/gsl/)'],
18
+ :require_paths => %w[lib lib/gsl lib/ool ext],
19
+
20
+ :extra_files => FileList['examples/**/*', 'include/*', 'rdoc/*'].to_a,
21
+
22
+ :extension => {
23
+ :lib_dir => 'lib',
24
+ :ext_dir => 'ext',
25
+ :cross_compile => false
26
+ },
27
+
28
+ :required_ruby_version => '>= 1.8.1'
29
+ },
30
+ :rdoc => {
31
+ :title => 'Ruby/GSL{version: (v%s)}',
32
+ :rdoc_files => FileList['rdoc/*'].to_a,
33
+ :exclude => %w[ext include lib],
34
+ :main => 'rdoc/index.rdoc'
35
+ },
36
+ :test => {
37
+ :libs => %w[lib test]
38
+ }
39
+ }}
40
+ rescue LoadError => err
41
+ warn "Please install the `hen' gem. (#{err})"
99
42
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.15.3
1
+ 1.15.3.2
@@ -487,7 +487,7 @@ VALUE rb_gsl_range2vector(VALUE obj)
487
487
  rb_class2name(CLASS_OF(obj)));
488
488
  get_range_beg_en_n(obj, &beg, &en, &n, &step);
489
489
  v = gsl_vector_alloc(n);
490
- for (i = 0; i < n; i++) gsl_vector_set(v, i, (double) (beg+i));
490
+ for (i = 0; i < (int) n; i++) gsl_vector_set(v, i, (double) (beg+i));
491
491
  return Data_Wrap_Struct(cgsl_vector, 0, gsl_vector_free, v);
492
492
  }
493
493
 
@@ -502,7 +502,7 @@ VALUE rb_gsl_range2vector_int(VALUE obj)
502
502
  rb_class2name(CLASS_OF(obj)));
503
503
  get_range_int_beg_en_n(obj, &beg, &en, &n, &step);
504
504
  v = gsl_vector_int_alloc(n);
505
- for (i = 0; i < n; i++) gsl_vector_int_set(v, i, beg+i);
505
+ for (i = 0; i < (int) n; i++) gsl_vector_int_set(v, i, beg+i);
506
506
  return Data_Wrap_Struct(cgsl_vector_int, 0, gsl_vector_int_free, v);
507
507
  }
508
508
 
@@ -230,7 +230,7 @@ static VALUE FUNCTION(rb_gsl_block,get)(int argc, VALUE *argv, VALUE obj)
230
230
  break;
231
231
  default:
232
232
  bnew = FUNCTION(gsl_block,alloc)(argc);
233
- for (j = 0; j < argc; j++) {
233
+ for (j = 0; (int) j < argc; j++) {
234
234
  i = FIX2INT(argv[j]);
235
235
  if (i < 0) k = b->size + i; else k = i;
236
236
  bnew->data[j] = b->data[k];
@@ -338,7 +338,7 @@ static VALUE rb_Dirac_matrix_whoami(int argc, VALUE *argv, VALUE obj)
338
338
  VLambda[0], VLambda[1], VLambda[2], VLambda[3],
339
339
  VLambda[4], VLambda[5], VLambda[6], VLambda[7]};
340
340
 
341
- char *name[NUM] = {"Pauli1", "Pauli2", "Pauli3",
341
+ const char *name[NUM] = {"Pauli1", "Pauli2", "Pauli3",
342
342
  "Gamma0", "Gamma1", "Gamma2", "Gamma3", "Gamma5",
343
343
  "Eye2", "Eye4", "IEye2", "IEye4", "Lambda1", "Lambda2",
344
344
  "Lambda3", "Lambda4", "Lambda5", "Lambda6",
@@ -1060,8 +1060,8 @@ static VALUE rb_gsl_eigen_nonsymmv_narray(int argc, VALUE *argv, VALUE obj);
1060
1060
  static VALUE rb_gsl_eigen_nonsymmv(int argc, VALUE *argv, VALUE obj)
1061
1061
  {
1062
1062
  gsl_matrix *m;
1063
- gsl_vector_complex *v;
1064
- gsl_matrix_complex *evec;
1063
+ gsl_vector_complex *v = NULL;
1064
+ gsl_matrix_complex *evec = NULL;
1065
1065
  gsl_eigen_nonsymmv_workspace *w;
1066
1066
  int vflag = 0, wflag = 0;
1067
1067
  int istart = 0;
@@ -1196,9 +1196,9 @@ static VALUE rb_gsl_eigen_nonsymmv_narray(int argc, VALUE *argv, VALUE obj)
1196
1196
 
1197
1197
  static VALUE rb_gsl_eigen_nonsymmv_Z(int argc, VALUE *argv, VALUE obj)
1198
1198
  {
1199
- gsl_matrix *m, *Z;
1200
- gsl_vector_complex *v;
1201
- gsl_matrix_complex *evec;
1199
+ gsl_matrix *m, *Z = NULL;
1200
+ gsl_vector_complex *v = NULL;
1201
+ gsl_matrix_complex *evec = NULL;
1202
1202
  gsl_eigen_nonsymmv_workspace *w;
1203
1203
  int vflag = 0, wflag = 0;
1204
1204
  int istart = 0;
@@ -1571,7 +1571,7 @@ static VALUE rb_gsl_eigen_gensymm(int argc, VALUE *argv, VALUE obj)
1571
1571
  gsl_vector *eval = NULL;
1572
1572
  gsl_eigen_gensymm_workspace *w = NULL;
1573
1573
  int flag;
1574
- VALUE veval;
1574
+ VALUE veval = NULL;
1575
1575
  flag = check_argv_gensymm(argc, argv, obj, &A, &B, &eval, &w);
1576
1576
  Atmp = make_matrix_clone(A);
1577
1577
  // Btmp = make_matrix_clone(B);
@@ -1606,7 +1606,7 @@ static VALUE rb_gsl_eigen_gensymmv(int argc, VALUE *argv, VALUE obj)
1606
1606
  gsl_matrix *evec = NULL;
1607
1607
  gsl_eigen_gensymmv_workspace *w = NULL;
1608
1608
  int flag;
1609
- VALUE veval, vevec;
1609
+ VALUE veval = NULL, vevec = NULL;
1610
1610
  flag = check_argv_gensymmv(argc, argv, obj, &A, &B, &eval, &evec, &w);
1611
1611
  Atmp = make_matrix_clone(A);
1612
1612
  // Btmp = make_matrix_clone(B);
@@ -1645,7 +1645,7 @@ static VALUE rb_gsl_eigen_genherm(int argc, VALUE *argv, VALUE obj)
1645
1645
  gsl_vector *eval = NULL;
1646
1646
  gsl_eigen_genherm_workspace *w = NULL;
1647
1647
  int flag;
1648
- VALUE veval;
1648
+ VALUE veval = NULL;
1649
1649
  flag = check_argv_genherm(argc, argv, obj, &A, &B, &eval, &w);
1650
1650
  Atmp = make_matrix_complex_clone(A);
1651
1651
  Btmp = make_matrix_complex_clone(B);
@@ -1680,7 +1680,7 @@ static VALUE rb_gsl_eigen_genhermv(int argc, VALUE *argv, VALUE obj)
1680
1680
  gsl_matrix_complex *evec = NULL;
1681
1681
  gsl_eigen_genhermv_workspace *w = NULL;
1682
1682
  int flag;
1683
- VALUE veval, vevec;
1683
+ VALUE veval = NULL, vevec = NULL;
1684
1684
  flag = check_argv_genhermv(argc, argv, obj, &A, &B, &eval, &evec, &w);
1685
1685
  Atmp = make_matrix_complex_clone(A);
1686
1686
  Btmp = make_matrix_complex_clone(B);
@@ -1833,7 +1833,7 @@ static VALUE rb_gsl_eigen_gen(int argc, VALUE *argv, VALUE obj)
1833
1833
  gsl_vector *beta = NULL;
1834
1834
  gsl_eigen_gen_workspace *w = NULL;
1835
1835
  int flag;
1836
- VALUE valpha, vbeta;
1836
+ VALUE valpha = NULL, vbeta = NULL;
1837
1837
  flag = check_argv_gen(argc, argv, obj, &A, &B, &alpha, &beta, &w);
1838
1838
  // Atmp = make_matrix_clone(A);
1839
1839
  // Btmp = make_matrix_clone(B);
@@ -1874,7 +1874,7 @@ static VALUE rb_gsl_eigen_gen_QZ(int argc, VALUE *argv, VALUE obj)
1874
1874
  gsl_matrix *Q, *Z;
1875
1875
  gsl_eigen_gen_workspace *w = NULL;
1876
1876
  int flag;
1877
- VALUE valpha, vbeta, vQ, vZ;
1877
+ VALUE valpha = NULL, vbeta = NULL, vQ, vZ;
1878
1878
  flag = check_argv_gen(argc, argv, obj, &A, &B, &alpha, &beta, &w);
1879
1879
  /* Atmp = make_matrix_clone(A);
1880
1880
  Btmp = make_matrix_clone(B); */
@@ -1987,7 +1987,7 @@ static VALUE rb_gsl_eigen_genv(int argc, VALUE *argv, VALUE obj)
1987
1987
  gsl_matrix_complex *evec = NULL;
1988
1988
  gsl_eigen_genv_workspace *w = NULL;
1989
1989
  int flag;
1990
- VALUE valpha, vbeta, vevec;
1990
+ VALUE valpha = NULL, vbeta = NULL, vevec = NULL;
1991
1991
  flag = check_argv_genv(argc, argv, obj, &A, &B, &alpha, &beta, &evec, &w);
1992
1992
  // Atmp = make_matrix_clone(A);
1993
1993
  // Btmp = make_matrix_clone(B);
@@ -2035,7 +2035,7 @@ static VALUE rb_gsl_eigen_genv_QZ(int argc, VALUE *argv, VALUE obj)
2035
2035
  gsl_matrix *Q, *Z;
2036
2036
  gsl_eigen_genv_workspace *w = NULL;
2037
2037
  int flag;
2038
- VALUE valpha, vbeta, vevec, vQ, vZ;
2038
+ VALUE valpha = NULL, vbeta = NULL, vevec = NULL, vQ, vZ;
2039
2039
  flag = check_argv_genv(argc, argv, obj, &A, &B, &alpha, &beta, &evec, &w);
2040
2040
  /* Atmp = make_matrix_clone(A);
2041
2041
  Btmp = make_matrix_clone(B); */
@@ -125,7 +125,7 @@ def check_version(configfile)
125
125
  configfile.printf("#ifndef GSL_1_11_LATER\n#define GSL_1_11_LATER\n#endif\n")
126
126
  end
127
127
 
128
- if ver >= "1.12.90"
128
+ if ver >= "1.12.90"
129
129
  configfile.printf("#ifndef GSL_1_13_LATER\n#define GSL_1_13_LATER\n#endif\n")
130
130
  end
131
131
 
@@ -140,13 +140,17 @@ def check_version(configfile)
140
140
  end
141
141
  end
142
142
 
143
+ def file_path(path = '.')
144
+ File.expand_path(path, File.dirname(__FILE__))
145
+ end
146
+
143
147
  #####
144
148
 
145
149
  $CFLAGS ||= ''
146
- $CFLAGS += " -Wall -I../include "
150
+ $CFLAGS += " -Wall -I#{file_path('../include')} "
147
151
 
148
152
  begin
149
- RB_GSL_CONFIG = File.open("../include/rb_gsl_config.h", "w")
153
+ RB_GSL_CONFIG = File.open(file_path("../include/rb_gsl_config.h"), "w")
150
154
  RB_GSL_CONFIG.printf("#ifndef ___RB_GSL_CONFIG_H___\n")
151
155
  RB_GSL_CONFIG.printf("#define ___RB_GSL_CONFIG_H___\n\n")
152
156
 
@@ -202,7 +206,7 @@ begin
202
206
 
203
207
  begin
204
208
  print("checking rb-gsl version...")
205
- File.open("../VERSION") do |f|
209
+ File.open(file_path("../VERSION")) do |f|
206
210
  ver = GSL::Version.new(f.gets.chomp)
207
211
  puts(ver)
208
212
  RB_GSL_CONFIG.printf("#ifndef RUBY_GSL_VERSION\n#define RUBY_GSL_VERSION \"#{ver}\"\n#endif\n")
@@ -223,7 +227,7 @@ begin
223
227
  flag = 0
224
228
  print("checking for GNU graph... ")
225
229
  path.each do |dir|
226
- if File.executable?(file = File.join(dir, "graph"))
230
+ if File.executable?(File.join(dir, "graph"))
227
231
  puts("yes")
228
232
  RB_GSL_CONFIG.printf("#ifndef HAVE_GNU_GRAPH\n#define HAVE_GNU_GRAPH\n#endif\n")
229
233
  flag = 1
@@ -254,8 +258,8 @@ begin
254
258
  require 'rubygems'
255
259
  na_gemspec=Gem::Specification.find_by_path('narray.h')
256
260
  if na_gemspec
257
- narray_config = File.join(na_gemspec.full_gem_path, na_gemspec.require_path)
258
- $CPPFLAGS = " -I#{narray_config} "+$CPPFLAGS
261
+ narray_config = na_gemspec.full_gem_path
262
+ $CPPFLAGS = " -I#{File.join(narray_config, na_gemspec.require_path)} "+$CPPFLAGS
259
263
  $LOCAL_LIBS = " -L#{File.join(narray_config, 'src')}" + $LOCAL_LIBS
260
264
  end
261
265
  rescue LoadError
@@ -268,9 +272,9 @@ if narray_config
268
272
  end
269
273
  end
270
274
 
271
- if enable_config('tamu_anova')
275
+ unless arg_config('--disable-tamu-anova')
272
276
  tamu_anova_config = dir_config('tamu_anova',$sitearchdir,$sitearchdir)
273
- have_tamu_anova_h = have_header("tamu_anova/tamu_anova.h")
277
+ have_header("tamu_anova/tamu_anova.h")
274
278
  if tamu_anova_config
275
279
  have_library("tamuanova")
276
280
  # if RUBY_PLATFORM =~ /cygwin|mingw/
@@ -279,7 +283,7 @@ if tamu_anova_config
279
283
  end
280
284
  end
281
285
 
282
- File.open("../lib/gsl.rb", "w") do |file|
286
+ File.open(file_path("../lib/gsl.rb"), "w") do |file|
283
287
  if have_narray_h
284
288
  file.print("require('narray')\n")
285
289
  end
@@ -288,7 +292,7 @@ File.open("../lib/gsl.rb", "w") do |file|
288
292
  file.print("require('gsl/oper.rb')\n")
289
293
  end
290
294
 
291
- File.open("../lib/rbgsl.rb", "w") do |file|
295
+ File.open(file_path("../lib/rbgsl.rb"), "w") do |file|
292
296
  if have_narray_h
293
297
  file.print("require('narray')\n")
294
298
  end
@@ -296,8 +300,10 @@ File.open("../lib/rbgsl.rb", "w") do |file|
296
300
  file.print("require('gsl/oper.rb')\n")
297
301
  end
298
302
 
303
+ Dir.chdir(file_path) {
299
304
  srcs = Dir.glob("*.c") - ["vector_source.c", "matrix_source.c", "tensor_source.c", "poly_source.c", "block_source.c"]
300
305
 
301
306
  $objs = srcs.collect { |f| f.sub(".c", ".o") }
307
+ }
302
308
 
303
309
  create_makefile("rb_gsl")
@@ -52,7 +52,7 @@ static VALUE rb_gsl_function_set_f(int argc, VALUE *argv, VALUE obj)
52
52
  CHECK_PROC(argv[0]);
53
53
  rb_ary_store(ary, 0, argv[0]);
54
54
  ary2 = rb_ary_new2(argc-1);
55
- for (i = 1; i < argc; i++) rb_ary_store(ary2, i-1, argv[i]);
55
+ for (i = 1; (int) i < argc; i++) rb_ary_store(ary2, i-1, argv[i]);
56
56
  rb_ary_store(ary, 1, ary2);
57
57
  break;
58
58
  }
@@ -221,7 +221,7 @@ static VALUE rb_gsl_function_set_params(int argc, VALUE *argv, VALUE obj)
221
221
  rb_ary_store(ary, 1, argv[0]);
222
222
  } else {
223
223
  ary2 = rb_ary_new2(argc);
224
- for (i = 0; i < argc; i++) rb_ary_store(ary2, i, argv[i]);
224
+ for (i = 0; (int) i < argc; i++) rb_ary_store(ary2, i, argv[i]);
225
225
  rb_ary_store(ary, 1, ary2);
226
226
  }
227
227
  return obj;
@@ -337,7 +337,7 @@ static VALUE rb_gsl_function_fdf_new(int argc, VALUE *argv, VALUE klass)
337
337
  F->params = (void *) ary;
338
338
  rb_ary_store(ary, 2, Qnil);
339
339
  rb_ary_store(ary, 3, Qnil);
340
- for (i = 0; i < argc; i++) setfunc(i, argv, F);
340
+ for (i = 0; (int) i < argc; i++) setfunc(i, argv, F);
341
341
  return Data_Wrap_Struct(klass, gsl_function_fdf_mark, gsl_function_fdf_free, F);
342
342
  }
343
343
 
@@ -360,7 +360,7 @@ static VALUE rb_gsl_function_fdf_set(int argc, VALUE *argv, VALUE obj)
360
360
  ary = (VALUE) F->params;
361
361
  rb_ary_store(ary, 2, Qnil);
362
362
  rb_ary_store(ary, 3, Qnil);
363
- for (i = 0; i < argc; i++) setfunc(i, argv, F);
363
+ for (i = 0; (int) i < argc; i++) setfunc(i, argv, F);
364
364
  return obj;
365
365
  }
366
366
 
@@ -427,7 +427,7 @@ static VALUE rb_gsl_function_fdf_set_params(int argc, VALUE *argv, VALUE obj)
427
427
  rb_ary_store(ary, 3, argv[0]);
428
428
  } else {
429
429
  ary2 = rb_ary_new2(argc);
430
- for (i = 0; i < argc; i++) rb_ary_store(ary2, i, argv[i]);
430
+ for (i = 0; (int) i < argc; i++) rb_ary_store(ary2, i, argv[i]);
431
431
  rb_ary_store(ary, 3, ary2);
432
432
  }
433
433
  return obj;
@@ -31,7 +31,7 @@ static VALUE rb_gsl_vector_to_narray(VALUE obj, VALUE klass)
31
31
  memcpy(NA_PTR_TYPE(nary,double*), v->data, shape[0]*sizeof(double));
32
32
  } else {
33
33
  int i;
34
- for(i=0; i < v->size; i++) {
34
+ for(i=0; i < (int) v->size; i++) {
35
35
  (NA_PTR_TYPE(nary,double*))[i] = gsl_vector_get(v, i);
36
36
  }
37
37
  }
@@ -50,7 +50,7 @@ static VALUE rb_gsl_vector_complex_to_narray(VALUE obj, VALUE klass)
50
50
  memcpy(NA_PTR_TYPE(nary,double*), v->data, shape[0]*2*sizeof(double));
51
51
  } else {
52
52
  int i;
53
- for(i=0; i < 2*v->size; i++) {
53
+ for(i=0; i < (int) (2*v->size); i++) {
54
54
  (NA_PTR_TYPE(nary,gsl_complex*))[i] = gsl_vector_complex_get(v, i);
55
55
  }
56
56
  }
@@ -170,7 +170,7 @@ static VALUE rb_gsl_vector_int_to_narray(VALUE obj, VALUE klass)
170
170
  memcpy(NA_PTR_TYPE(nary,int*), v->data, shape[0]*sizeof(int));
171
171
  } else {
172
172
  int i;
173
- for(i=0; i < v->size; i++) {
173
+ for(i=0; i < (int) v->size; i++) {
174
174
  (NA_PTR_TYPE(nary,int*))[i] = gsl_vector_int_get(v, i);
175
175
  }
176
176
  }
@@ -357,7 +357,7 @@ static VALUE rb_gsl_matrix_to_narray(VALUE obj, VALUE klass)
357
357
  shape[0] = m->size2;
358
358
  shape[1] = m->size1;
359
359
  nary = na_make_object(NA_DFLOAT, 2, shape, klass);
360
- for (i = 0; i < shape[1]; i++) {
360
+ for (i = 0; (int) i < shape[1]; i++) {
361
361
  memcpy(NA_PTR_TYPE(nary,double*)+(i*shape[0]), m->data+(i*m->tda),
362
362
  shape[0]*sizeof(double));
363
363
  }
@@ -384,7 +384,7 @@ static VALUE rb_gsl_matrix_int_to_narray(VALUE obj, VALUE klass)
384
384
  shape[0] = m->size2;
385
385
  shape[1] = m->size1;
386
386
  nary = na_make_object(NA_LINT, 2, shape, klass);
387
- for (i = 0; i < shape[1]; i++) {
387
+ for (i = 0; (int) i < shape[1]; i++) {
388
388
  memcpy(NA_PTR_TYPE(nary,int*)+(i*shape[0]), m->data+(i*m->tda),
389
389
  shape[0]*sizeof(int));
390
390
  }
@@ -583,7 +583,7 @@ EXTERN VALUE cgsl_histogram;
583
583
  static VALUE rb_gsl_narray_histogram(int argc, VALUE *argv, VALUE obj)
584
584
  {
585
585
  double *ptr, *ptr_range;
586
- gsl_histogram *h;
586
+ gsl_histogram *h = NULL;
587
587
  gsl_vector *ranges;
588
588
  gsl_vector_view v;
589
589
  double min, max;