File tree 1 file changed +3
-2
lines changed
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -2453,8 +2453,9 @@ template <typename allocator_at = std::allocator<char>> class kmeans_clustering_
2453
2453
// Export stats.
2454
2454
result.iterations = iterations;
2455
2455
result.computed_distances = points_count * wanted_clusters * iterations;
2456
- result.aggregate_distance =
2457
- std::accumulate (point_to_centroid_distance_buffer.begin (), point_to_centroid_distance_buffer.end (), 0.0 );
2456
+ result.aggregate_distance = 0 ;
2457
+ for (distance_t distance : point_to_centroid_distance_buffer)
2458
+ result.aggregate_distance += distance;
2458
2459
2459
2460
// We've finished all the iterations, now we can export the centroids back to the original precision.
2460
2461
std::memcpy (point_to_centroid_index, point_to_centroid_index_buffer.data (), points_count * sizeof (std::size_t ));
You can’t perform that action at this time.
0 commit comments