Class: Matrc::MatrizDispersa

Inherits:
Matriz
  • Object
show all
Defined in:
lib/matrc/matriz_dispersa.rb

Instance Attribute Summary

Attributes inherited from Matriz

#col, #row

Instance Method Summary collapse

Methods inherited from Matriz

#*, #+, #-, #==, #each, #max, #min, #to_s

Constructor Details

#initialize(row, col) ⇒ MatrizDispersa

Returns a new instance of MatrizDispersa.



5
6
7
8
# File 'lib/matrc/matriz_dispersa.rb', line 5

def initialize(row, col)
	super(row,col)
	@matrizdisp = Hash.new(zero)
end

Instance Method Details

#[](row, col) ⇒ Object



10
11
12
# File 'lib/matrc/matriz_dispersa.rb', line 10

def [](row, col)
	@matrizdisp[MiHash.new(row,col)]
end

#[]=(row, col, val) ⇒ Object



14
15
16
17
# File 'lib/matrc/matriz_dispersa.rb', line 14

def []=(row, col, val)
  @matrizdisp[MiHash.new(row,col)] = val 

end