From: Larry Evans Date: 2011-01-12T01:35:17+09:00 Subject: Re: Nooby question : multidimensional arrays. On 01/10/11 07:06, Kedar Mhaswade wrote: > Larry, > > Thanks for references and detailed review. I will go over them to > understand them better. Just to reiterate, my implementation is pretty > rudimentary at this point and more importantly, it caters for the cases > where the number of elements in *every dimension* is assumed to be the > same (IOW, you can't simply represent a 2x3 matrix is it). > > -Kedar > Kadar, I was looking through my computers ruby packages and found one: libnarray-ruby1.9.1 claiming it: has numerical n-dimensional array class Googling found: https://github.com/princelab/narray/wiki/Tentative-NArray-Tutorial So, I tried it and, it works: /home/evansl/prog_dev/ruby $ irb1.9.1 irb(main):001:0> require 'narray' => true irb(main):002:0> a = NArray.int(2,3,4) => NArray.int(2,3,4): [ [ [ 0, 0 ], [ 0, 0 ], [ 0, 0 ] ], [ [ 0, 0 ], [ 0, 0 ], [ 0, 0 ] ], [ [ 0, 0 ], [ 0, 0 ], [ 0, 0 ] ], [ [ 0, 0 ], ... irb(main):003:0> HTH. -Larry