private int largestPivot(int p){
  double pivot=Math.abs(rows[p][p]);
  int answer=p;
  double x;
  for (int i=p + 1; i < rows.length; i++) {
    x=Math.abs(rows[i][p]);
    if (x > pivot) {
      answer=i;
      pivot=x;
    }
  }
  return answer;
}

private int largestPivot ( int p ) { double pivot = Math . abs ( rows [ p ] [ p ] ) ; int answer = p ; double x ; for ( int i = p + 1 ; i < rows . length ; i ++ ) { x = Math . abs ( rows [ i ] [ p ] ) ; if ( x > pivot ) { answer = i ; pivot = x ; } } return answer ; }
finds the position of the largest pivot at step p .
