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]
impl<BlockStore, const BLOCK_SIZE: u16, const RANK_STORE_FREQ: u16> RrrVector<BlockStore, BLOCK_SIZE, RANK_STORE_FREQ> where
BlockStore: Code,
[src]pub fn get_bv_element(&self, index: usize) -> usize
[src]
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]
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] $
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]
impl<BlockStore, const BLOCK_SIZE: u16, const RANK_STORE_FREQ: u16> Clone for RrrVector<BlockStore, BLOCK_SIZE, RANK_STORE_FREQ> where
BlockStore: Code,
[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,
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,
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,
BlockStore: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
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]
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