indexUnchecked method

Matrix<T> indexUnchecked(
  1. Iterable<int> rowIndexes,
  2. Iterable<int> colIndexes
)

Returns a mutable view onto row and column indexes. The behavior is undefined if any of the indexes are out of bounds.

Implementation

Matrix<T> indexUnchecked(
        Iterable<int> rowIndexes, Iterable<int> colIndexes) =>
    switch (this) {
      IndexMatrix<T>(
        matrix: final matrix,
        rowIndexes: final thisRowIndexes,
        colIndexes: final thisColIndexes
      ) =>
        IndexMatrix<T>(
            matrix,
            rowIndexes.map((index) => thisRowIndexes[index]),
            colIndexes.map((index) => thisColIndexes[index])),
      _ => IndexMatrix<T>(this, rowIndexes, colIndexes),
    };