Class: MatrixExpansion::Matriz

Inherits:
Object
  • Object
show all
Defined in:
lib/matrix_expansion/matrix.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)


24
25
26
27
28
# File 'lib/matrix_expansion/matrix.rb', line 24

def initialize(n, m)
  raise ArgumentError, 'Valores para filas y columnas incorrectas' unless n.is_a? Fixnum and n > 0 and m.is_a? Fixnum and m > 0

  @fil, @col= n, m
end

Instance Attribute Details

#colObject (readonly)

Returns the value of attribute col.



21
22
23
# File 'lib/matrix_expansion/matrix.rb', line 21

def col
  @col
end

#filObject (readonly)

Returns the value of attribute fil.



21
22
23
# File 'lib/matrix_expansion/matrix.rb', line 21

def fil
  @fil
end

#matrixObject

Returns the value of attribute matrix.



22
23
24
# File 'lib/matrix_expansion/matrix.rb', line 22

def matrix
  @matrix
end