Struct zipf::ZipfDistribution [−][src]
pub struct ZipfDistribution { /* fields omitted */ }
Random number generator that generates Zipf-distributed random numbers using rejection inversion.
Methods
impl ZipfDistribution
[src]
impl ZipfDistribution
pub fn new(num_elements: usize, exponent: f64) -> Result<Self, ()>
[src]
pub fn new(num_elements: usize, exponent: f64) -> Result<Self, ()>
Creates a new Zipf-distributed random number generator.
Note that both the number of elements and the exponent must be greater than 0.
Trait Implementations
impl Clone for ZipfDistribution
[src]
impl Clone for ZipfDistribution
fn clone(&self) -> ZipfDistribution
[src]
fn clone(&self) -> ZipfDistribution
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Copy for ZipfDistribution
[src]
impl Copy for ZipfDistribution
impl Sample<usize> for ZipfDistribution
[src]
impl Sample<usize> for ZipfDistribution
fn sample<R: Rng>(&mut self, rng: &mut R) -> usize
[src]
fn sample<R: Rng>(&mut self, rng: &mut R) -> usize
Deprecated since 0.5.0
: use Distribution instead
Generate a random value of Support
, using rng
as the source of randomness. Read more
impl IndependentSample<usize> for ZipfDistribution
[src]
impl IndependentSample<usize> for ZipfDistribution
fn ind_sample<R: Rng>(&self, rng: &mut R) -> usize
[src]
fn ind_sample<R: Rng>(&self, rng: &mut R) -> usize
Deprecated since 0.5.0
: use Distribution instead
Generate a random value.
impl Distribution<usize> for ZipfDistribution
[src]
impl Distribution<usize> for ZipfDistribution
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> usize
[src]
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> usize
Generate a random value of T
, using rng
as the source of randomness.
fn sample_iter<R>(&'a self, rng: &'a mut R) -> DistIter<'a, Self, R, T> where
R: Rng,
[src]
fn sample_iter<R>(&'a self, rng: &'a mut R) -> DistIter<'a, Self, R, T> where
R: Rng,
Create an iterator that generates random values of T
, using rng
as the source of randomness. Read more
impl Debug for ZipfDistribution
[src]
impl Debug for ZipfDistribution
Auto Trait Implementations
impl Send for ZipfDistribution
impl Send for ZipfDistribution
impl Sync for ZipfDistribution
impl Sync for ZipfDistribution