# File lib/modai_prct12/matrizDensa.rb, line 50 def +(o) if o.instance_of? MatrizDispersa other = to_densa(o) else other = o end suma = Array.new(matriz.size - 1) 0.upto(matriz.size - 1) do |i| suma[i] = Array.new(matriz[i].size - 1) # 0.upto(matriz[i].size - 1) do |j| j = 0 (0...(matriz[i].size)).collect { suma[i][j] = matriz[i][j] + other.matriz[i][j] j += 1 } # end end MatrizDensa.new(suma) end