Class: Libmf::Matrix

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMatrix

Returns a new instance of Matrix.



5
6
7
# File 'lib/libmf/matrix.rb', line 5

def initialize
  @data = []
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



3
4
5
# File 'lib/libmf/matrix.rb', line 3

def data
  @data
end

Instance Method Details

#push(row_index, column_index, value) ⇒ Object



9
10
11
# File 'lib/libmf/matrix.rb', line 9

def push(row_index, column_index, value)
  @data << [row_index, column_index, value]
end