Skip to content

Commit

Permalink
add a warning in prune_neighbor if zero distance neighbor is detected (
Browse files Browse the repository at this point in the history
  • Loading branch information
harsha-simhadri committed Apr 17, 2023
1 parent 8ec06fa commit a41b078
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1292,6 +1292,10 @@ void Index<T, TagT, LabelT>::prune_neighbors(const uint32_t location, std::vecto
std::sort(pool.begin(), pool.end());
pruned_list.clear();
pruned_list.reserve(range);
if (pool.begin()->distance == 0)
{
diskann::cerr << "Warning: a candidate with distance 0 found in prune_neighbors" << std::endl;
}
occlude_list(location, pool, alpha, range, max_candidate_size, pruned_list, scratch);
assert(pruned_list.size() <= range);

Expand Down

0 comments on commit a41b078

Please sign in to comment.