59a5dd3854e6fa23aa4d63256e50620f5ccbafa2,geomstats/backend/numpy_linalg.py,,powerm,#Any#Any#,58

Before Change


def powerm(x, power):
    ndim = x.ndim
    new_x = to_ndarray(x, to_ndim=3)
    if (new_x - np.transpose(new_x, axes=(0, 2, 1)) == 0).all():
        eigvals, eigvecs = np.linalg.eigh(new_x)
        eigvals = eigvals**power
        if (eigvals > 0).all():
            eigvals = np.vectorize(np.diag, signature="(n)->(n,n)")(eigvals)

After Change


def powerm(x, power):
    ndim = x.ndim
    new_x = to_ndarray(x, to_ndim=3)
    if is_symmetric(new_x):
        eigvals, eigvecs = np.linalg.eigh(new_x)
        eigvals = eigvals**power
        if (eigvals > 0).all():
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: geomstats/geomstats
Commit Name: 59a5dd3854e6fa23aa4d63256e50620f5ccbafa2
Time: 2020-01-16
Author: yann.thanwerdas@gmail.com
File Name: geomstats/backend/numpy_linalg.py
Class Name:
Method Name: powerm


Project Name: geomstats/geomstats
Commit Name: 59a5dd3854e6fa23aa4d63256e50620f5ccbafa2
Time: 2020-01-16
Author: yann.thanwerdas@gmail.com
File Name: geomstats/backend/numpy_linalg.py
Class Name:
Method Name: logm


Project Name: geomstats/geomstats
Commit Name: 59a5dd3854e6fa23aa4d63256e50620f5ccbafa2
Time: 2020-01-16
Author: yann.thanwerdas@gmail.com
File Name: geomstats/backend/numpy_linalg.py
Class Name:
Method Name: expm


Project Name: geomstats/geomstats
Commit Name: 59a5dd3854e6fa23aa4d63256e50620f5ccbafa2
Time: 2020-01-16
Author: yann.thanwerdas@gmail.com
File Name: geomstats/backend/numpy_linalg.py
Class Name:
Method Name: powerm