Skip to content
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

Prefer lower ids on ties #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/R_optics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,10 @@ List optics_int(NumericMatrix data, double eps, int minPts,
for (std::vector<int>::iterator it = seeds.begin();
it!=seeds.end(); ++it) {
// Note: The second part of the if statement ensures that ties are
// always broken consistenty (higher ID wins to produce the same
// always broken consistenty (lower ID wins to produce the same
// results as the elki implementation)!
if (reachdist[*it] < reachdist[*q_it] ||
(reachdist[*it] == reachdist[*q_it] && *q_it < *it)) q_it = it;
(reachdist[*it] == reachdist[*q_it] && *it < *q_it)) q_it = it;
}
q = *q_it;
seeds.erase(q_it);
Expand Down