code: public static void swapCols(DenseDoubleMatrix2D matrix, long col1, long col2) {
  		double temp = 0;
  		long rows = matrix.getRowCount();
  		for (long row = 0; row < rows; row++) {
  			temp = matrix.getDouble(row, col1);
  			matrix.setDouble(matrix.getDouble(row, col2), row, col1);
  			matrix.setDouble(temp, row, col2);
  		}
  	}
docs: Swap components in the two columns.
  
  @param matrix
  the matrix to modify
  @param col1
  the first row
  @param col2
  the second row