Method: HDLRuby::Viz::Node#next_row_matrix

Defined in:
lib/HDLRuby/hruby_viz.rb

#next_row_matrix(matrix, c0, r) ⇒ Object

Find the next row free from column +c0+ starting for position row +r+ in the place matrix +matrix+. Retuns the new rows and columns.



3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
# File 'lib/HDLRuby/hruby_viz.rb', line 3348

def next_row_matrix(matrix,c0,r)
  puts "next_row_matrix: matrix[0].size=#{matrix[0].size} r=#{r} c0=#{c0}"
  cM = matrix[0].size-1 # Max column.
  while (c0..cM).each.any? { |c| matrix[r][c] } do
    r += 1
    if r >= matrix.size then
      # Need to increase the size of the matrix.
      matrix << ([nil] * matrix[0].size)
    end
  end
  puts "r=#{r}"
  return r
end