c15fd348686163fbbaf9940086199a85f0f54fb2,scipy/linalg/_matfuncs_inv_ssq.py,,fractional_matrix_power,#Any#Any#,676

Before Change


    // Compute singular values.
    s = svd(A, compute_uv=False)
    // Scaling and squaring cannot deal with a singular matrix.
    if not s[-1]:
        return np.zeros_like(A)
    // Compute the condition number relative to matrix inversion.
    k2 = s[0] / s[-1]
    p1 = p - np.floor(p)
    p2 = p - np.ceil(p)
    if p1 * k2 ** (1 - p1) <= -p2 * k2:

After Change


    if p < 0:
        return np.zeros_like(A)
    else:
        p1 = p - np.floor(p)
        a = int(np.floor(p))
        b = p1
        R, info = funm(A, lambda x : pow(x, b), disp=False)
        Q = np.linalg.matrix_power(A, a)
        return Q.dot(R)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: scipy/scipy
Commit Name: c15fd348686163fbbaf9940086199a85f0f54fb2
Time: 2013-06-20
Author: argriffi@ncsu.edu
File Name: scipy/linalg/_matfuncs_inv_ssq.py
Class Name:
Method Name: fractional_matrix_power


Project Name: NifTK/NiftyNet
Commit Name: c8b28432a637a780eed96547260722ff3dede57e
Time: 2017-10-04
Author: wenqi.li@ucl.ac.uk
File Name: niftynet/engine/sampler_selective.py
Class Name:
Method Name: rand_choice_coordinates


Project Name: galeone/dynamic-training-bench
Commit Name: 8e4926a58d0ff919db9cb85ac9530053eda62190
Time: 2016-12-09
Author: nessuno@nerdz.eu
File Name: models/utils.py
Class Name:
Method Name: weight