Trait qwt::WTSupport

source ·
pub trait WTSupport: AccessQuad + RankQuad + SelectQuad {
    // Required methods
    fn occs(&self, symbol: u8) -> Option<usize>;
    unsafe fn occs_unchecked(&self, symbol: u8) -> usize;
    fn occs_smaller(&self, symbol: u8) -> Option<usize>;
    unsafe fn rank_block_unchecked(&self, symbol: u8, i: usize) -> usize;
    unsafe fn occs_smaller_unchecked(&self, symbol: u8) -> usize;
    fn prefetch_info(&self, pos: usize);
    fn prefetch_data(&self, pos: usize);
}
Expand description

A trait for the operations that a quad vector implementation needs to provide to be used in a Quad Wavelet Tree.

Required Methods§

source

fn occs(&self, symbol: u8) -> Option<usize>

Returns the number of occurrences of symbol in the indexed sequence, None if symbol is larger than 3, i.e., symbol is not valid.

source

unsafe fn occs_unchecked(&self, symbol: u8) -> usize

Returns the number of occurrences of symbol in the indexed sequence.

Safety

Calling this method if the symbol is larger than 3 (i.e., symbol is not valid) is undefined behavior.

source

fn occs_smaller(&self, symbol: u8) -> Option<usize>

Returns the number of occurrences of all the symbols smaller than the input symbol, None if symbol is larger than 3, i.e., symbol is not valid.

source

unsafe fn rank_block_unchecked(&self, symbol: u8, i: usize) -> usize

Returns the rank of symbol up to the block that contains the position i.

Safety

Calling this method if the symbol is larger than 3 of if the position i is out of bound is undefined behavior.

source

unsafe fn occs_smaller_unchecked(&self, symbol: u8) -> usize

Returns the number of occurrences of all the symbols smaller than the input symbol in the indexed sequence.

Safety

Calling this method if the symbol is larger than 3 is undefined behavior.

source

fn prefetch_info(&self, pos: usize)

Prefetches counter of superblock and blocks containing the position pos.

source

fn prefetch_data(&self, pos: usize)

Prefetches data containing the position pos.

Implementors§