Skip to content

Commit ec99801

Browse files
committed
rand_distr: Inline Poisson sampling
1 parent 84d89a7 commit ec99801

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

rand_distr/src/poisson.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ where Standard: Distribution<N>
6767
impl<N: Float> Distribution<N> for Poisson<N>
6868
where Standard: Distribution<N>
6969
{
70+
#[inline]
7071
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> N {
7172
// using the algorithm from Numerical Recipes in C
7273

@@ -124,6 +125,7 @@ where Standard: Distribution<N>
124125
impl<N: Float> Distribution<u64> for Poisson<N>
125126
where Standard: Distribution<N>
126127
{
128+
#[inline]
127129
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> u64 {
128130
let result: N = self.sample(rng);
129131
result.to_u64().unwrap()

0 commit comments

Comments
 (0)