Class: Libmf::Matrix
- Inherits:
-
Object
- Object
- Libmf::Matrix
- Defined in:
- lib/libmf/matrix.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
-
#initialize ⇒ Matrix
constructor
A new instance of Matrix.
- #push(row_index, column_index, value) ⇒ Object
Constructor Details
#initialize ⇒ Matrix
Returns a new instance of Matrix.
5 6 7 |
# File 'lib/libmf/matrix.rb', line 5 def initialize @data = [] end |
Instance Attribute Details
#data ⇒ Object (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 |