def _get_test_tolerance(type_char, mattype=None):
 rtol = {'f': (3000 * np.finfo(np.float32).eps), 'F': (3000 * np.finfo(np.float32).eps), 'd': (2000 * np.finfo(np.float64).eps), 'D': (2000 * np.finfo(np.float64).eps)}[type_char]
 atol = rtol
 tol = 0
 if ((mattype is aslinearoperator) and (type_char in ('f', 'F'))):
  tol = (30 * np.finfo(np.float32).eps)
  rtol *= 5
 if ((mattype is csr_matrix) and (type_char in ('f', 'F'))):
  rtol *= 5
 return (tol, rtol, atol)

def _get_test_tolerance ( type_char , mattype = None ) : rtol = { 'f' : ( 3000 * np . finfo ( np . float32 ) . eps ) , 'F' : ( 3000 * np . finfo ( np . float32 ) . eps ) , 'd' : ( 2000 * np . finfo ( np . float64 ) . eps ) , 'D' : ( 2000 * np . finfo ( np . float64 ) . eps ) } [ type_char ] atol = rtol tol = 0 if ( ( mattype is aslinearoperator ) and ( type_char in ( 'f' , 'F' ) ) ) : tol = ( 30 * np . finfo ( np . float32 ) . eps ) rtol *= 5 if ( ( mattype is csr_matrix ) and ( type_char in ( 'f' , 'F' ) ) ) : rtol *= 5 return ( tol , rtol , atol )
return tolerance values suitable for a given test: parameters type_char : {f .