rust-random / rand

A Rust library for random number generation.
https://crates.io/crates/rand
Other
1.67k stars 432 forks source link

Poisson: split Knuth/Rejection methods #1493

Closed dhardy closed 1 month ago

dhardy commented 2 months ago

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.

MichaelOwenDyer commented 2 months ago

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

MichaelOwenDyer commented 2 months ago

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!