Ask a Question related to Ruby, Design and Development.
-
ara howard #1
NArray indexing order: row major vs column major
rubyists-
am i the only one who finds the current NArray indexing order
confusing:
irb(main):001:0> na = NArray.to_na a=[[0,1,2],[3,4,5]]
=> NArray.int(3,2):
[ [ 0, 1, 2 ],
[ 3, 4, 5 ] ]
irb(main):002:0> i, j = 0, 1
=> [0, 1]
# ruby uses row major (last varies fastest) indexing
irb(main):003:0> a[i][j]
=> 1
# narray uses column major (first vaires fastest) indexing
irb(main):004:0> na[i, j]
=> 3
# but the storage itself appears to be row major?!
irb(main):007:0> na.to_s.unpack('i6')
=> [0, 1, 2, 3, 4, 5]
this could be really confusing if one starts thinking of narrays as
column major (due to the index ordering) and processes using for k, j,
i... instead of for i, j, k... logic, or writes an narray to disk
expecting to read it back as records of columns instead of records of
rows
it seems that the storage should at least be consistent with the
indexing, and that both should, ideally, be consistent with ruby.
perhaps i am missing something obvious here, or there is a way to
modify the runtime indexing of narray's, but i have not found anything
yet.
-a
ara howard Guest
-
major join?
what i am trying to do to one poor table is: .......................................................get all... -
newbie needs major help
Hello all I have a list of weblog (blog) entries within a MySQL database which are being retrieved by index.php using the string of $mid=9 where... -
HELP!!!...major problem
Please help...I have made a flash movie in 16:9 format (1777px x 1000px) which I need to convert to a format that can be reproduced by a DVD player... -
Two major problems (for me, anyway)... help..?
Ok, I'm a little embarrassed to be asking anything here. I feel I'm way over my head. Anyway, I have a website I'm working on called mediabelly.com.... -
Major dissapointment
Hi group, The biggest dissapointment with Oracle so far: SQL> select count(*) from factTable; select count(*) from factTable * ERROR at line...



Reply With Quote

