Trait sucds::bit_vectors::Select

source ·
pub trait Select {
    // Required methods
    fn select1(&self, k: usize) -> Option<usize>;
    fn select0(&self, k: usize) -> Option<usize>;
}
Expand description

Interface for select queries on bit vectors.

Let $S \subseteq \{ 0,1,\dots,u-1 \}$ be a set of positions at which bits are set in a bit vector of length $u$.

Required Methods§

source

fn select1(&self, k: usize) -> Option<usize>

Returns the $k$-th smallest position in $S$, or None if out of bounds.

source

fn select0(&self, k: usize) -> Option<usize>

Returns the $k$-th smallest integer $x$ such that $x \not\in S$ and $0 \leq x < u$, or None if out of bounds.

Implementors§