Module: Gecode::Util::MatrixEnumMethods
Overview
Methods that make a matrix an enumerable.
Instance Method Summary collapse
-
#each(&block) ⇒ Object
Iterates over every element in the matrix.
Instance Method Details
#each(&block) ⇒ Object
Iterates over every element in the matrix.
9 10 11 12 13 14 15 |
# File 'lib/gecoder/interface/enum_matrix.rb', line 9 def each(&block) row_size.times do |i| column_size.times do |j| yield self[i,j] end end end |