b-tree-plus-alpha
Loading...
Searching...
No Matches
dynamic_bit_sequence.hpp
Go to the documentation of this file.
1
6#pragma once
7#include "./bp_tree.hpp"
8#include "./sequence/bit_container.hpp"
9#include "./sequence/bit_forward_iterator.hpp"
10#include "./sequence/bit_deque_container.hpp"
11#include "stool/include/all.hpp"
12namespace stool
13{
14 namespace bptree
15 {
16
22 template <typename CONTAINER, typename CONTAINER_ITERATOR, uint64_t MAX_TREE_DEGREE, uint64_t MAX_BIT_CONTAINER_SIZE>
24 {
25
27 using T = uint64_t;
29
30 static inline constexpr int DEFAULT_CONTAINER_DEGREE = 62;
31 // static inline constexpr int DEFAULT_CONTAINER_DEGREE = 124;
32 Tree tree;
33
34 public:
38
39
44 {
45 }
46
54 DynamicBitSequence(DynamicBitSequence &&) noexcept = default;
55
57
61
62
65 BitForwardIterator<CONTAINER, CONTAINER_ITERATOR, MAX_TREE_DEGREE, MAX_BIT_CONTAINER_SIZE> get_bit_forward_iterator_begin() const
66 {
67 auto leaf_it = this->tree.get_leaf_forward_iterator_begin();
69 }
70
79
83
84
88
93
97 bool operator[](uint64_t i) const
98 {
99 return this->at(i);
100 }
101
103
107
108
112 bool empty() const
113 {
114 return this->tree.empty();
115 }
116
120 uint64_t size() const
121 {
122 return this->tree.size();
123 }
124
128 uint64_t height() const
129 {
130 return this->tree.height();
131 }
136 uint64_t size_in_bytes(bool only_dynamic_memory = false) const
137 {
138 return this->tree.size_in_bytes(only_dynamic_memory);
139 }
143 double density() const
144 {
145 return this->tree.get_value_density();
146 }
147
149
153
154
157 std::vector<uint64_t> to_packed_vector() const
158 {
159 auto vec = this->tree.to_value_vector();
160 std::vector<uint64_t> r;
161 r.resize(vec.size());
162 for (uint64_t i = 0; i < vec.size(); i++)
163 {
164 r[i] = vec[i];
165 }
166 return r;
167 }
168
172 std::string to_string() const
173 {
174 std::string s;
175 std::vector<uint64_t> bits = this->to_packed_vector();
176 s.push_back('[');
177 for (uint64_t i = 0; i < bits.size(); i++)
178 {
179 s.push_back(bits[i] >= 1 ? '1' : '0');
180 // assert(bits[i] == this->at(i));
181 }
182 s.push_back(']');
183 return s;
184 }
185
189 std::vector<bool> to_vector() const
190 {
191 uint64_t _size = this->size();
192 std::vector<bool> r;
193 r.resize(_size, false);
194 uint64_t counter = 0;
195
196 auto _end = this->get_leaf_forward_iterator_end();
197
199 while (!it.is_end())
200 {
201 uint64_t bits = *it;
202 uint64_t i = 0;
203
204 while (i < 64 && counter < _size)
205 {
206 bool b = stool::MSBByte::get_bit(bits, i);
207 r[counter] = b;
208
209 counter++;
210 i++;
211 }
212 ++it;
213 }
214
215 assert(counter == _size);
216 return r;
217 }
219
223
224
229 bool at(uint64_t i) const
230 {
231 return this->tree.at(i) & 1;
232 }
233
238 int64_t one_based_rank1(uint64_t i) const
239 {
240 if (i == 0)
241 {
242 return 0;
243 }
244 else if (i <= this->size())
245 {
246 uint64_t p = this->tree.psum(i - 1);
247
248 return p;
249 }
250 else
251 {
252 assert(false);
253 throw std::range_error("Error: DynamicBitSequence::rank1()");
254 }
255 }
256
261 int64_t one_based_rank0(uint64_t i) const
262 {
263 return i - this->one_based_rank1(i);
264 }
265
270 int64_t one_based_rank(uint64_t i, bool c) const
271 {
272 return c ? this->one_based_rank1(i) : this->one_based_rank0(i);
273 }
274
279 int64_t select1(uint64_t i) const
280 {
281 int64_t p = this->tree.search(i + 1);
282 if (p == -1)
283 {
284 return p;
285 }
286 else
287 {
288 if (p >= (int64_t)this->size())
289 {
290 return -1;
291 }
292 else
293 {
294 return p;
295 }
296 }
297 }
298
303 int64_t select0(uint64_t i) const
304 {
305 int64_t p = this->tree.select0(i);
306 if (p == -1)
307 {
308 return p;
309 }
310 else
311 {
312 if (p >= (int64_t)this->size())
313 {
314 return -1;
315 }
316 else
317 {
318 return p;
319 }
320 }
321 }
322
327 int64_t select(uint64_t i, bool c) const
328 {
329 return c ? this->select1(i) : this->select0(i);
330 }
331
336 int64_t count1() const
337 {
338 uint64_t _size = this->size();
339 if (_size > 0)
340 {
341 return this->one_based_rank1(_size);
342 }
343 else
344 {
345 return 0;
346 }
347 }
348
353 int64_t count0() const
354 {
355 uint64_t _size = this->size();
356 if (_size > 0)
357 {
358 return this->one_based_rank0(_size);
359 }
360 else
361 {
362 return 0;
363 }
364 }
365
370 int64_t count_c(bool c) const
371 {
372 uint64_t _size = this->size();
373 if (_size > 0)
374 {
375 return this->one_based_rank(_size, c);
376 }
377 else
378 {
379 return 0;
380 }
381 }
382
387 uint64_t psum(uint64_t i) const
388 {
389 return this->tree.psum(i);
390 }
391
396 uint64_t psum() const
397 {
398 return this->tree.psum();
399 }
400
405 int64_t search(uint64_t x) const
406 {
407 return this->tree.search(x);
408 }
409
411
415
416
421 {
422 this->tree.swap(item.tree);
423 }
424
428 void clear()
429 {
430 this->tree.clear();
431 }
432
437 void push_back(bool value)
438 {
439#if DEBUG
440 uint64_t p = this->size();
441#endif
442 this->tree.push_back(value);
443#if DEBUG
444 assert(p + 1 == this->size());
445#endif
446 }
447
452 void push_many(const std::vector<bool> &items_Q)
453 {
454 this->tree.push_many(items_Q);
455 }
456
461 void push_front(bool value)
462 {
463 this->tree.push_front(value);
464 }
465
470 void insert(uint64_t p, bool v)
471 {
472 this->tree.insert(p, v, v);
473 }
474
479 void remove(uint64_t p)
480 {
481 if (p < this->size())
482 {
483 this->tree.remove(p);
484 }
485 else
486 {
487 throw std::range_error("Error: DynamicBitSequence::remove(p)");
488 }
489 }
490
495 void set_bit(uint64_t i, bool b)
496 {
497 bool b1 = this->at(i);
498 if (b != b1)
499 {
500 if (b)
501 {
502 this->tree.increment(i, 1);
503 }
504 else
505 {
506 this->tree.increment(i, -1);
507 }
508 }
509 }
510
515 void set_bits(uint64_t i, std::vector<bool> &bits)
516 {
517 for (uint64_t j = 0; j < bits.size(); j++)
518 {
519 this->set_bit(i + j, bits[j]);
520 }
521 }
522
528 {
529 bool b = this->tree.check_if_leaf_container_vec_is_sorted();
530 if (!b)
531 {
532 std::cout << "unsorted" << std::endl;
533 this->tree.sort_leaf_containers();
534 }
535 }
536
538
542
543
547 void print_debug_info() const
548 {
549 std::cout << "DynamicBitSequence::print_debug_info()" << std::endl;
550 this->tree.print_debug_info();
551 }
552
557 std::vector<std::string> get_memory_usage_info(int message_paragraph = stool::Message::SHOW_MESSAGE) const
558 {
559 std::vector<std::string> log1 = this->tree.get_memory_usage_info(message_paragraph + 1);
560
561 std::vector<std::string> r;
562 uint64_t size_in_bytes = this->size_in_bytes();
563 uint64_t size = this->size();
564 double bits_per_element = size > 0 ? ((double)size_in_bytes / (double)size) : 0;
565
566 r.push_back(stool::Message::get_paragraph_string(message_paragraph) + "=DynamicBitSequence: " + std::to_string(this->size_in_bytes()) + " bytes, " + std::to_string(size) + " elements, " + std::to_string(bits_per_element) + " bytes per element =");
567 for (std::string &s : log1)
568 {
569 r.push_back(s);
570 }
571 r.push_back(stool::Message::get_paragraph_string(message_paragraph) + "==");
572 return r;
573 }
574
579 void print_memory_usage(int message_paragraph = stool::Message::SHOW_MESSAGE) const
580 {
581 std::vector<std::string> log = this->get_memory_usage_info(message_paragraph);
582 for (std::string &s : log)
583 {
584 std::cout << s << std::endl;
585 }
586 }
587
592 void print_statistics(int message_paragraph = stool::Message::SHOW_MESSAGE) const
593 {
594 std::cout << stool::Message::get_paragraph_string(message_paragraph) << "Statistics(DynamicBitSequence):" << std::endl;
595 this->tree.print_statistics(message_paragraph + 1);
596 std::cout << stool::Message::get_paragraph_string(message_paragraph) << "[END]" << std::endl;
597 }
598
603 void print_information_about_performance(int message_paragraph = stool::Message::SHOW_MESSAGE) const
604 {
605 std::cout << stool::Message::get_paragraph_string(message_paragraph) << "Performance Information (DynamicSequence)[" << std::endl;
606 this->tree.print_information_about_performance(message_paragraph + 1);
607 std::cout << stool::Message::get_paragraph_string(message_paragraph) << "]" << std::endl;
608 }
609
615 void print_content(std::string name = "DynamicBitSequence", int message_paragraph = stool::Message::SHOW_MESSAGE) const
616 {
617 std::cout << stool::Message::get_paragraph_string(message_paragraph) << name << ": " << this->to_string() << std::endl;
618 }
619
623 void verify() const
624 {
625 this->tree.verify();
626 }
627
629
633
634
635
639 static DynamicBitSequence build(const std::vector<bool> &items)
640 {
642 r.tree.initialize();
643 r.tree.build(items);
644 return r;
645 }
646
650 static DynamicBitSequence load_from_bytes(const std::vector<uint8_t> &data, uint64_t &pos)
651 {
653 Tree tree = Tree::load_from_bytes(data, pos);
654 r.tree.swap(tree, false);
655 return r;
656 }
657
661 static DynamicBitSequence load_from_file(std::ifstream &ifs)
662 {
664 Tree tree = Tree::load_from_file(ifs);
665 r.tree.swap(tree, false);
666 return r;
667 }
668
669
673 static void store_to_bytes(DynamicBitSequence &item, std::vector<uint8_t> &output, uint64_t &pos)
674 {
675 Tree::store_to_bytes(item.tree, output, pos);
676 }
677
681 static void store_to_file(DynamicBitSequence &item, std::ofstream &os)
682 {
683 Tree::store_to_file(item.tree, os);
684 }
685
686
688
692
693
696 static std::string name()
697 {
698 std::string s;
699 s += "DynamicSequence(";
700 s += CONTAINER::name();
701 s += ")";
702 return s;
703 }
705 };
706
708
709 using DynamicBitDequeSequence = DynamicBitSequence<BDC, BDC::BitVectorContainerIterator, bptree::DEFAULT_MAX_DEGREE_OF_INTERNAL_NODE, 1024>;
710 // using SimpleDynamicBitSequence = DynamicBitSequence<BDC, BDC::BitVectorContainerIterator, 62, 8192>;
711 using SimpleDynamicBitSequence = DynamicBitSequence<BDC, BDC::BitVectorContainerIterator, 62, 8192>;
712
713 /*
714 using DynamicBitDequeSequenceA = DynamicBitSequence<BDC, BDC::BitVectorContainerIterator, 62, 512>;
715 using DynamicBitDequeSequenceB = DynamicBitSequence<BDC, BDC::BitVectorContainerIterator, 62, 1024>;
716 using DynamicBitDequeSequenceC = DynamicBitSequence<BDC, BDC::BitVectorContainerIterator, 62, 2048>;
717 using DynamicBitDequeSequenceD = DynamicBitSequence<BDC, BDC::BitVectorContainerIterator, 62, 4096>;
718
719 using DynamicBitDequeSequence1 = DynamicBitSequence<BDC, BDC::BitVectorContainerIterator, 14, 8192>;
720 using DynamicBitDequeSequence2 = DynamicBitSequence<BDC, BDC::BitVectorContainerIterator, 30, 8192>;
721 using DynamicBitDequeSequence3 = DynamicBitSequence<BDC, BDC::BitVectorContainerIterator, 62, 8192>;
722 using DynamicBitDequeSequence4 = DynamicBitSequence<BDC, BDC::BitVectorContainerIterator, 126, 8192>;
723 */
724
725 // using DynamicBitDequeSequenceE = DynamicBitSequence<stool::bptree::BitVectorContainer, stool::bptree::BitVectorContainer::BitVectorContainerIterator, 8190, 2048>;
726
727 // template <typename T>
728 // using VLCDequeSeq = DynamicSequence<VLCDeque, T>;
729 }
730
731}
A pointer to a node of BPTree [Unchecked AI's Comment].
Definition bp_node_pointer.hpp:14
std::vector< VALUE > to_value_vector() const
Return the values S[0..n-1] as a vector of VALUE.
Definition bp_tree.hpp:403
void build(const std::vector< VALUE > &_values)
Builds the B+ tree so that S[0..n-1] = _values[0..n-1].
Definition bp_tree.hpp:1491
void insert(uint64_t i, VALUE v, uint64_t weight_w)
Insert a given value v with weight w at position i in the sequence S.
Definition bp_tree.hpp:1275
static void store_to_bytes(BPTree &item, std::vector< uint8_t > &output, uint64_t &pos)
Save the given instance item to a byte vector output at the position pos.
Definition bp_tree.hpp:1554
static void store_to_file(BPTree &item, std::ofstream &os)
Save the given instance item to a file stream os.
Definition bp_tree.hpp:1581
void print_statistics(int message_paragraph=stool::Message::SHOW_MESSAGE) const
Print the statistics of this data structure.
Definition bp_tree.hpp:971
void increment(uint64_t i, int64_t delta)
Update S[i] and its weight using a given value delta and the increment function supported by the LEAF...
Definition bp_tree.hpp:1332
bool check_if_leaf_container_vec_is_sorted() const
Checks if the leaf containers are sorted in the vector W, i.e., W[i] is the leaf container of the i-t...
Definition bp_tree.hpp:758
bool empty() const
Return true if n = 0, false otherwise.
Definition bp_tree.hpp:353
void swap(BPTree &_tree, bool swap_linked_tree=true)
Swap operation.
Definition bp_tree.hpp:1087
static BPTree load_from_file(std::ifstream &ifs)
Returns the BPTree instance loaded from a file stream ifs.
Definition bp_tree.hpp:1536
VALUE at(uint64_t i) const
Return B[i].
Definition bp_tree.hpp:440
void push_back(VALUE value)
Push a given value to the end of the sequence S.
Definition bp_tree.hpp:1154
uint64_t size_in_bytes(bool only_dynamic_memory=false) const
Returns the total memory size of this B+-tree.
Definition bp_tree.hpp:377
void initialize()
Initializes this instance.
Definition bp_tree.hpp:1063
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.
Definition bp_tree.hpp:789
int64_t search(uint64_t u) const
Return the smallest index i such that psum(i) >= u if it exists, otherwise return -1.
Definition bp_tree.hpp:572
LeafForwardIterator get_leaf_forward_iterator_begin() const
Return an iterator pointing to the first leaf in forward traversal.
Definition bp_tree.hpp:231
uint64_t size() const
Return the number of values stored in this tree (i.e., n).
Definition bp_tree.hpp:282
bool verify() const
Verify the internal consistency of this data structure.
Definition bp_tree.hpp:1040
void push_front(VALUE value)
Push a given value to the beginning of the sequence S.
Definition bp_tree.hpp:1189
int64_t select0(uint64_t i) const
Returns the position of the (i+1)-th 0 in S[0..n-1] if it exists, otherwise return -1.
Definition bp_tree.hpp:596
static BPTree load_from_bytes(const std::vector< uint8_t > &data, uint64_t &pos)
Returns the BPTree instance loaded from a byte vector data at the position pos.
Definition bp_tree.hpp:1515
void remove(uint64_t i)
Remove S[i] from the sequence S.
Definition bp_tree.hpp:1255
void push_many(const std::vector< VALUE > &values_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])
Definition bp_tree.hpp:1164
void clear()
Clear the B+-tree and reset it to an empty state (i.e., n = 0, x = 0, y = 0).
Definition bp_tree.hpp:1110
void print_debug_info() const
Print debug information about this instance.
Definition bp_tree.hpp:1024
uint64_t psum() const
Return the sum of the weights of S[0..n-1].
Definition bp_tree.hpp:521
void sort_leaf_containers()
Sorts the leaf containers so that each W[i] is the LEAF CONTAINER of the i-th leaf.
Definition bp_tree.hpp:1410
uint64_t height() const
Return the height of this tree.
Definition bp_tree.hpp:329
void print_information_about_performance(int message_paragraph=stool::Message::SHOW_MESSAGE) const
Print the performance information of this data structure.
Definition bp_tree.hpp:947
double get_value_density() const
Return the density of this tree (i.e., n / capacity()).
Definition bp_tree.hpp:313
A forward iterator for traversing the bits stored in a BP-tree. [Unchecked AI's Comment].
Definition bit_forward_iterator.hpp:16
A container that stores a short sequence of bits. [Unchecked AI's Comment].
Definition bit_deque_container.hpp:14
A dynamic data structure supporting rank and select queries on a bit sequence B[0....
Definition dynamic_bit_sequence.hpp:24
uint64_t size_in_bytes(bool only_dynamic_memory=false) const
Return the total memory usage in bytes.
Definition dynamic_bit_sequence.hpp:136
DynamicBitSequence()
Default constructor with |B| = 0.
Definition dynamic_bit_sequence.hpp:43
DynamicBitSequence(DynamicBitSequence &&) noexcept=default
Default move constructor.
uint64_t psum() const
Returns the number of 1s in the bit sequence B[0..n-1].
Definition dynamic_bit_sequence.hpp:396
static void store_to_file(DynamicBitSequence &item, std::ofstream &os)
Save the given instance item to a file stream os.
Definition dynamic_bit_sequence.hpp:681
std::vector< bool > to_vector() const
Return B as a vector of bool.
Definition dynamic_bit_sequence.hpp:189
uint64_t psum(uint64_t i) const
Returns the number of 1s in the bit sequence B[0..i].
Definition dynamic_bit_sequence.hpp:387
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.
Definition dynamic_bit_sequence.hpp:279
int64_t one_based_rank0(uint64_t i) const
Returns the number of 0 in B[0..i-1].
Definition dynamic_bit_sequence.hpp:261
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.
Definition dynamic_bit_sequence.hpp:327
double density() const
Return the density of the internal tree.
Definition dynamic_bit_sequence.hpp:143
bool empty() const
Checks if B is empty.
Definition dynamic_bit_sequence.hpp:112
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].
Definition dynamic_bit_sequence.hpp:515
void insert(uint64_t p, bool v)
Insert a bit v at the position p in the bits B.
Definition dynamic_bit_sequence.hpp:470
void set_bit(uint64_t i, bool b)
Replace the bit B[i] with the bit b.
Definition dynamic_bit_sequence.hpp:495
void print_content(std::string name="DynamicBitSequence", int message_paragraph=stool::Message::SHOW_MESSAGE) const
Print the bit sequence B.
Definition dynamic_bit_sequence.hpp:615
static DynamicBitSequence build(const std::vector< bool > &items)
Build a new DynamicBitSequence from a given sequence items.
Definition dynamic_bit_sequence.hpp:639
void swap(DynamicBitSequence &item)
Swap operation.
Definition dynamic_bit_sequence.hpp:420
bool at(uint64_t i) const
Return B[i].
Definition dynamic_bit_sequence.hpp:229
int64_t count_c(bool c) const
Return the number of c in B[0..n-1].
Definition dynamic_bit_sequence.hpp:370
std::string to_string() const
Return B as a binary string.
Definition dynamic_bit_sequence.hpp:172
DynamicBitSequence & operator=(DynamicBitSequence &&) noexcept=default
Default move assignment operator.
DynamicBitSequence(const DynamicBitSequence &)=delete
Deleted copy constructor.
void push_back(bool value)
Adds a bit to the end of the sequence B.
Definition dynamic_bit_sequence.hpp:437
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).
Definition dynamic_bit_sequence.hpp:157
static DynamicBitSequence load_from_file(std::ifstream &ifs)
Returns the DynamicBitSequence instance loaded from a file stream ifs.
Definition dynamic_bit_sequence.hpp:661
DynamicBitSequence & operator=(const DynamicBitSequence &)=delete
Deleted copy assignment operator.
void print_debug_info() const
Print debug information about this instance.
Definition dynamic_bit_sequence.hpp:547
static void store_to_bytes(DynamicBitSequence &item, std::vector< uint8_t > &output, uint64_t &pos)
Save the given instance item to a byte vector output at the position pos.
Definition dynamic_bit_sequence.hpp:673
void print_memory_usage(int message_paragraph=stool::Message::SHOW_MESSAGE) const
Print the memory usage information of this data structure.
Definition dynamic_bit_sequence.hpp:579
uint64_t size() const
Return |B|.
Definition dynamic_bit_sequence.hpp:120
int64_t one_based_rank1(uint64_t i) const
Returns the number of 1 in B[0..i-1].
Definition dynamic_bit_sequence.hpp:238
int64_t count1() const
Return the number of 1 in B[0..n-1].
Definition dynamic_bit_sequence.hpp:336
static DynamicBitSequence load_from_bytes(const std::vector< uint8_t > &data, uint64_t &pos)
Returns the DynamicBitSequence instance loaded from a byte vector data at the position pos.
Definition dynamic_bit_sequence.hpp:650
void print_statistics(int message_paragraph=stool::Message::SHOW_MESSAGE) const
Print the statistics of this data structure.
Definition dynamic_bit_sequence.hpp:592
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.
Definition dynamic_bit_sequence.hpp:303
void verify() const
Verify the internal consistency of this data structure.
Definition dynamic_bit_sequence.hpp:623
void print_information_about_performance(int message_paragraph=stool::Message::SHOW_MESSAGE) const
Print the performance information of this data structure.
Definition dynamic_bit_sequence.hpp:603
void clear()
Clear the elements in B.
Definition dynamic_bit_sequence.hpp:428
uint64_t height() const
Return the height of the internal tree storing the bit sequence B.
Definition dynamic_bit_sequence.hpp:128
void push_front(bool value)
Adds a bit to the beginning of the sequence B.
Definition dynamic_bit_sequence.hpp:461
static std::string name()
Return the name of the DynamicBitSequence for debugging.
Definition dynamic_bit_sequence.hpp:696
int64_t one_based_rank(uint64_t i, bool c) const
Returns the number of c in B[0..i-1].
Definition dynamic_bit_sequence.hpp:270
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.
Definition dynamic_bit_sequence.hpp:405
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.
Definition dynamic_bit_sequence.hpp:65
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.
Definition dynamic_bit_sequence.hpp:557
int64_t count0() const
Return the number of 0 in B[0..n-1].
Definition dynamic_bit_sequence.hpp:353
void sort_leaf_containers()
Sorts the leaf containers of the internal tree.
Definition dynamic_bit_sequence.hpp:527
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])
Definition dynamic_bit_sequence.hpp:452
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.
Definition dynamic_bit_sequence.hpp:74
void remove(uint64_t p)
Removes the bit at the position p in the bits B.
Definition dynamic_bit_sequence.hpp:479