Class: SparseMatrix::AbstractMatrix

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

Overview

clase abstracta matrix

Direct Known Subclasses

DenseMatrix, SparseMatrix

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(r = 0, c = 0) ⇒ AbstractMatrix

Returns a new instance of AbstractMatrix.



26
27
28
29
# File 'lib/sparse_matrix.rb', line 26

def initialize(r=0,c=0)
    @row = r
    @column = c
end

Instance Attribute Details

#columnObject

Returns the value of attribute column.



31
32
33
# File 'lib/sparse_matrix.rb', line 31

def column
  @column
end

#rowObject

Returns the value of attribute row.



31
32
33
# File 'lib/sparse_matrix.rb', line 31

def row
  @row
end

Instance Method Details

#*(b) ⇒ Object



48
49
50
# File 'lib/sparse_matrix.rb', line 48

def *(b)
    raise "Error. metodo no definido."
end

#+(b) ⇒ Object



45
46
47
# File 'lib/sparse_matrix.rb', line 45

def +(b)
    raise "Error. metodo no definido."
end


41
42
43
# File 'lib/sparse_matrix.rb', line 41

def print_matrix
    raise "Error. metodo no definido."
end

#read_matrixObject



33
34
35
# File 'lib/sparse_matrix.rb', line 33

def read_matrix
    raise "Error. metodo no definido."
end

#to_sObject



37
38
39
# File 'lib/sparse_matrix.rb', line 37

def to_s
    raise "Error. metodo no definido."
end