size_type serialize(std::ostream& out, structure_tree_node* v=NULL, std::string name="")const { structure_tree_node* child = structure_tree::add_child(v, name, util::class_name(*this)); size_type written_bytes = 0; written_bytes += m_sct_bp.serialize(out, child, "sct_bp"); written_bytes += m_sct_bp_support.serialize(out, child, "sct_bp_support"); structure_tree::add_size(child, written_bytes); return written_bytes; }
/*! * \param l Leftmost position of the interval \f$[\ell..r]\f$. * \param r Rightmost position of the interval \f$[\ell..r]\f$. * \return The minimal index i with \f$\ell \leq i \leq r\f$ for which \f$ v[i] \f$ is minimal/maximal. * \pre * - r < size() * - \f$ \ell \leq r \f$ * \par Time complexity * \f$ \Order{1} \f$ */ size_type operator()(const size_type l, const size_type r)const { assert(l <= r); assert(r < size()); if (l==r) return l; size_type i = m_sct_bp_support.select(l+1); size_type j = m_sct_bp_support.select(r+1); size_type fc_i = m_sct_bp_support.find_close(i); if (j < fc_i) { // i < j < find_close(j) < find_close(i) return l; } else { // if i < find_close(i) < j < find_close(j) size_type ec = m_sct_bp_support.rr_enclose(i,j); if (ec == m_sct_bp_support.size()) {// no restricted enclosing pair found return r; } else { // found range restricted enclosing pair return m_sct_bp_support.rank(ec)-1; // subtract 1, as the index is 0 based } } }
void copy(const rmq_succinct_sct& rm) { m_sct_bp = rm.m_sct_bp; m_sct_bp_support = rm.m_sct_bp_support; m_sct_bp_support.set_vector(&m_sct_bp); }
void load(std::istream& in) { m_sct_bp.load(in); m_sct_bp_support.load(in, &m_sct_bp); }
void copy(const range_minimum_support_succinct_sct &rm){ m_v = rm.m_v; m_sct_bp = rm.m_sct_bp; m_sct_bp_support = rm.m_sct_bp_support; m_sct_bp_support.set_vector(&m_sct_bp); }
void load(std::istream &in, const RandomAccessContainer *v){ m_sct_bp.load(in); m_sct_bp_support.load(in, &m_sct_bp); }
size_type serialize(std::ostream &out)const{ size_type written_bytes = 0; written_bytes += m_sct_bp.serialize(out); written_bytes += m_sct_bp_support.serialize(out); return written_bytes; }