b9e2bd64a708ea5daabf000a8a73bf840b935fbb,scipy/sparse/linalg/_expm_action.py,,_expm_action_simple,#Any#Any#Any#Any#,71

Before Change


        c1 = np.linalg.norm(B, np.inf)
        for j in range(m_star):
            B = t * np.dot(A, B) / float(s*(j+1))
            c2 = np.linalg.norm(B, np.inf)
            F = F + B
            if c1 + c2 <= tol * np.linalg.norm(F, np.inf):
                break
            c1 = c2

After Change


        raise ValueError("expected A to be like a square matrix")
    if A.shape[1] != B.shape[0]:
        raise ValueError("the matrices A and B have incompatible shapes")
    if B.ndim not in (1, 2):
        raise ValueError("expected B to be like a matrix or a vector")
    n = A.shape[0]
    n0 = B.shape[-1]
    u_d = 2**-53
    tol = u_d
    mu = _trace(A) / float(n)
    A = A - mu * np.identity(n)
    A_1_norm = _exact_1_norm(A)
    if t*A_1_norm == 0:
        m_star, s = 0, 1
    else:
        ell = 2
        norm_info = LazyOperatorNormInfo(t*A, A_1_norm=t*A_1_norm, ell=ell)
        m_star, s = _fragment_3_1(norm_info, n0, tol, ell=ell)
    F = B
    eta = math.exp(t*mu / float(s))
    for i in range(s):
        c1 = _exact_inf_norm(B)
        for j in range(m_star):
            print(type(t))
            print(type(s))
            print(type(j))
            print(type(A), type(B))
            print()
            coeff = t / float(s*(j+1))
            B = coeff * np.dot(A, B)
            c2 = _exact_inf_norm(B)
            F = F + B
            if c1 + c2 <= tol * _exact_inf_norm(F):
                break
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: scipy/scipy
Commit Name: b9e2bd64a708ea5daabf000a8a73bf840b935fbb
Time: 2013-05-06
Author: argriffi@ncsu.edu
File Name: scipy/sparse/linalg/_expm_action.py
Class Name:
Method Name: _expm_action_simple


Project Name: scipy/scipy
Commit Name: 5b3aaf2231fb4da1ad6388c8f79ddd6f07067764
Time: 2015-01-19
Author: pav@iki.fi
File Name: scipy/optimize/_spectral.py
Class Name:
Method Name: _root_df_sane


Project Name: IBM/adversarial-robustness-toolbox
Commit Name: 72e8efe6c1acc40f0b4a672a4330813e1a4066e5
Time: 2020-07-24
Author: beat.buesser@ie.ibm.com
File Name: art/attacks/evasion/auto_attack.py
Class Name: AutoAttack
Method Name: _run_attack