# File lib/Matriz_dispersa.rb, line 7 def initialize(m) @filas = m.size @cols = m[1].size aux_m = Hash.new @filas.times do |i| @cols.times do |j| if m[i][j] != 0 aux_m[i.to_s+"_"+j.to_s] = m[i][j] end end end @matriz = aux_m end