Method: RMatrix::Matrix#mmap

Defined in:
lib/rmatrix/matrix.rb

#mmapObject



120
121
122
123
124
125
126
127
# File 'lib/rmatrix/matrix.rb', line 120

def mmap
  as_na = NArray.to_na(
    matrix.each.map do |elm|
      yield elm
    end
  ).to_type(typecode)
  Matrix.new(as_na.reshape(*shape), typecode)
end