9#ifndef INCLUDED_SDSL_INV_PERM_SUPPORT
10#define INCLUDED_SDSL_INV_PERM_SUPPORT
42template <u
int64_t t_s = 32,
class t_bv = bit_vector,
class t_rank =
typename bit_vector::rank_1_type>
65 m_back_pointer(p.m_back_pointer),
67 m_rank_marked(p.m_rank_marked)
69 m_rank_marked.set_vector(&m_marked);
89 size_type back_pointer = i, j = i, j_new = 0;
90 uint64_t steps = 0, all_steps = 0;
91 while ((j_new = (*m_v)[j]) != i)
99 max_back_pointer = std::max(max_back_pointer, back_pointer);
108 max_back_pointer = std::max(max_back_pointer, back_pointer);
113 m_marked = t_bv(std::move(marked));
114 util::init_support(m_rank_marked, &m_marked);
125 size_type back_pointer = i, j = i, j_new = 0;
126 uint64_t steps = 0, all_steps = 0;
127 while ((j_new = (*m_v)[j]) != i)
135 m_back_pointer[m_rank_marked(j)] = back_pointer;
142 m_back_pointer[m_rank_marked(i)] = back_pointer;
152 while ((j_new = (*m_v)[j]) != i)
156 j = m_back_pointer[m_rank_marked(j)];
157 while ((j_new = (*m_v)[j]) != i)
170 return nullptr == m_v ? 0 : m_v->
size();
196 *
this = std::move(tmp);
206 m_v = std::move(p.m_v);
207 m_back_pointer = std::move(p.m_back_pointer);
208 m_marked = std::move(p.m_marked);
209 m_rank_marked = std::move(p.m_rank_marked);
210 m_rank_marked.set_vector(&m_marked);
220 written_bytes += m_back_pointer.
serialize(out, child,
"back_pointer");
221 written_bytes += m_marked.serialize(out, child,
"marked");
222 written_bytes += m_rank_marked.serialize(out, child,
"rank_marked");
224 return written_bytes;
230 m_back_pointer.
load(in);
232 m_rank_marked.load(in, &m_marked);
236 template <
typename archive_t>
245 template <
typename archive_t>
251 m_rank_marked.set_vector(&m_marked);
257 return (m_back_pointer == other.m_back_pointer) && (m_marked == other.m_marked)
258 && (m_rank_marked == other.m_rank_marked);
264 return !(*
this == other);
bits.hpp contains the sdsl::bits class.
cereal.hpp offers cereal support
A generic vector class for integers of width .
int_vector_size_type size_type
ptrdiff_t difference_type
void load(std::istream &in)
Load the int_vector for a stream.
size_type size() const noexcept
The number of elements in the int_vector.
size_type serialize(std::ostream &out, structure_tree_node *v=nullptr, std::string name="") const
Serializes the int_vector to a stream.
int_vector_trait< t_width >::value_type value_type
Class inv_perm_support adds access to the inverse of a permutation.
size_type serialize(std::ostream &out, structure_tree_node *v=nullptr, std::string name="") const
Serialize into stream.
random_access_const_iterator< inv_perm_support > const_iterator
inv_perm_support(iv_type const *v)
Constructor.
inv_perm_support(inv_perm_support &&p)
void load(std::istream &in)
Load sampling from disk.
iv_type::size_type size_type
void set_vector(iv_type const *v)
bool operator==(inv_perm_support const &other) const noexcept
Equality operator.
const_iterator end() const
Returns a const_iterator to the element after the last element.
inv_perm_support(inv_perm_support const &p)
value_type operator[](size_type i) const
Access operator.
inv_perm_support & operator=(inv_perm_support &&p)
Assignment move operation.
bool operator!=(inv_perm_support const &other) const noexcept
Inequality operator.
void CEREAL_LOAD_FUNCTION_NAME(archive_t &ar)
Load via cereal.
iv_type::value_type value_type
iv_type::difference_type difference_type
void CEREAL_SAVE_FUNCTION_NAME(archive_t &ar) const
Serialise (save) via cereal.
const_iterator begin() const
Returns a const_iterator to the first element.
inv_perm_support & operator=(inv_perm_support const &p)
Assignment operation.
Generic iterator for a random access container.
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.
iterators.hpp contains an generic iterator for random access containers.
Namespace for the succinct data structure library.
int_vector< 1 > bit_vector
bit_vector is a specialization of the int_vector.
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.