Function malachite_base::num::random::striped::get_striped_bool_vec
source · [−]pub fn get_striped_bool_vec(
bit_source: &mut StripedBitSource,
len: u64
) -> Vec<bool>
Expand description
Generates a striped Vec<bool>
, with a given length, from a StripedBitSource
.
See here for more information.
The output length is len
.
Expected complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and n
is len
.
Examples
use malachite_base::num::random::striped::{get_striped_bool_vec, StripedBitSource};
use malachite_base::random::EXAMPLE_SEED;
let mut bit_source = StripedBitSource::new(EXAMPLE_SEED, 10, 1);
let bits: String = get_striped_bool_vec(&mut bit_source, 50)
.into_iter()
.map(|b| if b { '1' } else { '0' })
.collect();
assert_eq!(bits, "00011111111111000000011111111111111000000000001111");