Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid asking for a discrete_distribution when all weights are zero #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hedtke
Copy link

@hedtke hedtke commented Mar 24, 2021

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

@hedtke
Copy link
Author

hedtke commented Mar 24, 2021

this could probably also resolve issue #20, but I do not have access to VS to check that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant