ef7707947b85d141e955e844ec1800df9eddb5c2,scipy/linalg/blas.py,,find_best_blas_type,#Any#Any#,236

Before Change


    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

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: scipy/scipy
Commit Name: ef7707947b85d141e955e844ec1800df9eddb5c2
Time: 2018-12-26
Author: ilhanpolat@gmail.com
File Name: scipy/linalg/blas.py
Class Name:
Method Name: find_best_blas_type


Project Name: dask/dask-image
Commit Name: cbbcea8795e8da754a5b3ffb1a08ef66afd84eef
Time: 2018-09-02
Author: jakirkham@gmail.com
File Name: dask_image/ndmeasure/_utils.py
Class Name:
Method Name: _ravel_shape_indices


Project Name: aleju/imgaug
Commit Name: 2a1bd4c93a998d16516d82893401b346d66a95e9
Time: 2019-07-19
Author: kontakt@ajung.name
File Name: imgaug/dtypes.py
Class Name:
Method Name: increase_array_resolutions_