5dffe74db13c8c279ec1cf43393855e6b67f81c9,pynndescent/utils.py,,smallest_flagged,#Any#Any#,270

Before Change



@numba.njit("i8(f8[:, :, :],i8)")
def smallest_flagged(heap, row):
    order = np.argsort(heap[1, row])
    for i in order:
        if heap[2, row, i]:
            heap[2, row, i] = 0
            return heap[0, row, i]
    return -1.0

@numba.njit(parallel=True)
def build_candidates(current_graph, n_vertices, n_neighbors, max_candidates,

After Change


    flag = heap[2, row]

    min_dist = np.inf
    result_index = -1

    for i in range(ind.shape[0]):
        if flag[i] and dist[i] < min_dist:
            min_dist = dist[i]
            result_index = i

    if result_index >= 0:
        flag[result_index] = 0
        return int(ind[result_index])
    else:
        return -1
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

Instances


Project Name: lmcinnes/pynndescent
Commit Name: 5dffe74db13c8c279ec1cf43393855e6b67f81c9
Time: 2018-02-07
Author: leland.mcinnes@gmail.com
File Name: pynndescent/utils.py
Class Name:
Method Name: smallest_flagged


Project Name: daavoo/pyntcloud
Commit Name: 84ea1329f53f5b8e2b216d68ec3eb399e87bef9a
Time: 2017-08-01
Author: daviddelaiglesiacastro@gmail.com
File Name: pyntcloud/scalar_fields/sf_kneighbors.py
Class Name: Normals
Method Name: compute


Project Name: daavoo/pyntcloud
Commit Name: 37e60440977698fa4a5edb34e47a2bdbb8d7a167
Time: 2017-08-01
Author: daviddelaiglesiacastro@gmail.com
File Name: pyntcloud/scalar_fields/sf_kneighbors.py
Class Name: Normals
Method Name: compute