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

fix outdated choose_multiple_weighted docs #1237

Merged
merged 1 commit into from
Nov 9, 2022

Conversation

TheIronBorn
Copy link
Contributor

Seems we missed this when switching to select_nth and when fixing the complexity documentation

Copy link
Member

@dhardy dhardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

The odd thing is that sample_efraimidis_spirakis has a special case for length > (core::u32::MAX as usize), but IIUC that case would use at least 64 GiB of memory and be quite slow.

In any case, the implementation cannot be faster than O(length) time since the sum of weights is provided (unless the user was able to provide that directly).

@dhardy dhardy merged commit 387dd64 into rust-random:master Nov 9, 2022
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.

2 participants