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

Optional rank/select implementation over the default Orzo configuration. More...

#include <orzo.h>

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

Public Member Functions

 OrzoRankSelectSupport (std::span< const std::uint64_t > source_words, std::size_t num_bits)
 Build Orzo from least-significant-bit-first packed words.
 
 OrzoRankSelectSupport (const OrzoRankSelectSupport &)=delete
 
OrzoRankSelectSupport & operator= (const OrzoRankSelectSupport &)=delete
 
 OrzoRankSelectSupport (OrzoRankSelectSupport &&)=delete
 
OrzoRankSelectSupport & operator= (OrzoRankSelectSupport &&)=delete
 
std::size_t size_impl () const
 Return the logical, unpadded source length.
 
int bit_impl (std::size_t position) const
 Return a 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
 Orzo always builds one-select support in this configuration.
 
bool supports_select0_impl () const
 The pinned upstream implementation does not provide zero select.
 
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 source-copy bytes, including zero padding.
 
std::size_t index_logical_bytes () const
 Return wrapper, upstream object, and requested directory bytes.
 
std::size_t memory_usage_bytes_impl () const
 Return object and allocated index/source bytes.
 
- Public Member Functions inherited from pixie::RankSelectBase< OrzoRankSelectSupport >
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 rank/select implementation over the default Orzo configuration.

Owns a masked source copy padded to whole 5,632-bit lower blocks. This keeps upstream construction and select within complete basic blocks, including partial logical tails. Uses Orzo's half-open one rank and one-based one select. Zero rank is derived because upstream rank0 adds one to its half-open answer; zero select is unavailable. One-select occurrence zero returns zero and absent one occurrences return size(). Requires BMI and BMI2. The prepared upstream header fixes directory allocation rounding and its terminal entry; query code is unchanged. Copy and move are disabled to avoid copying upstream's raw owning pointers.

Constructor & Destructor Documentation

◆ OrzoRankSelectSupport()

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

Build Orzo from least-significant-bit-first packed words.

Parameters
source_wordsExternal complete 64-bit words, copied during construction.
num_bitsLogical bit count, clamped to available words.
Exceptions
std::length_errorIf source padding is unrepresentable.

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