public int rank(){
  double eps=Math.pow(2.0,-52.0);
  double tol=Math.max(m,n) * s[0] * eps;
  int r=0;
  for (int i=0; i < s.length; i++) {
    if (s[i] > tol) {
      r++;
    }
  }
  return r;
}

public int rank ( ) { double eps = Math . pow ( 2.0 , - 52.0 ) ; double tol = Math . max ( m , n ) * s [ 0 ] * eps ; int r = 0 ; for ( int i = 0 ; i < s . length ; i ++ ) { if ( s [ i ] > tol ) { r ++ ; } } return r ; }
returns the effective numerical matrix rank , which is the number of nonnegligible singular values .
