[][src]Struct terminus_store::structure::wavelettree::WaveletTree

pub struct WaveletTree { /* fields omitted */ }

A wavelet tree, encoding a u64 array for fast lookup of number positions.

A wavelet tree consists of a layer of bitarrays (stored as one big bitarray). The amount of layers is the log2 of the alphabet size, rounded up to make it an integer. Since we're encoding u64 values, the number of layers can never be larger than 64.

Implementations

impl WaveletTree[src]

pub fn from_parts(bits: BitIndex, num_layers: u8) -> WaveletTree[src]

Construct a wavelet tree from a bitindex and a layer count.

pub fn len(&self) -> usize[src]

Returns the length of the encoded array.

pub fn num_layers(&self) -> usize[src]

Returns the amount of layers.

pub fn decode(&self) -> impl Iterator<Item = u64>[src]

Decode the wavelet tree to the original u64 sequence. This returns an iterator.

pub fn decode_one(&self, index: usize) -> u64[src]

Decode a single position of the original u64 sequence.

pub fn lookup(&self, entry: u64) -> Option<WaveletLookup>[src]

Lookup the given entry. This returns a WaveletLookup which can then be used to find all positions.

pub fn lookup_one(&self, entry: u64) -> Option<u64>[src]

Lookup the given entry. This returns a single result, even if there's multiple.

Trait Implementations

impl Clone for WaveletTree[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,