Trait sux::traits::rank_sel::SelectZeroHinted
source · pub trait SelectZeroHinted {
// Required methods
unsafe fn select_zero_hinted_unchecked(
&self,
rank: usize,
hint_pos: usize,
hint_rank: usize
) -> usize;
fn select_zero_hinted(
&self,
rank: usize,
hint_pos: usize,
hint_rank: usize
) -> Option<usize>;
}
Expand description
Select zeros 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,
SelectZeroFixed1
adds hints
for the positions of zeros at regular intervals.
Required Methods§
sourceunsafe fn select_zero_hinted_unchecked(
&self,
rank: usize,
hint_pos: usize,
hint_rank: usize
) -> usize
unsafe fn select_zero_hinted_unchecked( &self, rank: usize, hint_pos: usize, hint_rank: usize ) -> usize
Select the zero of given rank, provided the position of a preceding zero and its rank.
§Safety
rank
must be between zero (included) and the number of zeros 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 zero in the underlying bit vector.
hint_rank
must be the number of zeros in the underlying bit vector
before hint_pos
, and must be less than or equal to rank
.
Implementations on Foreign Types§
source§impl<T: SelectZeroHinted + ?Sized> SelectZeroHinted for &T
impl<T: SelectZeroHinted + ?Sized> SelectZeroHinted for &T
source§impl<T: SelectZeroHinted + ?Sized> SelectZeroHinted for &mut T
impl<T: SelectZeroHinted + ?Sized> SelectZeroHinted for &mut T
source§impl<T: SelectZeroHinted + ?Sized> SelectZeroHinted for Box<T>
impl<T: SelectZeroHinted + ?Sized> SelectZeroHinted for Box<T>
Implementors§
impl<B: AsRef<[usize]>> SelectZeroHinted for BitVec<B>
impl<B: AsRef<[usize]>> SelectZeroHinted for CountBitVec<B>
impl<B: SelectHinted + SelectZeroHinted, I: AsRef<[u64]>, const LOG2_ONES_PER_INVENTORY: usize, const LOG2_U64_PER_SUBINVENTORY: usize> SelectZeroHinted for SelectFixed2<B, I, LOG2_ONES_PER_INVENTORY, LOG2_U64_PER_SUBINVENTORY>
Forward SelectHinted
to the underlying implementation.
impl<B: SelectHinted + SelectZeroHinted, O: BitFieldSlice<usize>, const LOG2_ONES_PER_INVENTORY: usize> SelectZeroHinted for SelectFixed1<B, O, LOG2_ONES_PER_INVENTORY>
Forward SelectZeroHinted
to the underlying implementation.