Project

General

Profile

Bug #1532 ยป c_matrix_trace.diff

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

View differences:

lib/matrix.rb
806 806
  #     => 16
807 807
  #
808 808
  def trace
809
    Matrix.Raise ErrDimensionMismatch unless square?
809 810
    (0...column_size).inject(0) do |tr, i|
810 811
      tr + @rows[i][i]
811 812
    end