SciRuby / numruby

Fast Numerical Linear Algebra Library for Ruby. NMatrix reimplementation.
BSD 3-Clause "New" or "Revised" License
45 stars 10 forks source link

nmatrix accessors does not work with dtypes other than :nm_float64 #20

Closed Uditgulati closed 5 years ago

Uditgulati commented 5 years ago
[1] pry(main)> n = NMatrix.new [2, 4], [1, 2, 3, 4, 5, 6, -7, 0]
=> 
[2] pry(main)> n[0,0]
=> 1.0
[3] pry(main)> n[1,3]
=> 0.0
[4] pry(main)> n[1,2]
=> -7.0
[5] pry(main)> n = NMatrix.new [2, 4], [1, 2, 3, 4, 5, 6, -7, 0], :nm_int
=> 
[6] pry(main)> n[0,0]
=> 4.2439915824e-314
[7] pry(main)> n[1,3]
=> 0.0
[8] pry(main)> n[1,2]
=> 1.4787e-320
Uditgulati commented 5 years ago

https://github.com/SciRuby/numruby/pull/19/commits/44f8e2d7579d49e01c7930f8e18c305ccbbe9865

Uditgulati commented 5 years ago

Solution merged.