dkm
dkm copied to clipboard
Avoid asking for a discrete_distribution when all weights are zero
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
this could probably also resolve issue #20, but I do not have access to VS to check that