# Re: simple question on rbgsl vectors

**URL:** <https://www.ruby-forum.com/t/re-simple-question-on-rbgsl-vectors/108779>\
**Category:** Ruby\
**Created:** [July 6, 2007, 10:37pm UTC](https://www.ruby-forum.com/t/re-simple-question-on-rbgsl-vectors/108779 "2007-07-06T22:37:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![phrogz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/2acd7d/32.png) [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Post date:** [July 6, 2007, 10:37pm UTC](https://www.ruby-forum.com/t/re-simple-question-on-rbgsl-vectors/108779/1 "2007-07-06T22:37:38Z")

</div>

From: baptiste Auguié [[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)]  
Sent: Friday, July 06, 2007 1:57 PM

> =\> GSL::Vector: [0.000e+00 1.000e+00 2.000e+00]
> 
> \*\*\*\* where is should expect \*\*\*\*
> 
> =\> GSL::Vector: [1.000e+00 3.000e+00 4.000e+00]

I’ve never used GSL, but it looks like it relies on NArray.  
It looks like NArray#[] doesn’t do what you expect for the above, but  
(maybe) if you did:  
v[[1,3,4] ]  
you might get the result you desire.

---

<div class="post-metadata">

**Author:** ![phrogz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/2acd7d/32.png) [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Post date:** [July 6, 2007, 10:48pm UTC](https://www.ruby-forum.com/t/re-simple-question-on-rbgsl-vectors/108779/2 "2007-07-06T22:48:40Z")

</div>

thanks for the suggestion, sadly

> v[[1,3,4] ]

returns the wrong result too ☹

---

<div class="post-metadata">

**Author:** ![phrogz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/2acd7d/32.png) [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Post date:** [July 7, 2007, 2:09pm UTC](https://www.ruby-forum.com/t/re-simple-question-on-rbgsl-vectors/108779/3 "2007-07-07T14:09:37Z")

</div>

update: this is apparently a bug in rb-gsl. The author has a patch,  
it should be fixed in the next version.
