pub fn bits_iter(num_bits: usize) -> impl Iterator<Item = Vec<bool>>Expand description
Returns an iterator that gives the MSB-first binary representation of the numbers from 0 to 2^num_bits. 0,0,0 -> 0,0,1 -> 0,1,0 -> 0,1,1 -> 1,0,0 -> 1,0,1 -> 1,1,0 -> 1,1,1
ยงExample:
use frontend::layouter::nodes::split_node::bits_iter;
let bits_iter = bits_iter(2);
let bits: Vec<Vec<bool>> = bits_iter.collect();
assert_eq!(bits, vec![
vec![false, false],
vec![false, true],
vec![true, false],
vec![true, true],
]);