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§

source

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.

source

fn select_zero_hinted( &self, rank: usize, hint_pos: usize, hint_rank: usize ) -> Option<usize>

Select the zero of given rank, provided the position of a preceding zero and its rank.

Implementations on Foreign Types§

source§

impl<T: SelectZeroHinted + ?Sized> SelectZeroHinted for &T

source§

unsafe fn select_zero_hinted_unchecked( &self, rank: usize, hint_pos: usize, hint_rank: usize ) -> usize

source§

fn select_zero_hinted( &self, rank: usize, hint_pos: usize, hint_rank: usize ) -> Option<usize>

source§

impl<T: SelectZeroHinted + ?Sized> SelectZeroHinted for &mut T

source§

unsafe fn select_zero_hinted_unchecked( &self, rank: usize, hint_pos: usize, hint_rank: usize ) -> usize

source§

fn select_zero_hinted( &self, rank: usize, hint_pos: usize, hint_rank: usize ) -> Option<usize>

source§

impl<T: SelectZeroHinted + ?Sized> SelectZeroHinted for Box<T>

source§

unsafe fn select_zero_hinted_unchecked( &self, rank: usize, hint_pos: usize, hint_rank: usize ) -> usize

source§

fn select_zero_hinted( &self, rank: usize, hint_pos: usize, hint_rank: usize ) -> Option<usize>

Implementors§

source§

impl<B: AsRef<[usize]>> SelectZeroHinted for BitVec<B>

source§

impl<B: AsRef<[usize]>> SelectZeroHinted for CountBitVec<B>

source§

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.

source§

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.