Closed dustalov closed 11 years ago
I'll look at it in just a few minutes. As a temporary workaround, try setting a dtype. Right now you're creating a Ruby object matrix, but it may work properly with a :float64 or :byte or whatever specific type you need.
It's also worth noting that the operation you're performing (getting columns from a Yale matrix) is going to be very expensive if there are entries in the matrix. Rows is O(1). Columns are log(n).
Also consider trying it in the version currently on github. I may have fixed this bug in a recent push.
I believe this was fixed by https://github.com/SciRuby/nmatrix/commit/31fae098c1f21731221303d828d028d03b1aabcd
Can you please try getting the current version from github? There have been a number of Yale-related bug fixes.
It seems that 31fae09 actually fixes the problem. Thank you very much for the robust response and keep up with good work!
I had encountered a very strange NMatrix behaviour that causes the whole Ruby program to crash randomly.
When I ran this code on Ruby 2.0.0p247, the following lines appeared on my terminal.
It is also interesting that the last
i
value on the output varies from each invocation. I ran this code multiple times and got147
,179
,60
, etc as the last printed values.