SelectBin

Trait SelectBin 

Source
pub trait SelectBin {
    // Required methods
    fn select1(&self, i: usize) -> Option<usize>;
    unsafe fn select1_unchecked(&self, i: usize) -> usize;
    fn select0(&self, i: usize) -> Option<usize>;
    unsafe fn select0_unchecked(&self, i: usize) -> usize;
}
Expand description

A trait for the support of select query over the binary alphabet.

Required Methods§

Source

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

Returns the position of the i+1-th occurrence of a bit set to 1. Returns None if there is no such position.

Source

unsafe fn select1_unchecked(&self, i: usize) -> usize

Returns the position of the i+1-th occurrence of a bit set to 1.

§Safety

This method doesn’t check that such element exists Calling this method with an i >= maximum rank1 is undefined behaviour.

Source

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

Returns the position of the i+1-th occurrence of a bit set to 0. Returns None if there is no such position.

Source

unsafe fn select0_unchecked(&self, i: usize) -> usize

Returns the position of the i+1-th occurrence of a bit set to 0.

§Safety

This method doesnt check that such element exists Calling this method with an i >= maximum rank0 is undefined behaviour.

Implementors§

Source§

impl SelectBin for RSNarrow

Source§

impl SelectBin for RSWide

Source§

impl<const SELECT0_SUPPORT: bool> SelectBin for DArray<SELECT0_SUPPORT>