-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
COUNT_DISTANCES is increased whenever pointCenterDist2() is called.
I had expected COUNT_DISTANCES would represent count only during normal kmeans execution.
However, COUNT_DISTANCES is incremented inside verifyAssignment().
I suggest to fast-kmeans to not count distances when VERIFY_ASSIGNMENTS is defined.
Something like the following seems to work:
void Kmeans::verifyAssignment(int iteration, int startNdx, int endNdx) const {
#ifdef VERIFY_ASSIGNMENTS
#ifdef COUNT_DISTANCES
long long tmp = numDistances;
#endif
// ...
// code continues...
//...
#ifdef COUNT_DISTANCES
numDistances = tmp;
#endif
#endif
}
Metadata
Metadata
Assignees
Labels
No labels