Class: Matrix
- Inherits:
-
Object
- Object
- Matrix
- Defined in:
- lib/cicada/mutable_matrix.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#replace_column(j, other) ⇒ Object
Replaces a column in this matrix by copying the entries from another vector.
-
#replace_row(i, other) ⇒ Object
Replaces a row in this matrix by copying the entries from another vector.
Instance Method Details
#replace_column(j, other) ⇒ Object
Replaces a column in this matrix by copying the entries from another vector.
58 59 60 61 62 |
# File 'lib/cicada/mutable_matrix.rb', line 58 def replace_column(j, other) row_size.times do |i| self[i, j]= other[i] end end |
#replace_row(i, other) ⇒ Object
Replaces a row in this matrix by copying the entries from another vector.
45 46 47 48 49 |
# File 'lib/cicada/mutable_matrix.rb', line 45 def replace_row(i, other) column_size.times do |j| self[i, j]= other[j] end end |