-
-
Notifications
You must be signed in to change notification settings - Fork 473
Description
All structs in rand::distributions
implement the Sample
and IndependentSample
trait, which gives us the ability to call fn ind_sample<R: Rng>(&self, &mut R) -> Support
, with Support
the value of our random number.
However, StandardNormal
, also in rand::distributions
, does not implement the aforementioned traits, but Rand
instead, which allows to call fn rand<R: Rng>(rng: &mut R) -> Self
, where self will be StandardNormal(x)
, with x
the value of our random number.
I believe this to be an inconsistency. Either StandardNormal
should be moved out of rand::distributions
to make it explicit that it behaves in a completely different way, or the Sample
and IndependentSample
traits should be implemented for it.
Alternatively, I propose StandardNormal
to be renamed to ZIGNOR
(or Ziggurat
, I guess).