trace property

int trace

Returns the trace of this Matrix.

Implementation

int get trace {
  var result = 0;
  final count = math.min(rowCount, colCount);
  for (var i = 0; i < count; i++) {
    result += getUnchecked(i, i);
  }
  return result;
}