code: public static void swapPivot(Matrix source, long diag, Matrix s, Matrix t) {
  		// get swap row and col
  		long swapRow = diag;
  		long swapCol = diag;
  		double maxValue = Math.abs(source.getAsDouble(diag, diag));
  		long rows = source.getRowCount();
  		long cols = source.getColumnCount();
  		double abs = 0;
  
  		for (long row = diag; row < rows; row++) {
  			for (long col = diag; col < cols; col++) {
  				abs = Math.abs(source.getAsDouble(row, col));
  				if (abs > maxValue) {
  					maxValue = abs;
  					swapRow = row;
  					swapCol = col;
  				}
  			}
  		}
  
  		// swap rows and columns
  		if (swapRow != diag) {
  			swapRows(source, swapRow, diag);
  			swapRows(t, swapRow, diag);
  		}
  		if (swapCol != diag) {
  			swapCols(source, swapCol, diag);
  			swapCols(s, swapCol, diag);
  		}
  	}
docs: Swap the matrices so that the largest value is on the pivot
  
  @param source
  the matrix to modify
  @param diag
  the position on the diagonal
  @param s
  the matrix s
  @param t
  the matrix t