-
-
Notifications
You must be signed in to change notification settings - Fork 464
{Independent,}Sample trait for StandardNormal or rename to Ziggurat #97
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
Comments
|
Is there a good rationale for keeping the "standard distributions" like |
I agree @dhardy changed it to a simple (private) function in dhardy@a10251b. |
Now landed as part of #256. |
Thanks for closing all the bugs 😄. Do you think I could get permission to also do so? |
Thanks! I don't actually have permission to do that; @alexcrichton? |
Sure! @dhardy I've made you an admin for the repo and invited @pitdicker as a collaborator |
@alexcrichton Thank you! |
All structs in
rand::distributions
implement theSample
andIndependentSample
trait, which gives us the ability to callfn ind_sample<R: Rng>(&self, &mut R) -> Support
, withSupport
the value of our random number.However,
StandardNormal
, also inrand::distributions
, does not implement the aforementioned traits, butRand
instead, which allows to callfn rand<R: Rng>(rng: &mut R) -> Self
, where self will beStandardNormal(x)
, withx
the value of our random number.I believe this to be an inconsistency. Either
StandardNormal
should be moved out ofrand::distributions
to make it explicit that it behaves in a completely different way, or theSample
andIndependentSample
traits should be implemented for it.Alternatively, I propose
StandardNormal
to be renamed toZIGNOR
(orZiggurat
, I guess).The text was updated successfully, but these errors were encountered: