gsl 1.14.7 → 1.15.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. data/ChangeLog +139 -134
  2. data/Rakefile +4 -3
  3. data/VERSION +1 -1
  4. data/ext/array.c +0 -24
  5. data/ext/array_complex.c +11 -10
  6. data/ext/blas1.c +9 -6
  7. data/ext/block_source.c +4 -3
  8. data/ext/dirac.c +0 -6
  9. data/ext/error.c +1 -2
  10. data/ext/extconf.rb +9 -4
  11. data/ext/fft.c +22 -12
  12. data/ext/function.c +2 -2
  13. data/ext/graph.c +2 -0
  14. data/ext/gsl_narray.c +1 -7
  15. data/ext/histogram.c +0 -8
  16. data/ext/ieee.c +3 -1
  17. data/ext/integration.c +5 -3
  18. data/ext/linalg.c +11 -16
  19. data/ext/linalg_complex.c +1 -3
  20. data/ext/matrix_complex.c +10 -5
  21. data/ext/matrix_int.c +10 -10
  22. data/ext/matrix_source.c +3 -2
  23. data/ext/multifit.c +21 -29
  24. data/ext/multimin.c +1 -3
  25. data/ext/odeiv.c +9 -6
  26. data/ext/poly_source.c +82 -52
  27. data/ext/sf_bessel.c +8 -4
  28. data/ext/sf_coulomb.c +8 -8
  29. data/ext/sf_coupling.c +9 -6
  30. data/ext/sf_dilog.c +3 -2
  31. data/ext/sf_elementary.c +6 -4
  32. data/ext/sf_elljac.c +3 -2
  33. data/ext/sf_exp.c +15 -10
  34. data/ext/sf_gamma.c +9 -6
  35. data/ext/sf_gegenbauer.c +3 -2
  36. data/ext/sf_hyperg.c +18 -12
  37. data/ext/sf_laguerre.c +3 -2
  38. data/ext/sf_legendre.c +3 -2
  39. data/ext/sf_log.c +3 -2
  40. data/ext/sf_power.c +3 -2
  41. data/ext/sf_trigonometric.c +9 -6
  42. data/ext/signal.c +1 -3
  43. data/ext/siman.c +1 -2
  44. data/ext/stats.c +1 -0
  45. data/ext/vector_complex.c +5 -2
  46. data/ext/vector_double.c +13 -8
  47. data/ext/vector_source.c +6 -5
  48. data/ext/wavelet.c +16 -8
  49. data/include/rb_gsl_common.h +5 -6
  50. data/include/rb_gsl_config.h +62 -0
  51. data/include/rb_gsl_with_narray.h +6 -1
  52. data/lib/gsl.rb +3 -0
  53. data/lib/rbgsl.rb +3 -0
  54. data/rdoc/fit.rdoc +5 -5
  55. data/rdoc/ndlinear.rdoc +5 -2
  56. data/tests/gsl_test2.rb +3 -0
  57. data/tests/matrix/matrix_complex_test.rb +36 -0
  58. data/tests/narray/blas_dnrm2.rb +20 -0
  59. data/tests/poly/poly.rb +48 -0
  60. data/tests/sf/test_mode.rb +19 -0
  61. data/tests/stats_mt.rb +16 -0
  62. metadata +15 -11
  63. data/ext/MANIFEST +0 -119
data/Rakefile CHANGED
@@ -1,5 +1,5 @@
1
1
  require 'rubygems'
2
- require 'rake/gempackagetask'
2
+ require 'rubygems/package_task'
3
3
  require 'rake/rdoctask'
4
4
 
5
5
  RB_GSL_VERSION = File.readlines('VERSION')[0].chomp
@@ -33,7 +33,8 @@ spec = Gem::Specification.new do |s|
33
33
  'THANKS',
34
34
  'VERSION',
35
35
  'examples/**/*',
36
- 'ext/*',
36
+ 'ext/extconf.rb',
37
+ 'ext/*.c',
37
38
  'lib/**/*',
38
39
  'include/*',
39
40
  'rdoc/*',
