Struct sdsl::RrrVector[][src]

pub struct RrrVector<BlockStore, const BLOCK_SIZE: u16, const RANK_STORE_FREQ: u16> where
    BlockStore: Code, 
{ /* fields omitted */ }
Expand description

$ H_0 $-compressed bit vector representation.

Arguments

  • BlockStore - A random access integer vector or wavelet tree used to store the block types.
  • BLOCK_SIZE - Size of a basic block.
  • RANK_STORE_FREQ - A rank sample value is stored before every t_k-th basic block.

References

  • Rasmus Pagh Low redundancy in dictionaries with O(1) worst case lookup time Technical Report 1998. ftp://ftp.cs.au.dk/BRICS/Reports/RS/98/28/BRICS-RS-98-28.pdf, Section 2.
  • Rajeev Raman, V. Raman and S. Srinivasa Rao Succinct Indexable Dictionaries with Applications to representations of k-ary trees and multi-sets. SODA 2002.
  • Francisco Claude, Gonzalo Navarro: Practical Rank/Select Queries over Arbitrary Sequences. SPIRE 2008: 176-187
  • On the fly-decoding and encoding was discovered in; Gonzalo Navarro, Eliana Providel: Fast, Small, Simple Rank/Select on Bitmaps. SEA 2012

Example

let bv = sdsl::bit_vector! {1, 1, 0, 1};
let rv = sdsl::RrrVector::<sdsl::IntVector<0>, 10, 2>::new(&bv)?;

let result = rv.get_int(1, 3);
let expected = 5;
assert_eq!(result, expected);

For further examples see here.

Implementations

impl<BlockStore, const BLOCK_SIZE: u16, const RANK_STORE_FREQ: u16> RrrVector<BlockStore, BLOCK_SIZE, RANK_STORE_FREQ> where
    BlockStore: Code, 
[src]

pub fn new(bit_vector: &BitVector) -> Result<Self>[src]

Construct a new $ H_0 $-compressed bit vector.

Arguments

  • bit_vector - Uncompressed bit vector.

pub fn from_file(path: &PathBuf) -> Result<Self>[src]

Load vector from file.

Arguments

  • path - File path.

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

Returns the length of the original bit vector.

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

Get the i-th element of the original bit vector.

Arguments

  • index - An index in range $ [0, \mathrm{len}()) $.

pub fn get_int(&self, index: usize, len: u8) -> usize[src]

Get the integer value of the binary string of length len starting at position index.

Arguments

  • index - Starting index of the binary representation of the integer. $ \mathrm{index} + \mathrm{len} -1 \in [0..\mathrm{size}()-1] $
  • len - Length of the binary representation of the integer. $ \mathrm{len} \in [1..64] $

pub fn iter_bv(&self) -> VectorIterator<'_, Self>[src]

Returns an iterator over the original bit vector values.

pub fn iter_int(&self, len: u8) -> RrrVectorIntIterator<'_, Self>[src]

Returns an iterator over integer values of the binary string.

Arguments

  • len - Length of the binary representation of the integer. $ \mathrm{len} \in [1..64] $

Trait Implementations

impl<BlockStore, const BLOCK_SIZE: u16, const RANK_STORE_FREQ: u16> Clone for RrrVector<BlockStore, BLOCK_SIZE, RANK_STORE_FREQ> where
    BlockStore: Code, 
[src]

fn clone(&self) -> Self[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<BlockStore, const BLOCK_SIZE: u16, const RANK_STORE_FREQ: u16> Drop for RrrVector<BlockStore, BLOCK_SIZE, RANK_STORE_FREQ> where
    BlockStore: Code, 
[src]

fn drop(&mut self)[src]

Executes the destructor for this type. Read more

impl<BlockStore, const BLOCK_SIZE: u16, const RANK_STORE_FREQ: u16> IO for RrrVector<BlockStore, BLOCK_SIZE, RANK_STORE_FREQ> where
    BlockStore: Code, 
[src]

fn io(&self) -> &Interface[src]

Auto Trait Implementations

impl<BlockStore, const BLOCK_SIZE: u16, const RANK_STORE_FREQ: u16> RefUnwindSafe for RrrVector<BlockStore, BLOCK_SIZE, RANK_STORE_FREQ> where
    BlockStore: RefUnwindSafe

impl<BlockStore, const BLOCK_SIZE: u16, const RANK_STORE_FREQ: u16> !Send for RrrVector<BlockStore, BLOCK_SIZE, RANK_STORE_FREQ>

impl<BlockStore, const BLOCK_SIZE: u16, const RANK_STORE_FREQ: u16> !Sync for RrrVector<BlockStore, BLOCK_SIZE, RANK_STORE_FREQ>

impl<BlockStore, const BLOCK_SIZE: u16, const RANK_STORE_FREQ: u16> Unpin for RrrVector<BlockStore, BLOCK_SIZE, RANK_STORE_FREQ> where
    BlockStore: Unpin

impl<BlockStore, const BLOCK_SIZE: u16, const RANK_STORE_FREQ: u16> UnwindSafe for RrrVector<BlockStore, BLOCK_SIZE, RANK_STORE_FREQ> where
    BlockStore: UnwindSafe

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Same<T> for T

type Output = T

Should always be Self

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

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.