pub struct WaveletMatrix { /* private fields */ }Expand description
A wavelet matrix over an integer alphabet [0, σ).
Supports access, rank, and select queries in O(log σ) time using
⌈log₂ σ⌉ levels of RankSelectBitVecs.
Implementations§
Source§impl WaveletMatrix
impl WaveletMatrix
Sourcepub fn build(symbols: &[usize], sigma: usize) -> Result<Self>
pub fn build(symbols: &[usize], sigma: usize) -> Result<Self>
Build a wavelet matrix from a sequence of symbols in [0, sigma).
§Errors
Returns an error if any symbol is ≥ sigma or sigma is 0.
Sourcepub fn access(&self, i: usize) -> Option<usize>
pub fn access(&self, i: usize) -> Option<usize>
Access the symbol at position i.
Returns None if i >= len.
Sourcepub fn rank(&self, c: usize, i: usize) -> usize
pub fn rank(&self, c: usize, i: usize) -> usize
Count occurrences of symbol c in positions [0, i).
Trait Implementations§
Source§impl Clone for WaveletMatrix
impl Clone for WaveletMatrix
Source§fn clone(&self) -> WaveletMatrix
fn clone(&self) -> WaveletMatrix
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for WaveletMatrix
impl RefUnwindSafe for WaveletMatrix
impl Send for WaveletMatrix
impl Sync for WaveletMatrix
impl Unpin for WaveletMatrix
impl UnsafeUnpin for WaveletMatrix
impl UnwindSafe for WaveletMatrix
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more