-
Notifications
You must be signed in to change notification settings - Fork 480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can you explain ADDpoint function?? #151
Comments
I try to learn: I need to add a lots of points but control the least distance dist between every 2 points. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
inline bool addPoint(DistanceType dist, IndexType index) {
CountType i;
for (i = count; i > 0; --i) {
#ifdef NANOFLANN_FIRST_MATCH // If defined and two points have the same
// distance, the one with the lowest-index will be
// returned first.
if ((dists[i - 1] > dist) ||
((dist == dists[i - 1]) && (indices[i - 1] > index))) {
#else
if (dists[i - 1] > dist) {
#endif
if (i < capacity) {
dists[i] = dists[i - 1];
indices[i] = indices[i - 1];
}
} else
break;
}
if (i < capacity) {
dists[i] = dist;
indices[i] = index;
}
if (count < capacity)
count++;
}
if i turn it to false, time cost reduced , but result poor, but if it to true, result quality going up but time cost increased.
can you explain why??
The text was updated successfully, but these errors were encountered: