fc8c9693b2505b48b1e3dc7c2e477e757d42e549,scipy/sparse/linalg/_onenormest.py,,_algorithm_2_2,#Any#Any#Any#,170

Before Change


        g = sorted(g, reverse=True)
        S = sign_round_up(Y)
        Z = np.asarray(AT_linear_operator.matmat(S))
        h = np.max(np.abs(Z), axis=1)

        // If this algorithm runs for fewer than two iterations,
        // then its return values do not have the properties indicated
        // in the description of the algorithm.
        // In particular, the entries of g are not 1-norms of any
        // column of A until the second iteration.
        // Therefore we will require the algorithm to run for at least
        // two iterations, even though this requirement is not stated
        // in the description of the algorithm.
        if k >= 2:
            if less_than_or_close(max(h), np.dot(Z[:, best_j], X[:, best_j])):
                break
        h_i_pairs = zip(h, range(n))
        h, ind = zip(*sorted(h_i_pairs, reverse=True)[:t])
        for j in range(t):
            X[:, j] = elementary_vector(n, ind[j])

        // Check invariant (2.2).

After Change


        if k >= 2:
            if less_than_or_close(max(h), np.dot(Z[:, best_j], X[:, best_j])):
                break
        ind = np.argsort(h)[::-1][:t]
        h = h[ind]
        for j in range(t):
            X[:, j] = elementary_vector(n, ind[j])

        // Check invariant (2.2).
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 5

Instances


Project Name: scipy/scipy
Commit Name: fc8c9693b2505b48b1e3dc7c2e477e757d42e549
Time: 2015-04-11
Author: pav@iki.fi
File Name: scipy/sparse/linalg/_onenormest.py
Class Name:
Method Name: _algorithm_2_2


Project Name: brian-team/brian2
Commit Name: 0ac2bf1c2cafee4cc9555c9f09a17143b05b1a88
Time: 2014-03-06
Author: dan.goodman@ens.fr
File Name: brian2/synapses/spikequeue.py
Class Name: SpikeQueue
Method Name: prepare


Project Name: Pinafore/qb
Commit Name: e604607e0a26bd5ca244b60dba8769779f2f07a4
Time: 2018-04-19
Author: sjtufs@gmail.com
File Name: qanta/guesser/dan.py
Class Name: DanGuesser
Method Name: _guess_batch


Project Name: scikit-learn/scikit-learn
Commit Name: 104b736d4446d1d3a996bceb8340776dff1882a5
Time: 2020-03-24
Author: lichenni1990@gmail.com
File Name: examples/ensemble/plot_gradient_boosting_regression.py
Class Name:
Method Name: