prefix = _type_conv.get(dtype.char, "d")
if dtype.char == "G":
// complex256 -> complex128 (i.e., C long double -> C double)
dtype = _np.dtype("D")
elif dtype.char not in "fdFD":
dtype = _np.dtype("d")
return prefix, dtype, prefer_fortran
After Change
if arrays:
// 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