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 for leading array with column major order
After Change
// use the most generic type in arrays
chars = [arr.dtype.char for arr in arrays]
scores = [_type_score.get(x, 5) for x in chars]
max_score = max(scores)
ind_max_score = scores.index(max_score)
// safe upcasting for mix of float64 and complex64 --> prefix "z"
if max_score == 3 and (2 in scores):
max_score = 4
if arrays[ind_max_score].flags["FORTRAN"]:
// prefer Fortran for leading array with column major order
prefer_fortran = True
// Get the LAPACK prefix and the corresponding dtype if not fall back
// to "d" and double precision float.
prefix, dtype = _type_conv.get(max_score, ("d", _np.dtype("float64")))
return prefix, dtype, prefer_fortran