Project

General

Profile

Bug #1532 » c_matrix_trace.diff

marcandre (Marc-Andre Lafortune), 09/17/2009 02:03 PM

View differences:

lib/matrix.rb
# => 16
#
def trace
Matrix.Raise ErrDimensionMismatch unless square?
(0...column_size).inject(0) do |tr, i|
tr + @rows[i][i]
end
(5-5/7)