code: public int rank(double t) {
      int rank = n;
      for(int j = 0; j < n; j++) {
        if(Math.abs(Rdiag[j]) <= t) {
          --rank;
        }
      }
      return rank;
    }
docs: Get the matrix rank?
  
  @param t Tolerance threshold
  @return Rank of R