A dynamic data structure supporting rank and select queries on a bit sequence B[0..n-1].
More...
|
|
|
| DynamicBitSequence () |
| | Default constructor with |B| = 0.
|
| |
|
| DynamicBitSequence (const DynamicBitSequence &)=delete |
| | Deleted copy constructor.
|
| |
|
| DynamicBitSequence (DynamicBitSequence &&) noexcept=default |
| | Default move constructor.
|
| |
|
|
BitForwardIterator< CONTAINER, CONTAINER_ITERATOR, MAX_TREE_DEGREE, MAX_BIT_CONTAINER_SIZE > | get_bit_forward_iterator_begin () const |
| | Returns an iterator to the beginning of the bit sequence B.
|
| |
|
BitForwardIterator< CONTAINER, CONTAINER_ITERATOR, MAX_TREE_DEGREE, MAX_BIT_CONTAINER_SIZE > | get_leaf_forward_iterator_end () const |
| | Returns an iterator to the end of the bit sequence B.
|
| |
|
|
DynamicBitSequence & | operator= (const DynamicBitSequence &)=delete |
| | Deleted copy assignment operator.
|
| |
|
DynamicBitSequence & | operator= (DynamicBitSequence &&) noexcept=default |
| | Default move assignment operator.
|
| |
|
bool | operator[] (uint64_t i) const |
| | The alias for at query.
|
| |
|
| bool | empty () const |
| | Checks if B is empty.
|
| |
|
uint64_t | size () const |
| | Return |B|.
|
| |
|
uint64_t | height () const |
| | Return the height of the internal tree storing the bit sequence B.
|
| |
| uint64_t | size_in_bytes (bool only_dynamic_memory=false) const |
| | Return the total memory usage in bytes.
|
| |
|
double | density () const |
| | Return the density of the internal tree.
|
| |
|
|
std::vector< uint64_t > | to_packed_vector () const |
| | Return B as a packed vector of uint64_t (i.e., the length of the vector is |B| / 64).
|
| |
|
std::string | to_string () const |
| | Return B as a binary string.
|
| |
|
std::vector< bool > | to_vector () const |
| | Return B as a vector of bool.
|
| |
|
| bool | at (uint64_t i) const |
| | Return B[i].
|
| |
| int64_t | one_based_rank1 (uint64_t i) const |
| | Returns the number of 1 in B[0..i-1].
|
| |
| int64_t | one_based_rank0 (uint64_t i) const |
| | Returns the number of 0 in B[0..i-1].
|
| |
| int64_t | one_based_rank (uint64_t i, bool c) const |
| | Returns the number of c in B[0..i-1].
|
| |
| int64_t | select1 (uint64_t i) const |
| | Returns the position p of the (i+1)-th 1 in B if such a position exists, otherwise returns -1.
|
| |
| int64_t | select0 (uint64_t i) const |
| | Returns the position p of the (i+1)-th 0 in B if such a position exists, otherwise returns -1.
|
| |
| int64_t | select (uint64_t i, bool c) const |
| | Returns the position p of the (i+1)-th c in B if such a position exists, otherwise returns -1.
|
| |
| int64_t | count1 () const |
| | Return the number of 1 in B[0..n-1].
|
| |
| int64_t | count0 () const |
| | Return the number of 0 in B[0..n-1].
|
| |
| int64_t | count_c (bool c) const |
| | Return the number of c in B[0..n-1].
|
| |
| uint64_t | psum (uint64_t i) const |
| | Returns the number of 1s in the bit sequence B[0..i].
|
| |
| uint64_t | psum () const |
| | Returns the number of 1s in the bit sequence B[0..n-1].
|
| |
| int64_t | search (uint64_t x) const |
| | Returns the first position p such that psum(p) >= x if such a position exists, otherwise returns -1.
|
| |
|
|
void | swap (DynamicBitSequence &item) |
| | Swap operation.
|
| |
|
void | clear () |
| | Clear the elements in B.
|
| |
| void | push_back (bool value) |
| | Adds a bit to the end of the sequence B.
|
| |
| void | push_many (const std::vector< bool > &items_Q) |
| | Add a given sequence Q[0..k-1] to the end of S[0..n-1] (i.e., S = S[0..n-1]Q[0..k-1])
|
| |
| void | push_front (bool value) |
| | Adds a bit to the beginning of the sequence B.
|
| |
| void | insert (uint64_t p, bool v) |
| | Insert a bit v at the position p in the bits B.
|
| |
| void | remove (uint64_t p) |
| | Removes the bit at the position p in the bits B.
|
| |
| void | set_bit (uint64_t i, bool b) |
| | Replace the bit B[i] with the bit b.
|
| |
| void | set_bits (uint64_t i, std::vector< bool > &bits) |
| | Replace the bits B[i..i+m-1] with the bits bits[0..m-1].
|
| |
| void | sort_leaf_containers () |
| | Sorts the leaf containers of the internal tree.
|
| |
|
|
void | print_debug_info () const |
| | Print debug information about this instance.
|
| |
| std::vector< std::string > | get_memory_usage_info (int message_paragraph=stool::Message::SHOW_MESSAGE) const |
| | Return the memory usage information of this data structure as a vector of strings.
|
| |
| void | print_memory_usage (int message_paragraph=stool::Message::SHOW_MESSAGE) const |
| | Print the memory usage information of this data structure.
|
| |
| void | print_statistics (int message_paragraph=stool::Message::SHOW_MESSAGE) const |
| | Print the statistics of this data structure.
|
| |
| void | print_information_about_performance (int message_paragraph=stool::Message::SHOW_MESSAGE) const |
| | Print the performance information of this data structure.
|
| |
| void | print_content (std::string name="DynamicBitSequence", int message_paragraph=stool::Message::SHOW_MESSAGE) const |
| | Print the bit sequence B.
|
| |
|
void | verify () const |
| | Verify the internal consistency of this data structure.
|
| |
template<typename CONTAINER, typename CONTAINER_ITERATOR, uint64_t MAX_TREE_DEGREE, uint64_t MAX_BIT_CONTAINER_SIZE>
class stool::bptree::DynamicBitSequence< CONTAINER, CONTAINER_ITERATOR, MAX_TREE_DEGREE, MAX_BIT_CONTAINER_SIZE >
A dynamic data structure supporting rank and select queries on a bit sequence B[0..n-1].