Trait necsim_core::cogs::rng::RngSampler
source · pub trait RngSampler<M: MathsCore>: RngCore<M> {
// Provided methods
fn sample_uniform_closed_open(&mut self) -> ClosedOpenUnitF64 { ... }
fn sample_uniform_open_closed(&mut self) -> OpenClosedUnitF64 { ... }
fn sample_index(&mut self, length: NonZeroUsize) -> usize { ... }
fn sample_index_u32(&mut self, length: NonZeroU32) -> u32 { ... }
fn sample_index_u64(&mut self, length: NonZeroU64) -> u64 { ... }
fn sample_index_u128(&mut self, length: NonZeroU128) -> u128 { ... }
fn sample_exponential(&mut self, lambda: PositiveF64) -> NonNegativeF64 { ... }
fn sample_event(&mut self, probability: ClosedUnitF64) -> bool { ... }
fn sample_2d_standard_normal(&mut self) -> (f64, f64) { ... }
fn sample_2d_normal(&mut self, mu: f64, sigma: NonNegativeF64) -> (f64, f64) { ... }
}
Provided Methods§
sourcefn sample_uniform_closed_open(&mut self) -> ClosedOpenUnitF64
fn sample_uniform_closed_open(&mut self) -> ClosedOpenUnitF64
Samples a uniform sample within [0.0, 1.0)
, i.e. 0.0 <= X < 1.0
sourcefn sample_uniform_open_closed(&mut self) -> OpenClosedUnitF64
fn sample_uniform_open_closed(&mut self) -> OpenClosedUnitF64
Samples a uniform sample within (0.0, 1.0]
, i.e. 0.0 < X <= 1.0
sourcefn sample_index(&mut self, length: NonZeroUsize) -> usize
fn sample_index(&mut self, length: NonZeroUsize) -> usize
sourcefn sample_index_u32(&mut self, length: NonZeroU32) -> u32
fn sample_index_u32(&mut self, length: NonZeroU32) -> u32
sourcefn sample_index_u64(&mut self, length: NonZeroU64) -> u64
fn sample_index_u64(&mut self, length: NonZeroU64) -> u64
sourcefn sample_index_u128(&mut self, length: NonZeroU128) -> u128
fn sample_index_u128(&mut self, length: NonZeroU128) -> u128
fn sample_exponential(&mut self, lambda: PositiveF64) -> NonNegativeF64
fn sample_event(&mut self, probability: ClosedUnitF64) -> bool
fn sample_2d_standard_normal(&mut self) -> (f64, f64)
fn sample_2d_normal(&mut self, mu: f64, sigma: NonNegativeF64) -> (f64, f64)
Object Safety§
This trait is not object safe.