swapRows static method

void swapRows(
  1. List<List<double>> m,
  2. int i,
  3. int j
)

Implementation

static void swapRows(List<List<double>> m, int i, int j) {
  if (i == j) return;
  for (int col = 0; col < m[0].length; col++) {
    double temp = m[i][col];
    m[i][col] = m[j][col];
    m[j][col] = temp;
  }
}