Forum: Ruby Re: simple question on rbgsl vectors

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
825738339f48c5b8b2a72c02caf3d91c?d=identicon&s=25 Gavin Kistner (Guest)
on 2007-07-06 22:37
(Received via mailing list)
From: baptiste Auguié []
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.
781bbc538a313e3db67406599e1eb4a1?d=identicon&s=25 baptiste Auguié (Guest)
on 2007-07-06 22:48
(Received via mailing list)
thanks for the suggestion, sadly

>   v[ [1,3,4] ]

returns  the wrong result too :-(
781bbc538a313e3db67406599e1eb4a1?d=identicon&s=25 baptiste Auguié (Guest)
on 2007-07-07 14:09
(Received via mailing list)
update: this is apparently a bug in rb-gsl. The author has a patch,
it should be fixed in the next version.
This topic is locked and can not be replied to.