Struct columnar::sums::rank_select::RankSelect
source · pub struct RankSelect<CC = Vec<u64>, VC = Vec<u64>, WC = u64> {
pub counts: CC,
pub values: Bools<VC, WC>,
}
Expand description
A store for maintaining Vec<bool>
with fast rank
and select
access.
The design is to have u64
running counts for each block of 1024 bits,
which are roughly the size of a cache line. This is roughly 6% overhead,
above the bits themselves, which seems pretty solid.
Fields§
§counts: CC
Counts of the number of cumulative set (true) bits, after each block of 1024 bits.
values: Bools<VC, WC>
The bits themselves.
Implementations§
source§impl<CC: Len + IndexAs<u64>, VC: Len + IndexAs<u64>, WC: Copy + CopyAs<u64>> RankSelect<CC, VC, WC>
impl<CC: Len + IndexAs<u64>, VC: Len + IndexAs<u64>, WC: Copy + CopyAs<u64>> RankSelect<CC, VC, WC>
sourcepub fn rank(&self, index: usize) -> usize
pub fn rank(&self, index: usize) -> usize
The number of set bits strictly preceding index
.
This number is accumulated first by reading out of self.counts
at the correct position,
then by summing the ones in strictly prior u64
entries, then by counting the ones in the
masked u64
in which the bit lives.
Trait Implementations§
source§impl<CC: Clone, VC: Clone, WC: Clone> Clone for RankSelect<CC, VC, WC>
impl<CC: Clone, VC: Clone, WC: Clone> Clone for RankSelect<CC, VC, WC>
source§fn clone(&self) -> RankSelect<CC, VC, WC>
fn clone(&self) -> RankSelect<CC, VC, WC>
Returns a copy 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 moresource§impl<CC: Default, VC: Default, WC: Default> Default for RankSelect<CC, VC, WC>
impl<CC: Default, VC: Default, WC: Default> Default for RankSelect<CC, VC, WC>
source§fn default() -> RankSelect<CC, VC, WC>
fn default() -> RankSelect<CC, VC, WC>
Returns the “default value” for a type. Read more
source§impl<'de, CC, VC, WC> Deserialize<'de> for RankSelect<CC, VC, WC>
impl<'de, CC, VC, WC> Deserialize<'de> for RankSelect<CC, VC, WC>
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<CC, VC, WC> Serialize for RankSelect<CC, VC, WC>
impl<CC, VC, WC> Serialize for RankSelect<CC, VC, WC>
impl<CC: Copy, VC: Copy, WC: Copy> Copy for RankSelect<CC, VC, WC>
impl<CC, VC, WC> StructuralPartialEq for RankSelect<CC, VC, WC>
Auto Trait Implementations§
impl<CC, VC, WC> Freeze for RankSelect<CC, VC, WC>
impl<CC, VC, WC> RefUnwindSafe for RankSelect<CC, VC, WC>
impl<CC, VC, WC> Send for RankSelect<CC, VC, WC>
impl<CC, VC, WC> Sync for RankSelect<CC, VC, WC>
impl<CC, VC, WC> Unpin for RankSelect<CC, VC, WC>
impl<CC, VC, WC> UnwindSafe for RankSelect<CC, VC, WC>
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)