Skip to main content

bernoulli_packed

Function bernoulli_packed 

Source
pub fn bernoulli_packed<R: Rng + ?Sized>(
    prob: f64,
    length: usize,
    rng: &mut R,
) -> Vec<u64>
Expand description

Generate a packed Bernoulli bitstream directly into u64 words.

This is bit-identical to pack(&bernoulli_stream(...)).data for the same RNG state while avoiding the intermediate Vec<u8> allocation.