Struct grafix_toolbox::uses::rand::Rng [−][src]
pub struct Rng { /* fields omitted */ }Expand description
An Xorshift random number generator.
The Xorshift1 algorithm is not suitable for cryptographic purposes
but is very fast. If you do not know for sure that it fits your
requirements, use a more secure one such as StdRng or OsRng.
Marsaglia, George (July 2003). “Xorshift RNGs”. Journal of Statistical Software. Vol. 8 (Issue 14). ↩
Trait Implementations
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
Auto Trait Implementations
impl RefUnwindSafe for XorShiftRngimpl Send for XorShiftRngimpl Sync for XorShiftRngimpl Unpin for XorShiftRngimpl UnwindSafe for XorShiftRngBlanket Implementations
Mutably borrows from an owned value. Read more
Generate a random value in the given range. Read more
Sample a new value, using the given distribution. Read more
Create an iterator that generates values using the given distribution. Read more
Return a bool with a probability p of being true. Read more
Return a bool with a probability of numerator/denominator of being
true. I.e. gen_ratio(2, 3) has chance of 2 in 3, or about 67%, of
returning true. If numerator == denominator, then the returned value
is guaranteed to be true. If numerator == 0, then the returned
value is guaranteed to be false. Read more
type Output = T
type Output = TShould always be Self
The inverse inclusion map: attempts to construct self from the equivalent element of its
superset. Read more
pub fn is_in_subset(&self) -> bool
pub fn is_in_subset(&self) -> boolChecks if self is actually part of its subset T (and can be converted to it).
pub fn to_subset_unchecked(&self) -> SS
pub fn to_subset_unchecked(&self) -> SSUse with care! Same as self.to_subset but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
pub fn from_subset(element: &SS) -> SPThe inclusion map: converts self to the equivalent element of its superset.
pub fn vzip(self) -> V