Skip to content

COUNT_DISTANCES is increased when verifying #24

@albertiniufu

Description

@albertiniufu

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions