Trait sux::traits::rank_sel::SelectHinted
source · pub trait SelectHinted {
// Required methods
unsafe fn select_hinted_unchecked(
&self,
rank: usize,
hint_pos: usize,
hint_rank: usize
) -> usize;
fn select_hinted(
&self,
rank: usize,
hint_pos: usize,
hint_rank: usize
) -> Option<usize>;
}
Expand description
Select over a bit vector, with a hint.
This trait is used to implement fast selection by adding to bit vectors
indices of different kind. For example,
SelectFixed1
adds hints
for the positions of ones at fixed intervals.
Required Methods§
sourceunsafe fn select_hinted_unchecked(
&self,
rank: usize,
hint_pos: usize,
hint_rank: usize
) -> usize
unsafe fn select_hinted_unchecked( &self, rank: usize, hint_pos: usize, hint_rank: usize ) -> usize
Select the one of given rank, provided the position of a preceding one and its rank.
§Safety
rank
must be between zero (included) and the number of ones in the
underlying bit vector (excluded). hint_pos
must be between 0 (included) and
the length of the underlying bit vector (included),
and must be the position of a one in the underlying bit vector.
hint_rank
must be the number of ones in the underlying bit vector
before hint_pos
, and must be less than or equal to rank
.