collect()
public
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
# File lib/matrix.rb, line 329
def collect # :yield: e
rows = @rows.collect{|row| row.collect{|e| yield e}}
Matrix.rows(rows, false)
end