A dynamic data structure supporting prefix-sum query on a unsigned 64-bit integer sequence S[0..n-1].
More...
|
|
|
| DynamicPrefixSum () |
| | Default constructor with |S| = 0.
|
| |
|
| DynamicPrefixSum (const std::vector< uint64_t > &S_) |
| | Default constructor with S = S_.
|
| |
|
| DynamicPrefixSum (DynamicPrefixSum &&) noexcept=default |
| | Default move constructor.
|
| |
|
|
Tree::ValueForwardIterator | begin () const |
| | Returns an iterator to the beginning of the sequence S.
|
| |
|
Tree::ValueForwardIterator | end () const |
| | Returns an iterator to the end of the sequence S.
|
| |
|
|
DynamicPrefixSum & | operator= (const DynamicPrefixSum &)=delete |
| | Deleted copy assignment operator.
|
| |
|
DynamicPrefixSum & | operator= (DynamicPrefixSum &&) noexcept=default |
| | Default move assignment operator.
|
| |
|
uint64_t | operator[] (uint64_t i) const |
| | The alias for at query.
|
| |
|
|
Tree & | __get_tree () |
| | Get the internal tree storing the sequence S.
|
| |
|
uint64_t | get_degree () const |
| | Return the maximum degree of internal nodes of the internal tree storing the sequence S.
|
| |
|
uint64_t | size () const |
| | Return |S|.
|
| |
| uint64_t | size_in_bytes (bool only_dynamic_memory=false) const |
| | Returns the total memory usage in bytes.
|
| |
|
double | density () const |
| | Return the density of the internal tree.
|
| |
|
|
std::vector< uint64_t > | to_vector () const |
| | Return S as a vector.
|
| |
|
std::vector< uint8_t > | to_u8_vector () const |
| | Return S as a vector of uint8_t.
|
| |
|
std::string | to_string () const |
| | Return S as a string.
|
| |
|
| uint64_t | at (uint64_t i) const |
| | Return the (i+1)-th element of S[i].
|
| |
| uint64_t | psum () const |
| | Return the sum of S[0..n-1].
|
| |
| uint64_t | psum (uint64_t i) const |
| | Return the sum of the first (i+1) values of S[0..n-1].
|
| |
| uint64_t | psum (uint64_t i, uint64_t j) const |
| | Return the sum of S[i..j].
|
| |
| uint64_t | reverse_psum (uint64_t i) const |
| | Returns the sum of integers in S[(n-1)-i..n-1].
|
| |
|
int64_t | search (uint64_t x) const |
| | Return the smallest i such that psum(i) >= x if such a position exists, otherwise returns -1.
|
| |
| int64_t | predecessor_index (uint64_t x) const |
| | Return the largest i such that psum(i) <= x if such a position exists, otherwise returns -1.
|
| |
| int64_t | successor_index (uint64_t x) const |
| | Return the smallest i such that psum(i) >= x if such a position exists, otherwise returns -1.
|
| |
|
| void | set_value (uint64_t i, uint64_t value) |
| | Set a given value v at a given position i in S.
|
| |
| void | set_values (uint64_t i, const std::vector< uint64_t > &values_Q) |
| | Replaces the |Q| values S[i..i+|Q|-1] with the given values Q[0..|Q|-1].
|
| |
| void | increment (uint64_t i, int64_t delta) |
| | Set the value S[i+delta] at a given position i in S.
|
| |
| void | decrement (uint64_t i, int64_t delta) |
| | Set the value S[i-delta] at a given position i in S.
|
| |
|
void | swap (DynamicPrefixSum &item) |
| | Swap operation.
|
| |
|
void | clear () |
| | Clear the elements in S.
|
| |
| void | push_back (uint64_t value) |
| | Add a given integer to the end of S.
|
| |
| void | push_back_many (const std::vector< uint64_t > &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_many (const std::vector< uint64_t > &items) |
| | Alias for push_back_many.
|
| |
| void | push_front (uint64_t value) |
| | Add a given value to the beginning of S.
|
| |
| void | pop_back () |
| | Remove the last element from S.
|
| |
| void | pop_front () |
| | Remove the first element from S.
|
| |
| void | insert (uint64_t pos, uint64_t value) |
| | Insert a given integer value into S as the (pos+1)-th element.
|
| |
| void | remove (uint64_t pos) |
| | Remove the element at the position pos from S and return it.
|
| |
|
| 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_tree (int message_paragraph=stool::Message::SHOW_MESSAGE) const |
| | Print the form of the internal tree of this data structure.
|
| |
|
void | print_info () const |
| | Print the statistics of this data structure.
|
| |
|
void | verify () const |
| | Verify the internal consistency of this data structure.
|
| |
template<typename LEAF_CONTAINER = VLCDeque, uint64_t TREE_DEGREE = bptree::DEFAULT_MAX_DEGREE_OF_INTERNAL_NODE, uint64_t LEAF_CONTAINER_MAX_SIZE = bptree::DEFAULT_MAX_COUNT_OF_VALUES_IN_LEAF>
class stool::bptree::DynamicPrefixSum< LEAF_CONTAINER, TREE_DEGREE, LEAF_CONTAINER_MAX_SIZE >
A dynamic data structure supporting prefix-sum query on a unsigned 64-bit integer sequence S[0..n-1].