9#ifndef INCLUDED_SDSL_SORTED_MULTI_STACK_SUPPORT
10#define INCLUDED_SDSL_SORTED_MULTI_STACK_SUPPORT
95 void load(std::istream & in);
96 template <
typename archive_t>
98 template <
typename archive_t>
107 m_duplication_stack()
123 if (0 == ((m_stack[bn] >> block_pos(x)) & 1))
125 m_stack[bn] ^= (1ULL << block_pos(x));
126 if (bn > 0 and m_stack[bn - 1] == 0)
128 m_stack[bn - 1] = 0x8000000000000000ULL | m_top;
139 m_duplication_stack[m_cnt >> 6] ^= (1ULL << (m_cnt & 0x3F));
150 if ((m_duplication_stack[m_cnt >> 6] >> (m_cnt & 0x3F)) & 1)
152 m_duplication_stack[m_cnt >> 6] ^= (1ULL << (m_cnt & 0x3F));
158 uint64_t w = m_stack[bn];
159 assert((w >> 63) == 0);
160 w ^= (1ULL << block_pos(m_top));
173 m_top = (bn - 1) * 63 +
bits::hi(w);
178 m_top = w & 0x7FFFFFFFFFFFFFFFULL;
195 written_bytes += m_stack.serialize(out);
196 written_bytes += m_duplication_stack.serialize(out);
198 return written_bytes;
207 m_duplication_stack.load(in);
210template <
typename archive_t>
220template <
typename archive_t>
bits.hpp contains the sdsl::bits class.
cereal.hpp offers cereal support
#define CEREAL_LOAD_FUNCTION_NAME
#define CEREAL_SAVE_FUNCTION_NAME
A generic vector class for integers of width .
int_vector_size_type size_type
int_vector< 64 >::size_type size_type
size_type size() const
Returns the number of element is the stack.
void CEREAL_LOAD_FUNCTION_NAME(archive_t &ar)
sorted_multi_stack_support(sorted_multi_stack_support &&)=default
sorted_multi_stack_support(size_type n)
Constructor.
sorted_multi_stack_support(sorted_multi_stack_support const &)=default
void CEREAL_SAVE_FUNCTION_NAME(archive_t &ar) const
sorted_multi_stack_support & operator=(sorted_multi_stack_support const &)=default
size_type serialize(std::ostream &out, structure_tree_node *v=nullptr, std::string name="") const
void load(std::istream &in)
bool empty() const
Returns if the stack is empty.
size_type top() const
Returns the topmost index on the stack.
sorted_multi_stack_support & operator=(sorted_multi_stack_support &&)=default
bool pop()
Pop the topmost index of the stack.
bool push(size_type x)
Push the index x of vector vec onto the stack.
static structure_tree_node * add_child(structure_tree_node *v, std::string const &name, std::string const &type)
static void add_size(structure_tree_node *v, uint64_t value)
int_vector.hpp contains the sdsl::int_vector class.
io.hpp contains some methods for reading/writing sdsl structures.
Namespace for the succinct data structure library.
size_t write_member(T const &t, std::ostream &out, sdsl::structure_tree_node *v=nullptr, std::string name="")
void read_member(T &t, std::istream &in)
static constexpr uint32_t hi(uint64_t x)
Position of the most significant set bit the 64-bit word x.
structure_tree.hpp contains a helper class which can represent the memory structure of a class.
util.hpp contains some helper methods for int_vector and other stuff like demangle class names.