I have the case that I sometimes ask for k-means when all input points are identical.
Then all distances are zero and thus std::discrete_distribution is called with weight vector containing only zeros.
On my platform, that results in a floating-point exception.
I have the case that I sometimes ask for k-means when all input points are identical. Then all distances are zero and thus
std::discrete_distribution
is called with weight vector containing only zeros. On my platform, that results in a floating-point exception.This could probably also fix