range method

Matrix<T> range(
  1. int rowStart,
  2. int rowEnd,
  3. int columnStart,
  4. int columnEnd,
)

Returns a mutable view onto the row and column ranges. Throws a RangeError, if any of the ranges are out of bounds.

Implementation

Matrix<T> range(int rowStart, int rowEnd, int columnStart, int columnEnd) {
  rowEnd = RangeError.checkValidRange(
      rowStart, rowEnd, rowCount, 'rowStart', 'rowEnd');
  columnEnd = RangeError.checkValidRange(
      columnStart, columnEnd, colCount, 'columnStart', 'columnEnd');
  return rangeUnchecked(rowStart, rowEnd, columnStart, columnEnd);
}