d6fe384f6763c09da358e70375db034ec0e442f8,pynndescent/utils.py,,build_candidates,#Any#Any#Any#Any#Any#,499
Before Change
idx = current_graph[0][i, j]
isn = current_graph[2][i, j]
d = tau_rand(rng_state)
heap_push(candidate_neighbors, i, d, idx, isn)
heap_push(candidate_neighbors, idx, d, i, isn)
current_graph[2][i, j] = 0
return candidate_neighbors
After Change
candidate_neighbors: A heap with an array of (randomly sorted) candidate
neighbors for each vertex in the graph.
candidate_neighbors = make_heap(n_vertices, max_candidates)
for i in range(n_vertices):
for j in range(n_neighbors):
if current_graph[0][i, j] < 0:
continue
idx = current_graph[0][i, j]
isn = current_graph[2][i, j]
d = tau_rand(rng_state)
// heap_push(candidate_neighbors, i, d, idx, isn)
// heap_push(candidate_neighbors, idx, d, i, isn)
checked_flagged_heap_push(
candidate_neighbors[1][i],
candidate_neighbors[0][i],
candidate_neighbors[2][i],
d,
idx,
isn,
)
checked_flagged_heap_push(
candidate_neighbors[1][idx],
candidate_neighbors[0][idx],
candidate_neighbors[2][idx],
d,
i,
isn,
)
current_graph[2][i, j] = 0
return candidate_neighbors
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 15
Instances
Project Name: lmcinnes/pynndescent
Commit Name: d6fe384f6763c09da358e70375db034ec0e442f8
Time: 2020-08-27
Author: leland.mcinnes@gmail.com
File Name: pynndescent/utils.py
Class Name:
Method Name: build_candidates
Project Name: lmcinnes/pynndescent
Commit Name: d6fe384f6763c09da358e70375db034ec0e442f8
Time: 2020-08-27
Author: leland.mcinnes@gmail.com
File Name: pynndescent/utils.py
Class Name:
Method Name: apply_graph_updates_low_memory
Project Name: lmcinnes/pynndescent
Commit Name: d6fe384f6763c09da358e70375db034ec0e442f8
Time: 2020-08-27
Author: leland.mcinnes@gmail.com
File Name: pynndescent/utils.py
Class Name:
Method Name: build_candidates
Project Name: lmcinnes/pynndescent
Commit Name: d6fe384f6763c09da358e70375db034ec0e442f8
Time: 2020-08-27
Author: leland.mcinnes@gmail.com
File Name: pynndescent/sparse_nndescent.py
Class Name:
Method Name: init_rp_tree
Project Name: lmcinnes/pynndescent
Commit Name: d6fe384f6763c09da358e70375db034ec0e442f8
Time: 2020-08-27
Author: leland.mcinnes@gmail.com
File Name: pynndescent/utils.py
Class Name:
Method Name: new_build_candidates