jefferislab / RANN

R package providing fast nearest neighbour search (wraps ANN library)
http://jefferislab.github.io/RANN/
58 stars 13 forks source link

Objects with zero distance #8

Closed CodyRude closed 9 years ago

CodyRude commented 9 years ago

I am using the version in CRAN, 2.4.1. I have a dataset that can contain objects with distances of zero. When I run a nearest neighbor search for all objects within a specified radius, the indexes can become switched. For example:

nn.idx[70,] = 71 70 instead of the expected 70 71.

I'm not sure if objects with zero distance are not allowed, or if its a bug. I can supply example data if necessary.

CodyRude commented 9 years ago

Oh, I just realized it was using the original list to query the data set, and it could grab either point first because they on top of each other. My mistake, sorry.