Class: MathExpansion::Matriz

Inherits:
Object
  • Object
show all
Defined in:
lib/math_expansion/matriz.rb

Direct Known Subclasses

Matriz_Densa, Matriz_Dispersa

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(n, m) ⇒ Matriz

Returns a new instance of Matriz.

Raises:

  • (ArgumentError)


8
9
10
11
12
# File 'lib/math_expansion/matriz.rb', line 8

def initialize(n, m)
  raise ArgumentError, 'Indice no valido' unless n.is_a? Fixnum and n > 0 and m.is_a? Fixnum and m > 0

  @N, @M = n, m
end

Instance Attribute Details

#contenidoObject

Returns the value of attribute contenido.



6
7
8
# File 'lib/math_expansion/matriz.rb', line 6

def contenido
  @contenido
end

#MObject (readonly)

Returns the value of attribute M.



5
6
7
# File 'lib/math_expansion/matriz.rb', line 5

def M
  @M
end

#NObject (readonly)

Returns the value of attribute N.



5
6
7
# File 'lib/math_expansion/matriz.rb', line 5

def N
  @N
end