gsl 1.12.108 → 1.12.109

Sign up to get free protection for your applications and to get access to all the features.
data/ext/vector_complex.c CHANGED
@@ -289,7 +289,14 @@ static VALUE rb_gsl_vector_complex_set(int argc, VALUE *argv, VALUE obj)
289
289
  other = argv[argc-1];
290
290
 
291
291
  if(argc == 1) {
292
- rb_gsl_vector_complex_set_all(argc, argv, obj);
292
+ // // If assigning from another vector
293
+ if(VECTOR_P(other) || VECTOR_COMPLEX_P(other)) {
294
+ // treat as assignment to v.subvector(...)
295
+ rb_gsl_vector_complex_set_subvector(argc-1, argv, v, other);
296
+ } else {
297
+ // treat as set_all
298
+ rb_gsl_vector_complex_set_all(argc, argv, obj);
299
+ }
293
300
  } else if(argc == 2 && TYPE(argv[0]) == T_FIXNUM) {
294
301
  // v[i] = x
295
302
  ii = FIX2INT(argv[0]);
data/ext/vector_source.c CHANGED
@@ -446,7 +446,13 @@ static VALUE FUNCTION(rb_gsl_vector,set)(int argc, VALUE *argv, VALUE obj)
446
446
  other = argv[argc-1];
447
447
 
448
448
  if(argc == 1) {
449
- FUNCTION(gsl_vector,set_all)(v, NUMCONV2(other));
449
+ // // If assigning from another vector
450
+ if(VECTOR_P(other) || VECTOR_INT_P(other)) {
451
+ // treat as assignment to v.subvector(...)
452
+ FUNCTION(rb_gsl_vector,set_subvector)(argc-1, argv, v, other);
453
+ } else {
454
+ FUNCTION(gsl_vector,set_all)(v, NUMCONV2(other));
455
+ }
450
456
  } else if(argc == 2 && TYPE(argv[0]) == T_FIXNUM) {
451
457
  // v[i] = x
452
458
  ii = FIX2INT(argv[0]);
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gsl
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.12.108
4
+ version: 1.12.109
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yoshiki Tsunesada
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2009-11-30 00:00:00 +02:00
13
+ date: 2009-12-09 00:00:00 +02:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency