You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
}
The text was updated successfully, but these errors were encountered:
albertiniufu
changed the title
COUNT_DISTANCES is increased even when only verifying
COUNT_DISTANCES is increased when verifying
Apr 9, 2019
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:
The text was updated successfully, but these errors were encountered: