CRTP facade for immutable rank/select queries and bit access.
More...
#include <rank_select.h>
|
| 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.
|
| |
template<class Impl>
class pixie::RankSelectBase< Impl >
CRTP facade for immutable rank/select queries and bit access.
- See also
<pixie/rank_select/implementations.h> for the available concrete implementations.
◆ empty()
Check whether the bit vector is empty.
- Returns
true when size() == 0.
◆ memory_usage_bytes()
Return owned index memory usage when provided by the implementation.
- Returns
- Size of the object and its owned auxiliary storage in bytes.
◆ operator[]()
Read a bit by zero-based position.
- Parameters
-
| position | Position in [0, size()). |
- Returns
- Zero or one.
◆ rank()
Count one bits in the prefix [0, end_position).
- Parameters
-
| end_position | Prefix boundary in [0, size()]. |
- Returns
- Number of one bits in the prefix.
◆ rank0()
Count zero bits in the prefix [0, end_position).
- Parameters
-
| end_position | Prefix boundary in [0, size()]. |
- Returns
- Number of zero bits in the prefix.
◆ select()
Return the position of the rank-th one bit.
- Parameters
-
| rank | One-based rank. Rank zero returns zero for compatibility. |
- Returns
- Zero-based bit position, or
size() if unavailable or absent.
◆ select0()
Return the position of the rank-th zero bit.
- Parameters
-
| rank | One-based rank. Rank zero returns zero for compatibility. |
- Returns
- Zero-based bit position, or
size() if unavailable or absent.
◆ size()
Return the number of valid bits.
- Returns
- Logical bit-vector length.
◆ supports_select0()
Check whether select queries for zero bits are enabled.
- Returns
true when select0() is supported by this instance.
◆ supports_select1()
Check whether select queries for one bits are enabled.
- Returns
true when select() is supported by this instance.
◆ to_string()
Convert the logical bits to a binary string.
- Returns
- A string of
size() characters containing only 0 and 1.
The documentation for this class was generated from the following file: