From: "baptiste AuguiƩ" Date: 2007-07-07T21:08:31+09:00 Subject: Re: simple question on rbgsl vectors --Apple-Mail-2--655520688 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=ISO-8859-1; delsp=yes; format=flowed update: this is apparently a bug in rb-gsl. The author has a patch, =20 it should be fixed in the next version. On 6 Jul 2007, at 21:35, Gavin Kistner wrote: > From: baptiste Augui=E9 [mailto:ba208@exeter.ac.uk] > Sent: Friday, July 06, 2007 1:57 PM >> Does anybody see this odd behavior: >> >> irb(main):001:0> require("rbgsl") >> =3D> true >> irb(main):002:0> v =3D GSL::Vector[0..5] >> =3D> GSL::Vector: [ 0.000e+00 1.000e+00 2.000e+00 3.000e+00 4.000e+00 >> 5.000e+00 ] >> irb(main):003:0> v[2] >> =3D> 2.0 >> irb(main):004:0> v[1, 3, 4] >> =3D> GSL::Vector: [ 0.000e+00 1.000e+00 2.000e+00 ] >> >> **** where is should expect **** >> >> =3D> 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, =20 > but (maybe) if you did: > v[ [1,3,4] ] > you might get the result you desire. > ________________ --Apple-Mail-2--655520688--