controlled_flip

Function controlled_flip 

Source
pub const fn controlled_flip(
    index: usize,
    ctrl_pos: usize,
    target_pos: usize,
) -> usize
Expand description

Compute the index with a controlled bit flip

If the control bit at ctrl_pos is 1, then the target bit at target_pos is flipped.