KristofferC / NearestNeighbors.jl

High performance nearest neighbor data structures (KDTree and BallTree) and algorithms for Julia.
Other
412 stars 65 forks source link

Add example with `skip` option to documentation #163

Open juliohm opened 11 months ago

juliohm commented 11 months ago

Can you please confirm that the skip function in knn is a function that takes an index i and returns true if that index should be skipped in the list of best indices?

Say I have a set of visited points that I want to update iteratively:

visited = Set([1])

skip(i) = i ∈ visited

for i in 1:n
  inds, dists = knn(..., skip)
  push!(visited, i)
end

Is that the correct usage of the option?

ghyatzo commented 2 weeks ago

looking for an answer myself I found this reference: https://github.com/KristofferC/NearestNeighbors.jl/issues/49#issuecomment-307614297 But it's a bit old.