b0d0053b1f1738640fc99fba642c83af42d10b22,geomstats/special_orthogonal_group.py,,closest_rotation_matrix,#Any#,8

Before Change



    mat_unitary_u, mat_diag_s, mat_unitary_v = np.linalg.svd(mat)
    rot_mat = np.dot(mat_unitary_u, mat_unitary_v)
    mat_diag_s = np.eye(3) * mat_diag_s

    if np.linalg.det(rot_mat) < 0:
        mat_diag_s[0, 0] = 1

After Change


    rot_mat = np.matmul(mat_unitary_u, mat_unitary_v)

    mask = np.where(np.linalg.det(rot_mat) < 0)
    diag_s[mask] = np.array([1, 1, -1])

    mat_diag_s = np.diagflat(diag_s)

    rot_mat[mask] = np.matmul(np.matmul(mat_unitary_u, mat_diag_s),
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: geomstats/geomstats
Commit Name: b0d0053b1f1738640fc99fba642c83af42d10b22
Time: 2018-02-02
Author: ninamio78@gmail.com
File Name: geomstats/special_orthogonal_group.py
Class Name:
Method Name: closest_rotation_matrix


Project Name: nipy/dipy
Commit Name: 31a62bc643e80e923bb10a4b3ae3370c6181fc98
Time: 2017-05-10
Author: garyfallidis@gmail.com
File Name: dipy/io/tests/test_io_peaks.py
Class Name:
Method Name: test_io_peaks


Project Name: nilearn/nilearn
Commit Name: 51d6b543e193cf385f97ff216400a7f0f54f289a
Time: 2015-02-11
Author: danilobzdok@gmail.com
File Name: nilearn/input_data/tests/test_nifti_masker.py
Class Name:
Method Name: test_mask_4d