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

Pasta flat rank/select adapter over a copied packed bit sequence. More...

#include <pasta.h>

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

Public Member Functions

 PastaRankSelectSupport (std::span< const uint64_t > source_words, std::size_t num_bits)
 Construct an owning Pasta index from caller-provided packed words.
 
std::size_t size_impl () const
 Return the number of valid source bits.
 
int bit_impl (std::size_t position) const
 Return the bit at a zero-based valid position.
 
uint64_t rank_impl (std::size_t end_position) const
 Return the one rank in [0, end_position).
 
uint64_t select_impl (std::size_t rank) const
 Return the zero-based position of a one-based one rank.
 
uint64_t select0_impl (std::size_t rank) const
 Return the zero-based position of a one-based zero rank.
 
bool supports_select1_impl () const
 Pasta constructs support for one selects unconditionally.
 
bool supports_select0_impl () const
 Pasta constructs support for zero selects unconditionally.
 
std::size_t memory_usage_bytes_impl () const
 Return bytes owned by the converted source and Pasta metadata.
 
std::size_t source_copy_bytes () const
 Return bytes in Pasta's owned normalized source copy.
 
std::size_t index_logical_bytes () const
 Return Pasta's logical index bytes, excluding its owned source.
 
- Public Member Functions inherited from pixie::RankSelectBase< PastaRankSelectSupport >
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

Pasta flat rank/select adapter over a copied packed bit sequence.

The constructor owns a normalized copy of the logical source words; source mutations do not affect this index. Both select directions are always available. Public positions are zero-based, prefix ranks use [0, end), and selects use one-based ranks with the Pixie rank-zero and out-of-range sentinels.

Constructor & Destructor Documentation

◆ PastaRankSelectSupport()

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

Construct an owning Pasta index from caller-provided packed words.

Parameters
source_wordsPacked least-significant-bit-first source words.
num_bitsNumber of valid input bits, clamped to source_words.

Member Function Documentation

◆ index_logical_bytes()

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

Return Pasta's logical index bytes, excluding its owned source.

Pasta reports logical vector sizes rather than allocator capacity.

◆ memory_usage_bytes_impl()

std::size_t pixie::PastaRankSelectSupport::memory_usage_bytes_impl ( ) const
inline

Return bytes owned by the converted source and Pasta metadata.

Pasta's FlatRankSelect::space_usage() omits its inherited L1/L2 table, so account for that table explicitly from its documented layout.


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