stdlib/matrix.rb
#
# Returns a matrix that is the result of iteration of the given block over all
# elements of the matrix.
#   Matrix[ [1,2], [3,4] ].collect { |e| e**2 }
#     => 1  4
#        9 16
#
Returns a matrix that is the result of iteration of the given block over all
elements of the matrix.
Returns a matrix that is the result of iteration of the given block over all elements of the matrix .
def collect(&block) 
    return to_enum(:collect) unless block_given?
    rows = @rows.collect{|row| row.collect(&block)}
    new_matrix rows, column_count
  end
def collect ( & block ) return to_enum ( :collect ) unless block_given? rows = @rows . collect { | row | row . collect ( & block ) } new_matrix rows , column_count end
Returns a matrix that is the result of iteration of the given block over all
elements of the matrix.
Returns a matrix that is the result of iteration of the given block over all elements of the matrix .
# :yield: e
block
<not_specific>