# File lib/Matriz.rb, line 38 def comprobar() cont_total = 0 cont_ceros = 0 @filas.times do |i| @cols.times do |j| if @matriz[i][j] == 0 cont_ceros = cont_ceros + 1 end cont_total = cont_total + 1 end end if cont_ceros >= (cont_total * 0.6) Matriz_dispersa.new(@matriz) else Matriz_densa.new(@matriz) end end