Pixie
Loading...
Searching...
No Matches
pixie::SdslRankSelectSupport Class Reference

Optional SDSL rank-v index with MCL select in both directions. More...

#include <sdsl.h>

Inheritance diagram for pixie::SdslRankSelectSupport:
pixie::RankSelectBase< SdslRankSelectSupport >

Public Member Functions

 SdslRankSelectSupport (std::span< const std::uint64_t > source_words, std::size_t num_bits)
 Copy packed source words and build rank1, select1 and select0.
 
 SdslRankSelectSupport (const SdslRankSelectSupport &)=delete
 
SdslRankSelectSupport & operator= (const SdslRankSelectSupport &)=delete
 
 SdslRankSelectSupport (SdslRankSelectSupport &&)=delete
 
SdslRankSelectSupport & operator= (SdslRankSelectSupport &&)=delete
 
std::size_t size_impl () const
 Return the logical bit count.
 
int bit_impl (std::size_t position) const
 Read a zero-based bit; position must be below size().
 
std::uint64_t rank_impl (std::size_t end) const
 Count ones in [0, end), clamping end to size().
 
std::uint64_t select_impl (std::size_t occurrence) const
 Locate a one-based one occurrence, or size() if absent.
 
std::uint64_t select0_impl (std::size_t occurrence) const
 Locate a one-based zero occurrence, or size() if absent.
 
bool supports_select1_impl () const
 SDSL constructs one-select support unconditionally.
 
bool supports_select0_impl () const
 SDSL constructs zero-select support unconditionally.
 
std::size_t source_copy_bytes () const
 Return allocated bytes in the owned source buffer.
 
std::size_t index_logical_bytes () const
 Return object bytes plus SDSL's serialized logical directory sizes.
 
std::size_t memory_usage_bytes_impl () const
 Return the reported index footprint and owned source bytes.
 
- Public Member Functions inherited from pixie::RankSelectBase< SdslRankSelectSupport >
std::size_t size () const
 Return the number of valid bits.
 
bool empty () const
 Check whether the bit vector is empty.
 
int operator[] (std::size_t position) const
 Read a bit by zero-based position.
 
std::uint64_t rank (std::size_t end_position) const
 Count one bits in the prefix [0, end_position).
 
std::uint64_t rank0 (std::size_t end_position) const
 Count zero bits in the prefix [0, end_position).
 
std::uint64_t select (std::size_t rank) const
 Return the position of the rank-th one bit.
 
std::uint64_t select0 (std::size_t rank) const
 Return the position of the rank-th zero bit.
 
bool supports_select1 () const
 Check whether select queries for one bits are enabled.
 
bool supports_select0 () const
 Check whether select queries for zero bits are enabled.
 
std::size_t memory_usage_bytes () const
 Return owned index memory usage when provided by the implementation.
 
std::string to_string () const
 Convert the logical bits to a binary string.
 

Detailed Description

Optional SDSL rank-v index with MCL select in both directions.

Owns a normalized source copy. Prefix ranks are half-open and selects use one-based occurrences with zero-based positions and Pixie's sentinels. Copy and move are disabled because SDSL support objects point into bits_.

Constructor & Destructor Documentation

◆ SdslRankSelectSupport()

pixie::SdslRankSelectSupport::SdslRankSelectSupport ( std::span< const std::uint64_t > source_words,
std::size_t num_bits )
inlineexplicit

Copy packed source words and build rank1, select1 and select0.

Parameters
source_wordsComplete least-significant-bit-first packed words.
num_bitsLogical bit count, clamped to the supplied source capacity.

Ignores dirty trailing bits. Allocation failure propagates.

Member Function Documentation

◆ index_logical_bytes()

std::size_t pixie::SdslRankSelectSupport::index_logical_bytes ( ) const
inline

Return object bytes plus SDSL's serialized logical directory sizes.

Uses SDSL's size_in_bytes convention, excluding the owned source payload and allocator bookkeeping. This inspects the directories; benchmark callers must collect it outside measured construction/query work.


The documentation for this class was generated from the following file: