def _eigvalsh_to_eps(spectrum, cond=None, rcond=None):
 if (rcond is not None):
  cond = rcond
 if (cond in [None, (-1)]):
  t = spectrum.dtype.char.lower()
  factor = {'f': 1000.0, 'd': 1000000.0}
  cond = (factor[t] * np.finfo(t).eps)
 eps = (cond * np.max(abs(spectrum)))
 return eps

def _eigvalsh_to_eps ( spectrum , cond = None , rcond = None ) : if ( rcond is not None ) : cond = rcond if ( cond in [ None , ( - 1 ) ] ) : t = spectrum . dtype . char . lower ( ) factor = { 'f' : 1000.0 , 'd' : 1000000.0 } cond = ( factor [ t ] * np . finfo ( t ) . eps ) eps = ( cond * np . max ( abs ( spectrum ) ) ) return eps
determine which eigenvalues are "small" given the spectrum .