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

Optional rank/select implementation over succinct-bitvec-cpp's FastBitVec. More...

#include <succinct_bitvec.h>

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

Public Member Functions

 SuccinctFastRankSelectSupport (std::span< const std::uint64_t > source_words, std::size_t num_bits)
 Build FastBitVec over an owned least-significant-bit-first source.
 
 SuccinctFastRankSelectSupport (const SuccinctFastRankSelectSupport &)=delete
 
SuccinctFastRankSelectSupport & operator= (const SuccinctFastRankSelectSupport &)=delete
 
 SuccinctFastRankSelectSupport (SuccinctFastRankSelectSupport &&)=delete
 
SuccinctFastRankSelectSupport & operator= (SuccinctFastRankSelectSupport &&)=delete
 
std::size_t size_impl () const
 Return the logical source length.
 
int bit_impl (std::size_t position) const
 Return a source 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
 Return a one-based one's position, zero for zero, size() if absent.
 
bool supports_select1_impl () const
 FastBitVec always builds one-select metadata.
 
bool supports_select0_impl () const
 The pinned upstream implementation has no zero-select API.
 
std::uint64_t select0_impl (std::size_t occurrence) const
 Return zero for occurrence zero, otherwise size(): disabled.
 
std::size_t source_copy_bytes () const
 Return allocated bytes in the normalized source copy.
 
std::size_t index_logical_bytes () const
 Return object plus upstream-reported logical index bytes.
 
std::size_t memory_usage_bytes_impl () const
 Return reported index bytes plus the allocated source copy.
 
- Public Member Functions inherited from pixie::RankSelectBase< SuccinctFastRankSelectSupport >
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.
 

Static Public Attributes

static constexpr std::uint64_t kMaxBits = std::uint64_t{1} << 32
 Largest supported source; its last bit fits a uint32_t sample.
 

Detailed Description

Optional rank/select implementation over succinct-bitvec-cpp's FastBitVec.

Owns a masked source copy and the upstream index. Upstream ranks include their bit position and selects have zero-based occurrence numbers; this adapter uses half-open prefixes and one-based occurrences. Rank zero selects return zero; absent one occurrences return size(). Zero rank is derived from one rank; zero select is unavailable. Upstream's uint32_t sample positions limit the logical source to 2^32 bits. Copy and move are disabled because FastBitVec retains a reference to its RawBits object.

Constructor & Destructor Documentation

◆ SuccinctFastRankSelectSupport()

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

Build FastBitVec over an owned least-significant-bit-first source.

Parameters
source_wordsPacked complete 64-bit words, including optional padding.
num_bitsLogical bit count, clamped to the available words.
Exceptions
std::length_errorIf the clamped source exceeds 2^32 bits.

Member Function Documentation

◆ index_logical_bytes()

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

Return object plus upstream-reported logical index bytes.

FastBitVec exposes directory sizes, not allocator capacities.


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