reverseRows method

void reverseRows (List<List<double>> matrix)

Reverses the order of all rows of matrix. The result has the last row as the first one, the 2nd last one as the 2nd, etc.

Implementation

static void reverseRows(List<List<double>> matrix) {
  for (int i = 0; i < matrix.length ~/ 2; i++) {
    swapRows(matrix, i, matrix.length - 1 - i);
  }
}