Trait ndarray_rand::rand::distributions::uniform::UniformSampler [−][src]
Helper trait handling actual uniform sampling.
See the module documentation on how to implement Uniform
range
sampling for a custom type.
Implementation of sample_single
is optional, and is only useful when
the implementation can be faster than Self::new(low, high).sample(rng)
.
Associated Types
Loading content...Required methods
pub fn new<B1, B2>(low: B1, high: B2) -> Self where
B1: SampleBorrow<Self::X>,
B2: SampleBorrow<Self::X>,
[src]
B1: SampleBorrow<Self::X>,
B2: SampleBorrow<Self::X>,
Construct self, with inclusive lower bound and exclusive upper bound
[low, high)
.
Usually users should not call this directly but instead use
Uniform::new
, which asserts that low < high
before calling this.
pub fn new_inclusive<B1, B2>(low: B1, high: B2) -> Self where
B1: SampleBorrow<Self::X>,
B2: SampleBorrow<Self::X>,
[src]
B1: SampleBorrow<Self::X>,
B2: SampleBorrow<Self::X>,
Construct self, with inclusive bounds [low, high]
.
Usually users should not call this directly but instead use
Uniform::new_inclusive
, which asserts that low <= high
before
calling this.
pub fn sample<R>(&self, rng: &mut R) -> Self::X where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
Sample a value.
Provided methods
pub fn sample_single<R, B1, B2>(low: B1, high: B2, rng: &mut R) -> Self::X where
R: Rng + ?Sized,
B1: SampleBorrow<Self::X>,
B2: SampleBorrow<Self::X>,
[src]
R: Rng + ?Sized,
B1: SampleBorrow<Self::X>,
B2: SampleBorrow<Self::X>,
Sample a single value uniformly from a range with inclusive lower bound
and exclusive upper bound [low, high)
.
By default this is implemented using
UniformSampler::new(low, high).sample(rng)
. However, for some types
more optimal implementations for single usage may be provided via this
method (which is the case for integers and floats).
Results may not be identical.
Note that to use this method in a generic context, the type needs to be
retrieved via SampleUniform::Sampler
as follows:
use rand::{thread_rng, distributions::uniform::{SampleUniform, UniformSampler}}; fn sample_from_range<T: SampleUniform>(lb: T, ub: T) -> T { let mut rng = thread_rng(); <T as SampleUniform>::Sampler::sample_single(lb, ub, &mut rng) }
pub fn sample_single_inclusive<R, B1, B2>(
low: B1,
high: B2,
rng: &mut R
) -> Self::X where
R: Rng + ?Sized,
B1: SampleBorrow<Self::X>,
B2: SampleBorrow<Self::X>,
[src]
low: B1,
high: B2,
rng: &mut R
) -> Self::X where
R: Rng + ?Sized,
B1: SampleBorrow<Self::X>,
B2: SampleBorrow<Self::X>,
Sample a single value uniformly from a range with inclusive lower bound
and inclusive upper bound [low, high]
.
By default this is implemented using
UniformSampler::new_inclusive(low, high).sample(rng)
. However, for
some types more optimal implementations for single usage may be provided
via this method.
Results may not be identical.
Implementors
impl UniformSampler for UniformChar
[src]
type X = char
pub fn new<B1, B2>(low_b: B1, high_b: B2) -> UniformChar where
B1: SampleBorrow<<UniformChar as UniformSampler>::X>,
B2: SampleBorrow<<UniformChar as UniformSampler>::X>,
[src]
B1: SampleBorrow<<UniformChar as UniformSampler>::X>,
B2: SampleBorrow<<UniformChar as UniformSampler>::X>,
pub fn new_inclusive<B1, B2>(low_b: B1, high_b: B2) -> UniformChar where
B1: SampleBorrow<<UniformChar as UniformSampler>::X>,
B2: SampleBorrow<<UniformChar as UniformSampler>::X>,
[src]
B1: SampleBorrow<<UniformChar as UniformSampler>::X>,
B2: SampleBorrow<<UniformChar as UniformSampler>::X>,
pub fn sample<R>(&self, rng: &mut R) -> <UniformChar as UniformSampler>::X where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
impl UniformSampler for UniformDuration
[src]
type X = Duration
pub fn new<B1, B2>(low_b: B1, high_b: B2) -> UniformDuration where
B1: SampleBorrow<<UniformDuration as UniformSampler>::X>,
B2: SampleBorrow<<UniformDuration as UniformSampler>::X>,
[src]
B1: SampleBorrow<<UniformDuration as UniformSampler>::X>,
B2: SampleBorrow<<UniformDuration as UniformSampler>::X>,
pub fn new_inclusive<B1, B2>(low_b: B1, high_b: B2) -> UniformDuration where
B1: SampleBorrow<<UniformDuration as UniformSampler>::X>,
B2: SampleBorrow<<UniformDuration as UniformSampler>::X>,
[src]
B1: SampleBorrow<<UniformDuration as UniformSampler>::X>,
B2: SampleBorrow<<UniformDuration as UniformSampler>::X>,
pub fn sample<R>(&self, rng: &mut R) -> Duration where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
impl UniformSampler for UniformFloat<f32>
[src]
type X = f32
pub fn new<B1, B2>(low_b: B1, high_b: B2) -> UniformFloat<f32> where
B1: SampleBorrow<<UniformFloat<f32> as UniformSampler>::X>,
B2: SampleBorrow<<UniformFloat<f32> as UniformSampler>::X>,
[src]
B1: SampleBorrow<<UniformFloat<f32> as UniformSampler>::X>,
B2: SampleBorrow<<UniformFloat<f32> as UniformSampler>::X>,
pub fn new_inclusive<B1, B2>(low_b: B1, high_b: B2) -> UniformFloat<f32> where
B1: SampleBorrow<<UniformFloat<f32> as UniformSampler>::X>,
B2: SampleBorrow<<UniformFloat<f32> as UniformSampler>::X>,
[src]
B1: SampleBorrow<<UniformFloat<f32> as UniformSampler>::X>,
B2: SampleBorrow<<UniformFloat<f32> as UniformSampler>::X>,
pub fn sample<R>(&self, rng: &mut R) -> <UniformFloat<f32> as UniformSampler>::X where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_single<R, B1, B2>(
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformFloat<f32> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformFloat<f32> as UniformSampler>::X>,
B2: SampleBorrow<<UniformFloat<f32> as UniformSampler>::X>,
[src]
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformFloat<f32> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformFloat<f32> as UniformSampler>::X>,
B2: SampleBorrow<<UniformFloat<f32> as UniformSampler>::X>,
impl UniformSampler for UniformFloat<f64>
[src]
type X = f64
pub fn new<B1, B2>(low_b: B1, high_b: B2) -> UniformFloat<f64> where
B1: SampleBorrow<<UniformFloat<f64> as UniformSampler>::X>,
B2: SampleBorrow<<UniformFloat<f64> as UniformSampler>::X>,
[src]
B1: SampleBorrow<<UniformFloat<f64> as UniformSampler>::X>,
B2: SampleBorrow<<UniformFloat<f64> as UniformSampler>::X>,
pub fn new_inclusive<B1, B2>(low_b: B1, high_b: B2) -> UniformFloat<f64> where
B1: SampleBorrow<<UniformFloat<f64> as UniformSampler>::X>,
B2: SampleBorrow<<UniformFloat<f64> as UniformSampler>::X>,
[src]
B1: SampleBorrow<<UniformFloat<f64> as UniformSampler>::X>,
B2: SampleBorrow<<UniformFloat<f64> as UniformSampler>::X>,
pub fn sample<R>(&self, rng: &mut R) -> <UniformFloat<f64> as UniformSampler>::X where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_single<R, B1, B2>(
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformFloat<f64> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformFloat<f64> as UniformSampler>::X>,
B2: SampleBorrow<<UniformFloat<f64> as UniformSampler>::X>,
[src]
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformFloat<f64> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformFloat<f64> as UniformSampler>::X>,
B2: SampleBorrow<<UniformFloat<f64> as UniformSampler>::X>,
impl UniformSampler for UniformInt<i8>
[src]
type X = i8
pub fn new<B1, B2>(low_b: B1, high_b: B2) -> UniformInt<i8> where
B1: SampleBorrow<<UniformInt<i8> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<i8> as UniformSampler>::X>,
[src]
B1: SampleBorrow<<UniformInt<i8> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<i8> as UniformSampler>::X>,
pub fn new_inclusive<B1, B2>(low_b: B1, high_b: B2) -> UniformInt<i8> where
B1: SampleBorrow<<UniformInt<i8> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<i8> as UniformSampler>::X>,
[src]
B1: SampleBorrow<<UniformInt<i8> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<i8> as UniformSampler>::X>,
pub fn sample<R>(&self, rng: &mut R) -> <UniformInt<i8> as UniformSampler>::X where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_single<R, B1, B2>(
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformInt<i8> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformInt<i8> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<i8> as UniformSampler>::X>,
[src]
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformInt<i8> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformInt<i8> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<i8> as UniformSampler>::X>,
pub fn sample_single_inclusive<R, B1, B2>(
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformInt<i8> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformInt<i8> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<i8> as UniformSampler>::X>,
[src]
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformInt<i8> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformInt<i8> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<i8> as UniformSampler>::X>,
impl UniformSampler for UniformInt<i16>
[src]
type X = i16
pub fn new<B1, B2>(low_b: B1, high_b: B2) -> UniformInt<i16> where
B1: SampleBorrow<<UniformInt<i16> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<i16> as UniformSampler>::X>,
[src]
B1: SampleBorrow<<UniformInt<i16> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<i16> as UniformSampler>::X>,
pub fn new_inclusive<B1, B2>(low_b: B1, high_b: B2) -> UniformInt<i16> where
B1: SampleBorrow<<UniformInt<i16> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<i16> as UniformSampler>::X>,
[src]
B1: SampleBorrow<<UniformInt<i16> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<i16> as UniformSampler>::X>,
pub fn sample<R>(&self, rng: &mut R) -> <UniformInt<i16> as UniformSampler>::X where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_single<R, B1, B2>(
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformInt<i16> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformInt<i16> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<i16> as UniformSampler>::X>,
[src]
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformInt<i16> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformInt<i16> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<i16> as UniformSampler>::X>,
pub fn sample_single_inclusive<R, B1, B2>(
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformInt<i16> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformInt<i16> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<i16> as UniformSampler>::X>,
[src]
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformInt<i16> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformInt<i16> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<i16> as UniformSampler>::X>,
impl UniformSampler for UniformInt<i32>
[src]
type X = i32
pub fn new<B1, B2>(low_b: B1, high_b: B2) -> UniformInt<i32> where
B1: SampleBorrow<<UniformInt<i32> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<i32> as UniformSampler>::X>,
[src]
B1: SampleBorrow<<UniformInt<i32> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<i32> as UniformSampler>::X>,
pub fn new_inclusive<B1, B2>(low_b: B1, high_b: B2) -> UniformInt<i32> where
B1: SampleBorrow<<UniformInt<i32> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<i32> as UniformSampler>::X>,
[src]
B1: SampleBorrow<<UniformInt<i32> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<i32> as UniformSampler>::X>,
pub fn sample<R>(&self, rng: &mut R) -> <UniformInt<i32> as UniformSampler>::X where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_single<R, B1, B2>(
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformInt<i32> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformInt<i32> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<i32> as UniformSampler>::X>,
[src]
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformInt<i32> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformInt<i32> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<i32> as UniformSampler>::X>,
pub fn sample_single_inclusive<R, B1, B2>(
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformInt<i32> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformInt<i32> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<i32> as UniformSampler>::X>,
[src]
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformInt<i32> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformInt<i32> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<i32> as UniformSampler>::X>,
impl UniformSampler for UniformInt<i64>
[src]
type X = i64
pub fn new<B1, B2>(low_b: B1, high_b: B2) -> UniformInt<i64> where
B1: SampleBorrow<<UniformInt<i64> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<i64> as UniformSampler>::X>,
[src]
B1: SampleBorrow<<UniformInt<i64> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<i64> as UniformSampler>::X>,
pub fn new_inclusive<B1, B2>(low_b: B1, high_b: B2) -> UniformInt<i64> where
B1: SampleBorrow<<UniformInt<i64> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<i64> as UniformSampler>::X>,
[src]
B1: SampleBorrow<<UniformInt<i64> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<i64> as UniformSampler>::X>,
pub fn sample<R>(&self, rng: &mut R) -> <UniformInt<i64> as UniformSampler>::X where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_single<R, B1, B2>(
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformInt<i64> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformInt<i64> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<i64> as UniformSampler>::X>,
[src]
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformInt<i64> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformInt<i64> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<i64> as UniformSampler>::X>,
pub fn sample_single_inclusive<R, B1, B2>(
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformInt<i64> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformInt<i64> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<i64> as UniformSampler>::X>,
[src]
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformInt<i64> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformInt<i64> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<i64> as UniformSampler>::X>,
impl UniformSampler for UniformInt<i128>
[src]
type X = i128
pub fn new<B1, B2>(low_b: B1, high_b: B2) -> UniformInt<i128> where
B1: SampleBorrow<<UniformInt<i128> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<i128> as UniformSampler>::X>,
[src]
B1: SampleBorrow<<UniformInt<i128> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<i128> as UniformSampler>::X>,
pub fn new_inclusive<B1, B2>(low_b: B1, high_b: B2) -> UniformInt<i128> where
B1: SampleBorrow<<UniformInt<i128> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<i128> as UniformSampler>::X>,
[src]
B1: SampleBorrow<<UniformInt<i128> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<i128> as UniformSampler>::X>,
pub fn sample<R>(&self, rng: &mut R) -> <UniformInt<i128> as UniformSampler>::X where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_single<R, B1, B2>(
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformInt<i128> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformInt<i128> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<i128> as UniformSampler>::X>,
[src]
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformInt<i128> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformInt<i128> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<i128> as UniformSampler>::X>,
pub fn sample_single_inclusive<R, B1, B2>(
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformInt<i128> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformInt<i128> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<i128> as UniformSampler>::X>,
[src]
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformInt<i128> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformInt<i128> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<i128> as UniformSampler>::X>,
impl UniformSampler for UniformInt<isize>
[src]
type X = isize
pub fn new<B1, B2>(low_b: B1, high_b: B2) -> UniformInt<isize> where
B1: SampleBorrow<<UniformInt<isize> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<isize> as UniformSampler>::X>,
[src]
B1: SampleBorrow<<UniformInt<isize> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<isize> as UniformSampler>::X>,
pub fn new_inclusive<B1, B2>(low_b: B1, high_b: B2) -> UniformInt<isize> where
B1: SampleBorrow<<UniformInt<isize> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<isize> as UniformSampler>::X>,
[src]
B1: SampleBorrow<<UniformInt<isize> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<isize> as UniformSampler>::X>,
pub fn sample<R>(&self, rng: &mut R) -> <UniformInt<isize> as UniformSampler>::X where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_single<R, B1, B2>(
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformInt<isize> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformInt<isize> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<isize> as UniformSampler>::X>,
[src]
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformInt<isize> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformInt<isize> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<isize> as UniformSampler>::X>,
pub fn sample_single_inclusive<R, B1, B2>(
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformInt<isize> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformInt<isize> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<isize> as UniformSampler>::X>,
[src]
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformInt<isize> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformInt<isize> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<isize> as UniformSampler>::X>,
impl UniformSampler for UniformInt<u8>
[src]
type X = u8
pub fn new<B1, B2>(low_b: B1, high_b: B2) -> UniformInt<u8> where
B1: SampleBorrow<<UniformInt<u8> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<u8> as UniformSampler>::X>,
[src]
B1: SampleBorrow<<UniformInt<u8> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<u8> as UniformSampler>::X>,
pub fn new_inclusive<B1, B2>(low_b: B1, high_b: B2) -> UniformInt<u8> where
B1: SampleBorrow<<UniformInt<u8> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<u8> as UniformSampler>::X>,
[src]
B1: SampleBorrow<<UniformInt<u8> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<u8> as UniformSampler>::X>,
pub fn sample<R>(&self, rng: &mut R) -> <UniformInt<u8> as UniformSampler>::X where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_single<R, B1, B2>(
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformInt<u8> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformInt<u8> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<u8> as UniformSampler>::X>,
[src]
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformInt<u8> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformInt<u8> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<u8> as UniformSampler>::X>,
pub fn sample_single_inclusive<R, B1, B2>(
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformInt<u8> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformInt<u8> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<u8> as UniformSampler>::X>,
[src]
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformInt<u8> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformInt<u8> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<u8> as UniformSampler>::X>,
impl UniformSampler for UniformInt<u16>
[src]
type X = u16
pub fn new<B1, B2>(low_b: B1, high_b: B2) -> UniformInt<u16> where
B1: SampleBorrow<<UniformInt<u16> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<u16> as UniformSampler>::X>,
[src]
B1: SampleBorrow<<UniformInt<u16> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<u16> as UniformSampler>::X>,
pub fn new_inclusive<B1, B2>(low_b: B1, high_b: B2) -> UniformInt<u16> where
B1: SampleBorrow<<UniformInt<u16> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<u16> as UniformSampler>::X>,
[src]
B1: SampleBorrow<<UniformInt<u16> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<u16> as UniformSampler>::X>,
pub fn sample<R>(&self, rng: &mut R) -> <UniformInt<u16> as UniformSampler>::X where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_single<R, B1, B2>(
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformInt<u16> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformInt<u16> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<u16> as UniformSampler>::X>,
[src]
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformInt<u16> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformInt<u16> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<u16> as UniformSampler>::X>,
pub fn sample_single_inclusive<R, B1, B2>(
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformInt<u16> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformInt<u16> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<u16> as UniformSampler>::X>,
[src]
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformInt<u16> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformInt<u16> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<u16> as UniformSampler>::X>,
impl UniformSampler for UniformInt<u32>
[src]
type X = u32
pub fn new<B1, B2>(low_b: B1, high_b: B2) -> UniformInt<u32> where
B1: SampleBorrow<<UniformInt<u32> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<u32> as UniformSampler>::X>,
[src]
B1: SampleBorrow<<UniformInt<u32> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<u32> as UniformSampler>::X>,
pub fn new_inclusive<B1, B2>(low_b: B1, high_b: B2) -> UniformInt<u32> where
B1: SampleBorrow<<UniformInt<u32> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<u32> as UniformSampler>::X>,
[src]
B1: SampleBorrow<<UniformInt<u32> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<u32> as UniformSampler>::X>,
pub fn sample<R>(&self, rng: &mut R) -> <UniformInt<u32> as UniformSampler>::X where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_single<R, B1, B2>(
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformInt<u32> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformInt<u32> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<u32> as UniformSampler>::X>,
[src]
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformInt<u32> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformInt<u32> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<u32> as UniformSampler>::X>,
pub fn sample_single_inclusive<R, B1, B2>(
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformInt<u32> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformInt<u32> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<u32> as UniformSampler>::X>,
[src]
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformInt<u32> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformInt<u32> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<u32> as UniformSampler>::X>,
impl UniformSampler for UniformInt<u64>
[src]
type X = u64
pub fn new<B1, B2>(low_b: B1, high_b: B2) -> UniformInt<u64> where
B1: SampleBorrow<<UniformInt<u64> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<u64> as UniformSampler>::X>,
[src]
B1: SampleBorrow<<UniformInt<u64> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<u64> as UniformSampler>::X>,
pub fn new_inclusive<B1, B2>(low_b: B1, high_b: B2) -> UniformInt<u64> where
B1: SampleBorrow<<UniformInt<u64> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<u64> as UniformSampler>::X>,
[src]
B1: SampleBorrow<<UniformInt<u64> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<u64> as UniformSampler>::X>,
pub fn sample<R>(&self, rng: &mut R) -> <UniformInt<u64> as UniformSampler>::X where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_single<R, B1, B2>(
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformInt<u64> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformInt<u64> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<u64> as UniformSampler>::X>,
[src]
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformInt<u64> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformInt<u64> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<u64> as UniformSampler>::X>,
pub fn sample_single_inclusive<R, B1, B2>(
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformInt<u64> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformInt<u64> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<u64> as UniformSampler>::X>,
[src]
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformInt<u64> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformInt<u64> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<u64> as UniformSampler>::X>,
impl UniformSampler for UniformInt<u128>
[src]
type X = u128
pub fn new<B1, B2>(low_b: B1, high_b: B2) -> UniformInt<u128> where
B1: SampleBorrow<<UniformInt<u128> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<u128> as UniformSampler>::X>,
[src]
B1: SampleBorrow<<UniformInt<u128> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<u128> as UniformSampler>::X>,
pub fn new_inclusive<B1, B2>(low_b: B1, high_b: B2) -> UniformInt<u128> where
B1: SampleBorrow<<UniformInt<u128> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<u128> as UniformSampler>::X>,
[src]
B1: SampleBorrow<<UniformInt<u128> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<u128> as UniformSampler>::X>,
pub fn sample<R>(&self, rng: &mut R) -> <UniformInt<u128> as UniformSampler>::X where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_single<R, B1, B2>(
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformInt<u128> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformInt<u128> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<u128> as UniformSampler>::X>,
[src]
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformInt<u128> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformInt<u128> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<u128> as UniformSampler>::X>,
pub fn sample_single_inclusive<R, B1, B2>(
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformInt<u128> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformInt<u128> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<u128> as UniformSampler>::X>,
[src]
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformInt<u128> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformInt<u128> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<u128> as UniformSampler>::X>,
impl UniformSampler for UniformInt<usize>
[src]
type X = usize
pub fn new<B1, B2>(low_b: B1, high_b: B2) -> UniformInt<usize> where
B1: SampleBorrow<<UniformInt<usize> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<usize> as UniformSampler>::X>,
[src]
B1: SampleBorrow<<UniformInt<usize> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<usize> as UniformSampler>::X>,
pub fn new_inclusive<B1, B2>(low_b: B1, high_b: B2) -> UniformInt<usize> where
B1: SampleBorrow<<UniformInt<usize> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<usize> as UniformSampler>::X>,
[src]
B1: SampleBorrow<<UniformInt<usize> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<usize> as UniformSampler>::X>,
pub fn sample<R>(&self, rng: &mut R) -> <UniformInt<usize> as UniformSampler>::X where
R: Rng + ?Sized,
[src]
R: Rng + ?Sized,
pub fn sample_single<R, B1, B2>(
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformInt<usize> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformInt<usize> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<usize> as UniformSampler>::X>,
[src]
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformInt<usize> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformInt<usize> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<usize> as UniformSampler>::X>,
pub fn sample_single_inclusive<R, B1, B2>(
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformInt<usize> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformInt<usize> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<usize> as UniformSampler>::X>,
[src]
low_b: B1,
high_b: B2,
rng: &mut R
) -> <UniformInt<usize> as UniformSampler>::X where
R: Rng + ?Sized,
B1: SampleBorrow<<UniformInt<usize> as UniformSampler>::X>,
B2: SampleBorrow<<UniformInt<usize> as UniformSampler>::X>,