def find_best_blas_type(arrays=(), dtype=None):
 dtype = _np.dtype(dtype)
 prefer_fortran = False
 if arrays:
  dtypes = [ar.dtype for ar in arrays]
  dtype = _np.find_common_type(dtypes, ())
  try:
   index = dtypes.index(dtype)
  except ValueError:
   index = 0
  if arrays[index].flags['FORTRAN']:
   prefer_fortran = True
 prefix = _type_conv.get(dtype.char, 'd')
 if (dtype.char == 'G'):
  dtype = _np.dtype('D')
 elif (dtype.char not in 'fdFD'):
  dtype = _np.dtype('d')
 return (prefix, dtype, prefer_fortran)

def find_best_blas_type ( arrays = ( ) , dtype = None ) : dtype = _np . dtype ( dtype ) prefer_fortran = False if arrays : dtypes = [ ar . dtype for ar in arrays ] dtype = _np . find_common_type ( dtypes , ( ) ) try : index = dtypes . index ( dtype ) except ValueError : index = 0 if arrays [ index ] . flags [ 'FORTRAN' ] : prefer_fortran = True prefix = _type_conv . get ( dtype . char , 'd' ) if ( dtype . char == 'G' ) : dtype = _np . dtype ( 'D' ) elif ( dtype . char not in 'fdFD' ) : dtype = _np . dtype ( 'd' ) return ( prefix , dtype , prefer_fortran )
find best-matching blas/lapack type .