8#ifndef INCLUDED_SDSL_RMQ_SUCCINCT_SCT
9#define INCLUDED_SDSL_RMQ_SUCCINCT_SCT
20template <
bool t_min = true,
class t_bp_support = bp_support_sada<256, 32, rank_support_v5<>>>
21class rmq_succinct_sct;
23template <
class t_bp_support = bp_support_sada<256, 32, rank_support_v5<>>>
39template <
bool t_min,
class t_bp_support>
43 t_bp_support m_sct_bp_support;
60 template <
class t_rac>
65#ifdef RMQ_SCT_BUILD_BP_NOT_SUCCINCT
79 : m_sct_bp(rm.m_sct_bp)
80 , m_sct_bp_support(rm.m_sct_bp_support)
82 m_sct_bp_support.set_vector(&m_sct_bp);
93 *
this = std::move(tmp);
102 m_sct_bp = std::move(rm.m_sct_bp);
103 m_sct_bp_support = std::move(rm.m_sct_bp_support);
104 m_sct_bp_support.set_vector(&m_sct_bp);
124 if (l == r)
return l;
125 size_type i = m_sct_bp_support.select(l + 1);
126 size_type j = m_sct_bp_support.select(r + 1);
127 size_type fc_i = m_sct_bp_support.find_close(i);
134 size_type ec = m_sct_bp_support.rr_enclose(i, j);
135 if (ec == m_sct_bp_support.size())
141 return m_sct_bp_support.rank(ec) - 1;
152 written_bytes += m_sct_bp.
serialize(out, child,
"sct_bp");
153 written_bytes += m_sct_bp_support.serialize(out, child,
"sct_bp_support");
155 return written_bytes;
161 m_sct_bp_support.load(in, &m_sct_bp);
164 template <
typename archive_t>
171 template <
typename archive_t>
176 m_sct_bp_support.set_vector(&m_sct_bp);
182 return (m_sct_bp == other.m_sct_bp) && (m_sct_bp_support == other.m_sct_bp_support);
bp_support_sada.hpp contains an implementation of a balanced parentheses support structure proposed b...
int_vector_size_type size_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.
A class to support range minimum or range maximum queries on a random access container.
void CEREAL_SAVE_FUNCTION_NAME(archive_t &ar) const
rmq_succinct_sct(const rmq_succinct_sct &rm)
Copy constructor.
bool operator==(rmq_succinct_sct const &other) const noexcept
Equality operator.
void CEREAL_LOAD_FUNCTION_NAME(archive_t &ar)
size_type operator()(const size_type l, const size_type r) const
Range minimum/maximum query for the supported random access container v.
bit_vector::size_type value_type
t_bp_support bp_support_type
rmq_succinct_sct & operator=(rmq_succinct_sct &&rm)
rmq_succinct_sct & operator=(const rmq_succinct_sct &rm)
bool operator!=(rmq_succinct_sct const &other) const noexcept
Inequality operator.
rmq_succinct_sct()
Default constructor.
size_type serialize(std::ostream &out, structure_tree_node *v=nullptr, std::string name="") const
rmq_succinct_sct(const t_rac *v=nullptr)
Constructor.
const bp_support_type & sct_bp_support
const bit_vector & sct_bp
rmq_succinct_sct(rmq_succinct_sct &&rm)
Move constructor.
bit_vector::size_type size_type
void load(std::istream &in)
static structure_tree_node * add_child(structure_tree_node *v, const std::string &name, const std::string &type)
static void add_size(structure_tree_node *v, uint64_t value)
int_vector.hpp contains the sdsl::int_vector class.
Namespace for the succinct data structure library.
bit_vector construct_supercartesian_tree_bp_succinct(const t_rac &vec, const bool minimum=true)
Calculate the balanced parentheses of the Super-Cartesian tree, described in Ohlebusch and Gog (SPIRE...
void construct_supercartesian_tree_bp(const t_rac &vec, bit_vector &bp, const bool minimum=true)
Calculate the balanced parentheses of the Super-Cartesian tree, described in Ohlebusch and Gog (SPIRE...
rmq_succinct_sct< false, t_bp_support > type
util.hpp contains some helper methods for int_vector and other stuff like demangle class names.