7#include "../bp_tree/bp_tree.hpp"
8#include "./bit_container.hpp"
10#include "./bit_forward_iterator.hpp"
11#include "./bit_deque_container.hpp"
12#include "stool/include/light_stool.hpp"
22 template <
typename CONTAINER,
typename CONTAINER_ITERATOR, u
int64_t MAX_TREE_DEGREE, u
int64_t MAX_BIT_CONTAINER_SIZE>
30 static inline constexpr int DEFAULT_CONTAINER_DEGREE = 62;
75 return this->tree.
size();
79 return this->tree.
height();
104 return this->tree.
empty();
114 return this->tree.
at(
pos) & 1;
138 throw std::range_error(
"Error: DynamicBitSequence::rank1()");
149 return i - this->
rank1(i);
234 return this->
rank(_size,
c);
245 return this->
rank0(_size);
250 int64_t count1()
const{
251 uint64_t _size = this->
size();
253 return this->
rank1(_size);
276 return this->tree.
psum(
x);
285 return this->tree.
psum();
311 this->tree.
initialize(
degree, DynamicBitSequence::DEFAULT_CONTAINER_DEGREE);
382 bool b1 = this->
at(i);
396 void set_bits(
uint64_t i, std::vector<bool> &bits){
410 std::cout <<
"unsorted" << std::endl;
424 void print_debug_info()
const{
425 std::cout <<
"DynamicBitSequence::print_debug_info()" << std::endl;
426 this->tree.print_debug_info();
445 std::vector<std::string>
r;
451 +
" bytes, " + std::to_string(
size) +
" elements, " + std::to_string(
bits_per_element) +
" bytes per element =");
452 for (std::string &
s :
log1)
467 for (std::string &
s :
log)
469 std::cout <<
s << std::endl;
479 std::cout << stool::Message::get_paragraph_string(
message_paragraph) <<
"Statistics(DynamicBitSequence):" << std::endl;
481 std::cout << stool::Message::get_paragraph_string(
message_paragraph) <<
"[END]" << std::endl;
490 std::cout << stool::Message::get_paragraph_string(
message_paragraph) <<
"Content(DynamicBitSequence):" << std::endl;
492 std::cout << stool::Message::get_paragraph_string(
message_paragraph) <<
"[END]" << std::endl;
518 std::vector<uint64_t>
r;
568 bool b = stool::MSBByte::get_bit(bits, i);
707 s +=
"DynamicSequence(";
708 s += CONTAINER::name();
713 void print_information_about_performance(
int message_paragraph = stool::Message::SHOW_MESSAGE)
const{
714 std::cout << stool::Message::get_paragraph_string(
message_paragraph) <<
"Performance Information (DynamicSequence)[" << std::endl;
716 std::cout << stool::Message::get_paragraph_string(
message_paragraph) <<
"]" << std::endl;
719 double density()
const{
720 return this->tree.get_value_density();
737 using DynamicBitDequeSequence = DynamicBitSequence<BDC, BDC::BitVectorContainerIterator, bptree::DEFAULT_MAX_DEGREE_OF_INTERNAL_NODE, 1024>;
739 using SimpleDynamicBitSequence = DynamicBitSequence<BDC, BDC::BitVectorContainerIterator, 62, 8192>;