double[][] data = new double[][] { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 } };
double[][] result =
new double[][] { { 7, 8, 9 }, { 4, 5, 6 }, { 1, 2, 3 } };
Matrix m = new Matrix(data);
m.swapRows(0, 2);
for (int c = 0; c < m.getColumns(); c++) {
for (int r = 0; r < m.getRows(); r++) {
assertEquals(result[r][c], m.getElement(r, c));
}