Skip to content

Commit

Permalink
closest_i should be long, not double
Browse files Browse the repository at this point in the history
  • Loading branch information
rmjarvis committed Dec 27, 2024
1 parent a2b461d commit 0e8bfee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/KMeans.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ void FindCellsInPatches(const std::vector<Position<C> >& centers,
xdbg<<"cell = "<<cell_center<<" "<<s<<" "<<cell->getN()<<std::endl;

// Start with a guess that the closest one is in the first position.
double closest_i = patches[0];
long closest_i = patches[0];
double min_dsq = (cell_center - centers[closest_i]).normSq();
saved_dsq[0] = min_dsq;
if (inertia) {
Expand Down

0 comments on commit 0e8bfee

Please sign in to comment.