@@ -69,7 +70,7 @@ Rake::PackageTask.new('rb-gsl', RB_GSL_VERSION) do |pkg|
69
70
  pkg.package_files = spec.files
70
71
  end
71
72
 
72
- Rake::GemPackageTask.new(spec) do |pkg|
73
+ Gem::PackageTask.new(spec) do |pkg|
73
74
  pkg.need_zip = false
74
75
  pkg.need_tar = false
75
76
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.14.7
1
+ 1.15.3
@@ -169,21 +169,6 @@ void cvector_set_from_carray(gsl_vector *v, const double *a)
169
169
  for (i = 0; i < v->size; i++) gsl_vector_set(v, i, a[i]);
170
170
  }
171
171
 
172
- void cvector_set_from_rarrays(gsl_vector *v, VALUE ary)
173
- {
174
- if (CLASS_OF(ary) == rb_cRange) ary = rb_gsl_range2ary(ary);
175
- if (TYPE(ary) == T_ARRAY) {
176
- return cvector_set_from_rarray(v, ary);
177
- #ifdef HAVE_NARRAY_H
178
- } else if (NA_IsNArray(ary)) {
179
- return cvector_set_from_narray(v, ary);
180
- #endif
181
- } else {
182
- rb_raise(rb_eTypeError,
183
- "wrong argument type %s", rb_class2name(CLASS_OF(ary)));
184
- }
185
- }
186
-
187
172
  void carray_set_from_cvector(double *a, const gsl_vector *v)
188
173
  {
189
174
  size_t i;
@@ -255,15 +240,6 @@ gsl_vector* make_cvector_from_narray(VALUE ary)
255
240
  return v;
256
241
  }
257
242
 
258
- void cvector_set_from_narray(gsl_vector *v, VALUE ary)
259
- {
260
- int size;
261
- if (!NA_IsNArray(ary))
262
- rb_raise(rb_eTypeError,
263
- "wrong argument type %s", rb_class2name(CLASS_OF(ary)));
264
- size = NA_TOTAL(ary);
265
- carray_set_from_narray(v->data, ary);
266
- }
267
243
  #endif
268
244
 
269
245
  gsl_vector_complex* make_vector_complex_clone(const gsl_vector_complex *v)
@@ -30,29 +30,30 @@ static VALUE rb_gsl_complex_arithmetics5(int flag, VALUE obj, VALUE bb)
30
30
  gsl_vector *v = NULL;
31
31
  gsl_vector_complex *cv = NULL, *cvnew = NULL;
32
32
  gsl_complex (*func1)(gsl_complex, gsl_complex);
33
- int (*func2)(gsl_matrix_complex*, const gsl_matrix_complex*);
34
- int (*func3)(gsl_matrix_complex*, const gsl_complex);
33
+ // local variables "func2" iand "func3" declared and set, but never used
34
+ //int (*func2)(gsl_matrix_complex*, const gsl_matrix_complex*);
35
+ //int (*func3)(gsl_matrix_complex*, const gsl_complex);
35
36
  int flagcm = 0;
