Skip to content

Conversation

@dhardy
Copy link
Member

@dhardy dhardy commented Sep 13, 2024

Summary

Use an enum over Poisson implementations

Motivation

#1484 uses the Poisson method internally, but only for small expected values.
@benjamin-lieser please merge this PR into yours and use poisson::KnuthMethod instead of Poisson.

Copy link
Member

@MichaelOwenDyer MichaelOwenDyer left a comment

Choose a reason for hiding this comment

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

I like the thought behind the change, it doesn't make sense to decide which method to use every single time a Poisson distribution is sampled. Using an enum is cleaner. I have some thoughts on the details.
I can't comment too well on the benchmarking code, as I am unfamiliar with criterion and don't understand the reasons for many of the changes. I'm gonna go learn about Criterion now 🤠

@MichaelOwenDyer
Copy link
Member

MichaelOwenDyer commented Sep 18, 2024

changes.patch
Here's a patch file of my suggestions.
Edit: Also added a constructor for RejectionMethod

@MichaelOwenDyer
Copy link
Member

Great, looks good to me now haha 😄 Unless you want to also add the getter for lamdba I'd say this is ready to go!

@dhardy dhardy merged commit f263820 into rust-random:master Sep 23, 2024
15 checks passed
benjamin-lieser pushed a commit to benjamin-lieser/rand that referenced this pull request Sep 25, 2024
@dhardy dhardy deleted the poisson-enum branch October 16, 2024 15:12
benjamin-lieser pushed a commit to benjamin-lieser/rand that referenced this pull request Feb 5, 2025
benjamin-lieser pushed a commit to benjamin-lieser/rand that referenced this pull request Feb 5, 2025
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.

3 participants