36
37
  switch (flag) {
37
38
  case GSL_COMPLEX_ADD:
38
39
  func1 = gsl_complex_add;
39
- func2 = gsl_matrix_complex_add;
40
- func3 = gsl_matrix_complex_add_constant;
40
+ //func2 = gsl_matrix_complex_add;
41
+ //func3 = gsl_matrix_complex_add_constant;
41
42
  break;
42
43
  case GSL_COMPLEX_SUB:
43
44
  func1 = gsl_complex_sub;
44
- func2 = gsl_matrix_complex_sub;
45
- func3 = gsl_matrix_complex_add_constant;
45
+ //func2 = gsl_matrix_complex_sub;
46
+ //func3 = gsl_matrix_complex_add_constant;
46
47
  break;
47
48
  case GSL_COMPLEX_MUL:
48
49
  func1 = gsl_complex_mul;
49
- func2 = gsl_matrix_complex_mul_elements;
50
- func3 = gsl_matrix_complex_scale;
50
+ //func2 = gsl_matrix_complex_mul_elements;
51
+ //func3 = gsl_matrix_complex_scale;
51
52
  break;
52
53
  case GSL_COMPLEX_DIV:
53
54
  func1 = gsl_complex_div;
54
- func2 = gsl_matrix_complex_div_elements;
55
- func3 = gsl_matrix_complex_scale;
55
+ //func2 = gsl_matrix_complex_div_elements;
56
+ //func3 = gsl_matrix_complex_scale;
56
57
  break;
57
58
  default:
58
59
  rb_raise(rb_eRuntimeError, "undefined operation");
@@ -116,32 +116,35 @@ static int get_vector_complex2(int argc, VALUE *argv, VALUE obj,
116
116
  static VALUE rb_gsl_blas_ddot(int argc, VALUE *argv, VALUE obj)
117
117
  {
118
118
  double r;
119
- int status;
119
+ // local variable "status" declared and set, but never used
120
+ //int status;
120
121
  gsl_vector *x = NULL, *y = NULL;
121
122
  get_vector2(argc, argv, obj, &x, &y);
122
- status = gsl_blas_ddot(x, y, &r);
123
+ /*status =*/ gsl_blas_ddot(x, y, &r);
123
124
  return rb_float_new(r);
124
125
  }
125
126
 
126
127
  static VALUE rb_gsl_blas_zdotu(int argc, VALUE *argv, VALUE obj)
127
128
  {
128
129
  gsl_complex *r;
129
- int status;
130
+ // local variable "status" declared and set, but never used
131
+ //int status;
130
132
  gsl_vector_complex *x = NULL, *y = NULL;
131
133
  get_vector_complex2(argc, argv, obj, &x, &y);
132
134
  r = ALLOC(gsl_complex);
133
- status = gsl_blas_zdotu(x, y, r);
135
+ /*status =*/ gsl_blas_zdotu(x, y, r);
134
136
  return Data_Wrap_Struct(cgsl_complex, 0, free, r);
135
137
  }
136
138
 
137
139
  static VALUE rb_gsl_blas_zdotc(int argc, VALUE *argv, VALUE obj)
138
140
  {
139
141
  gsl_complex *r;
140
- int status;
142
+ // local variable "status" declared and set, but never used
143
+ //int status;
141
144
  gsl_vector_complex *x = NULL, *y = NULL;
142
145
  get_vector_complex2(argc, argv, obj, &x, &y);
143
146
  r = ALLOC(gsl_complex);
144
- status = gsl_blas_zdotc(x, y, r);
147
+ /*status =*/ gsl_blas_zdotc(x, y, r);
145
148
  return Data_Wrap_Struct(cgsl_complex, 0, free, r);
146
149
  }
147
150
 
@@ -547,7 +547,8 @@ static VALUE FUNCTION(rb_gsl_block,compare)(VALUE aa, VALUE bb,
547
547
  GSL_TYPE(gsl_block) *a, *b;
548
548
  /* gsl_block_int *c;*/
549
549
  gsl_block_uchar *c;
550
- int status;
550
+ // local variable "status" declared and set, but never used
551
+ //int status;
551
552
  Data_Get_Struct(aa, GSL_TYPE(gsl_block), a);
552
553
  c = gsl_block_uchar_alloc(a->size);
553
554
  if (BL_P(bb)) {
@@ -555,9 +556,9 @@ static VALUE FUNCTION(rb_gsl_block,compare)(VALUE aa, VALUE bb,
555
556
  if (a->size != b->size)
556
557
  rb_raise(rb_eRuntimeError, "Block size mismatch, %d and %d", (int) a->size,
557
558
  (int) b->size);
558
- status = (*cmp)(a, b, c);
559
+ /*status =*/ (*cmp)(a, b, c);
559
560
  } else {
560
- status = (*cmp2)(a, NUMCONV(bb), c);
561
+ /*status =*/ (*cmp2)(a, NUMCONV(bb), c);
561
562
  }
562
563
  return Data_Wrap_Struct(cgsl_block_uchar, 0, gsl_block_uchar_free, c);
563
564
  }
@@ -33,9 +33,6 @@ static VALUE rb_dirac_commute(VALUE obj, VALUE mm1, VALUE mm2)
33
33
  {
34
34
  gsl_matrix_complex *m1, *m2;
35
35
  gsl_matrix_complex *mnew1, *mnew2;
36
- gsl_complex z, z2;
37
- z.dat[0] = 1; z.dat[1] = 0;
38
- z2.dat[0] = 0; z2.dat[1] = 0;
39
36
  CHECK_MATRIX_COMPLEX(mm1);
40
37
  CHECK_MATRIX_COMPLEX(mm2);
41
38
  Data_Get_Struct(mm1, gsl_matrix_complex, m1);
@@ -54,9 +51,6 @@ static VALUE rb_dirac_anticommute(VALUE obj, VALUE mm1, VALUE mm2)
54
51
  {
55
52
  gsl_matrix_complex *m1, *m2;
56
53
  gsl_matrix_complex *mnew1, *mnew2;
57
- gsl_complex z, z2;
58
- z.dat[0] = 1; z.dat[1] = 0;
59
- z2.dat[0] = 0; z2.dat[1] = 0;
60
54
  CHECK_MATRIX_COMPLEX(mm1);
61
55
  CHECK_MATRIX_COMPLEX(mm2);
62
56
  Data_Get_Struct(mm1, gsl_matrix_complex, m1);
@@ -38,12 +38,11 @@ static void rb_gsl_my_error_handler(const char *reason, const char *file,
38
38
  {
39
39
  VALUE vreason, vfile;
40
40
  VALUE vline, verrno;
41
- VALUE result;
42
41
  vreason = rb_str_new2(reason);
43
42
  vfile = rb_str_new2(file);
44
43
  vline = INT2FIX(line);
45
44
  verrno = INT2FIX(gsl_errno);
46
- result = rb_funcall(eHandler, RBGSL_ID_call, 4, vreason, vfile, vline, verrno);
45
+ rb_funcall(eHandler, RBGSL_ID_call, 4, vreason, vfile, vline, verrno);
47
46
  }
48
47
 
49
48
  static VALUE rb_gsl_set_error_handler(int argc, VALUE *argv, VALUE module)
@@ -126,14 +126,19 @@ def check_version(configfile)
126
126
 
127
127
  if ver >= "1.14"
128
128
  configfile.printf("#ifndef GSL_1_14_LATER\n#define GSL_1_14_LATER\n#endif\n")
129
- end
130
-
129
+ end
130
+
131
+ if ver >= "1.15"
132
+ configfile.printf("#ifndef GSL_1_15_LATER\n#define GSL_1_15_LATER\n#endif\n")
133
+ end
134
+
131
135
  end
132
136
  end
133
137
 
134
138
  #####
135
139
 
136
- $CFLAGS = " -Wall -I../include "
140
+ $CFLAGS ||= ''
141
+ $CFLAGS += " -Wall -I../include "
137
142
 
138
143
  begin
139
144
  RB_GSL_CONFIG = File.open("../include/rb_gsl_config.h", "w")
@@ -242,7 +247,7 @@ narray_config = dir_config('narray',$sitearchdir,$sitearchdir)
242
247
  # Try to find narray with RubyGems
243
248
  begin
244
249
  require 'rubygems'
245
- na_gemspec=Gem.searcher.find('narray.h')
250
+ na_gemspec=Gem::Specification.find_by_path('narray.h')
246
251
  if na_gemspec
247
252
  narray_config = File.join(na_gemspec.full_gem_path, na_gemspec.require_path)
248
253
  $CPPFLAGS = " -I#{narray_config} "+$CPPFLAGS
data/ext/fft.c CHANGED
@@ -463,7 +463,9 @@ static VALUE rb_fft_complex_trans(int argc, VALUE *argv, VALUE obj,
463
463
  gsl_fft_complex_workspace *),
464
464
  int sss)
465
465
  {
466
- int flag = 0, status;
466
+ int flag = 0;
467
+ // local variable "status" was defined and set, but never used
468
+ //int status;
467
469
  size_t stride, n;
468
470
  gsl_complex_packed_array data;
469
471
  gsl_vector_complex *vin, *vout;
@@ -473,11 +475,11 @@ static VALUE rb_fft_complex_trans(int argc, VALUE *argv, VALUE obj,
473
475
  if (sss == RB_GSL_FFT_COPY) {
474
476
  vout = gsl_vector_complex_alloc(n);
475
477
  gsl_vector_complex_memcpy(vout, vin);
476
- status = (*transform)(vout->data, vout->stride /*1*/, vout->size /*n*/, table, space);
478
+ /*status =*/ (*transform)(vout->data, vout->stride /*1*/, vout->size /*n*/, table, space);
477
479
  gsl_fft_free(flag, (GSL_FFT_Wavetable *) table, (GSL_FFT_Workspace *) space);
478
480
  return Data_Wrap_Struct(cgsl_vector_complex, 0, gsl_vector_complex_free, vout);
479
481
  } else { /* in-place */
480
- status = (*transform)(data, stride, n, table, space);
482
+ /*status =*/ (*transform)(data, stride, n, table, space);
481
483
  gsl_fft_free(flag, (GSL_FFT_Wavetable *) table, (GSL_FFT_Workspace *) space);
482
484
  return obj;
483
485
  }
@@ -497,7 +499,9 @@ static VALUE rb_gsl_fft_complex_forward2(int argc, VALUE *argv, VALUE obj)
497
499
 
498
500
  static VALUE rb_gsl_fft_complex_transform(int argc, VALUE *argv, VALUE obj)
499
501
  {
500
- int flag = 0, status;
502
+ int flag = 0;
503
+ // local variable "status" was defined and set, but never used
504
+ //int status;
501
505
  size_t stride, n;
502
506
  gsl_vector_complex *vin, *vout;
503
507
  gsl_fft_direction sign;
@@ -509,7 +513,7 @@ static VALUE rb_gsl_fft_complex_transform(int argc, VALUE *argv, VALUE obj)
509
513
  flag = gsl_fft_get_argv_complex(argc-1, argv, obj, &vin, &data, &stride, &n, &table, &space);
510
514
  vout = gsl_vector_complex_alloc(n);
511
515
  gsl_vector_complex_memcpy(vout, vin);
512
- status = gsl_fft_complex_transform(vout->data, stride, n, table, space, sign);
516
+ /*status =*/ gsl_fft_complex_transform(vout->data, stride, n, table, space, sign);
513
517
  gsl_fft_free(flag, (GSL_FFT_Wavetable *) table, (GSL_FFT_Workspace *) space);
514
518
  return Data_Wrap_Struct(cgsl_vector_complex, 0, gsl_vector_complex_free, vout);
515
519
  }
@@ -517,7 +521,9 @@ static VALUE rb_gsl_fft_complex_transform(int argc, VALUE *argv, VALUE obj)
517
521
  /* in-place */
518
522
  static VALUE rb_gsl_fft_complex_transform2(int argc, VALUE *argv, VALUE obj)
519
523
  {
520
- int flag = 0, status;
524
+ int flag = 0;
525
+ // local variable "status" was defined and set, but never used
526
+ //int status;
521
527
  size_t stride, n;
522
528
  gsl_fft_direction sign;
523
529
  gsl_complex_packed_array data;
@@ -526,7 +532,7 @@ static VALUE rb_gsl_fft_complex_transform2(int argc, VALUE *argv, VALUE obj)
526
532
  CHECK_FIXNUM(argv[argc-1]);
527
533
  sign = FIX2INT(argv[argc-1]);
528
534
  flag = gsl_fft_get_argv_complex(argc-1, argv, obj, NULL, &data, &stride, &n, &table, &space);
529
- status = gsl_fft_complex_transform(data, stride, n, table, space, sign);
535
+ /*status =*/ gsl_fft_complex_transform(data, stride, n, table, space, sign);
530
536
  gsl_fft_free(flag, (GSL_FFT_Wavetable *) table, (GSL_FFT_Workspace *) space);
531
537
  return obj;
532
538
  }
@@ -666,7 +672,9 @@ static VALUE rb_fft_real_trans(int argc, VALUE *argv, VALUE obj,
666
672
  gsl_fft_real_workspace *),
667
673
  int sss)
668
674
  {
669
- int flag = 0, status, naflag = 0;
675
+ int flag = 0, naflag = 0;
676
+ // local variable "status" was defined and set, but never used
677
+ //int status;
670
678
  size_t stride, n;
671
679
  gsl_vector *vnew;
672
680
  gsl_vector_view vv;
@@ -708,9 +716,9 @@ static VALUE rb_fft_real_trans(int argc, VALUE *argv, VALUE obj,
708
716
  } else {
709
717
  rb_raise(rb_eRuntimeError, "something wrong");
710
718
  }
711
- status = (*trans)(ptr2, stride, n, table, space);
719
+ /*status =*/ (*trans)(ptr2, stride, n, table, space);
712
720
  gsl_fft_free(flag, (GSL_FFT_Wavetable *) table, (GSL_FFT_Workspace *) space);
713
- return ary;
721
+ return ary;
714
722
  }
715
723
 
716
724
  static VALUE rb_gsl_fft_real_transform(int argc, VALUE *argv, VALUE obj)
@@ -730,7 +738,9 @@ static VALUE rb_fft_halfcomplex_trans(int argc, VALUE *argv, VALUE obj,
730
738
  const gsl_fft_halfcomplex_wavetable *, gsl_fft_real_workspace *),
731
739
  int sss)
732
740
  {
733
- int flag = 0, status, naflag = 0;
741
+ int flag = 0, naflag = 0;
742
+ // local variable "status" was defined and set, but never used
743
+ //int status;
734
744
  size_t stride, n;
735
745
  gsl_vector *vnew;
736
746
  gsl_vector_view vv;
@@ -773,7 +783,7 @@ static VALUE rb_fft_halfcomplex_trans(int argc, VALUE *argv, VALUE obj,
773
783
  } else {
774
784
  rb_raise(rb_eRuntimeError, "something wrong");
775
785
  }
776
- status = (*trans)(ptr2, stride, n, table, space);
786
+ /*status =*/ (*trans)(ptr2, stride, n, table, space);
777
787
  gsl_fft_free(flag, (GSL_FFT_Wavetable *) table, (GSL_FFT_Workspace *) space);
778
788
  return ary;
779
789
  }
@@ -485,13 +485,13 @@ static void rb_gsl_function_fdf_fdf(double x, void *p, double *f, double *df)
485
485
 
486
486
  void Init_gsl_function(VALUE module)
487
487
  {
488
- VALUE cgsl_function_fdf2;
489
488
  RBGSL_ID_call = rb_intern("call");
490
489
  RBGSL_ID_arity = rb_intern("arity");
491
490
 
492
491
  cgsl_function = rb_define_class_under(module, "Function", cGSL_Object);
493
492
  cgsl_function_fdf = rb_define_class_under(module, "Function_fdf", cGSL_Object);
494
- cgsl_function_fdf2 = rb_define_class_under(cgsl_function_fdf, "Fdf", cgsl_function_fdf);
493
+ // This Fdf class seems superfluous. Should probably be deleted?
494
+ rb_define_class_under(cgsl_function_fdf, "Fdf", cgsl_function_fdf);
495
495
 
496
496
  /* rb_define_singleton_method(cgsl_function, "new", rb_gsl_function_new, -1);*/
497
497
  rb_define_singleton_method(cgsl_function, "alloc", rb_gsl_function_alloc, -1);
@@ -971,6 +971,7 @@ static VALUE rb_gsl_graph_O(VALUE obj)
971
971
  return g->O;
972
972
  }
973
973
 
974
+ #ifdef HAVE_GNU_GRAPH
974
975
  static void gsl_graph_set_command(gsl_graph *g, char *command)
975
976
  {
976
977
  char str[256];
@@ -1200,6 +1201,7 @@ static void gsl_graph_set_command(gsl_graph *g, char *command)
1200
1201
  if (g->O == Qtrue)
1201
1202
  sprintf(command, "%s -O", command);
1202
1203
  }
1204
+ #endif
1203
1205
 
1204
1206
  static VALUE rb_gsl_graph_graph(int argc, VALUE *argv, VALUE obj)
1205
1207
  {
@@ -31,8 +31,6 @@ 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
- struct NARRAY *na;
35
- GetNArray(nary, na);
36
34
  for(i=0; i < v->size; i++) {
37
35
  (NA_PTR_TYPE(nary,double*))[i] = gsl_vector_get(v, i);
38
36
  }
@@ -52,8 +50,6 @@ static VALUE rb_gsl_vector_complex_to_narray(VALUE obj, VALUE klass)
52
50
  memcpy(NA_PTR_TYPE(nary,double*), v->data, shape[0]*2*sizeof(double));
53
51
  } else {
54
52
  int i;
55
- struct NARRAY *na;
56
- GetNArray(nary, na);
57
53
  for(i=0; i < 2*v->size; i++) {
58
54
  (NA_PTR_TYPE(nary,gsl_complex*))[i] = gsl_vector_complex_get(v, i);
59
55
  }
@@ -174,8 +170,6 @@ static VALUE rb_gsl_vector_int_to_narray(VALUE obj, VALUE klass)
174
170
  memcpy(NA_PTR_TYPE(nary,int*), v->data, shape[0]*sizeof(int));
175
171
  } else {
176
172
  int i;
177
- struct NARRAY *na;
178
- GetNArray(nary, na);
179
173
  for(i=0; i < v->size; i++) {
180
174
  (NA_PTR_TYPE(nary,int*))[i] = gsl_vector_int_get(v, i);
181
175
  }
@@ -244,7 +238,7 @@ static VALUE rb_gsl_na_to_gsl_vector_method(VALUE na)
244
238
  return v;
245
239
  }
246
240
 
247
- static VALUE rb_gsl_na_to_gsl_vector_view_method(VALUE na)
241
+ VALUE rb_gsl_na_to_gsl_vector_view_method(VALUE na)
248
242
  {
249
243
  VALUE v;
250
244
 
@@ -1026,7 +1026,6 @@ struct fit_histogram {
1026
1026
 
1027
1027
  static VALUE rb_gsl_histogram_fit_exponential(int argc, VALUE *argv, VALUE obj)
1028
1028
  {
1029
- struct fit_histogram hh;
1030
1029
  gsl_histogram *h;
1031
1030
  gsl_vector *x, *lny, *w;
1032
1031
  size_t binstart = 0, binend, n, p = 2, dof, i;
@@ -1047,9 +1046,6 @@ static VALUE rb_gsl_histogram_fit_exponential(int argc, VALUE *argv, VALUE obj)
1047
1046
  rb_raise(rb_eArgError, "too many arguments (%d for 0 or 2)", argc);
1048
1047
  break;
1049
1048
  }
1050
- hh.h = h;
1051
- hh.binstart = binstart;
1052
- hh.binend = binend;
1053
1049
  n = binend - binstart + 1;
1054
1050
  dof = n - p;
1055
1051
 
@@ -1076,7 +1072,6 @@ static VALUE rb_gsl_histogram_fit_exponential(int argc, VALUE *argv, VALUE obj)
1076
1072
 
1077
1073
  static VALUE rb_gsl_histogram_fit_power(int argc, VALUE *argv, VALUE obj)
1078
1074
  {
1079
- struct fit_histogram hh;
1080
1075
  gsl_histogram *h;
1081
1076
  gsl_vector *lnx, *lny, *w;
1082
1077
  size_t binstart = 0, binend, n, p = 2, dof, i;
@@ -1097,9 +1092,6 @@ static VALUE rb_gsl_histogram_fit_power(int argc, VALUE *argv, VALUE obj)
1097
1092
  rb_raise(rb_eArgError, "too many arguments (%d for 0 or 2)", argc);
1098
1093
  break;
1099
1094
  }
1100
- hh.h = h;
1101
- hh.binstart = binstart;
1102
- hh.binend = binend;
1103
1095
  n = binend - binstart + 1;
1104
1096
  dof = n - p;
1105
1097