9#ifndef INCLUDED_SDSL_RANK_SUPPORT_INT_SCAN
10#define INCLUDED_SDSL_RANK_SUPPORT_INT_SCAN
27template <u
int8_t alphabet_size>
74template <u
int8_t alphabet_size>
78 assert(v < this->t_v);
79 assert(this->m_v !=
nullptr);
80 assert(idx <= this->m_v->size());
83 return prefix_rank(idx, v);
85 uint64_t
const * p = this->m_v->data();
88 size_type word_pos = (idx * this->t_b) >> 6;
91 result += base_t::full_word_rank(base_t::extract_word(p, i), v);
94 return result + base_t::word_rank(base_t::extract_word(p, idx), idx * this->sigma_bits, v);
102template <u
int8_t alphabet_size>
106 assert(v < this->t_v);
107 assert(this->m_v !=
nullptr);
108 assert(idx <= this->m_v->size());
113 uint64_t
const * p = this->m_v->data();
114 size_type word_pos = (idx * this->sigma_bits) >> 6;
120 result += base_t::full_word_prefix_rank(base_t::extract_word(p, i), v);
124 return result + base_t::word_prefix_rank(base_t::extract_word(p, idx), idx * this->sigma_bits, v)[0];
size_type size() const noexcept
The number of elements in the int_vector.
A class supporting rank queries in linear time.
rank_support_int_scan & operator=(rank_support_int_scan const &rs)=default
rank_support_int_scan(int_vector<> const *v=nullptr)
void load(std::istream &, int_vector<> const *v=nullptr)
Loads the rank_support_int.
size_type rank(size_type idx, const value_type v) const
Counts the occurrences of v in the prefix [0..idx-1].
void set_vector(int_vector<> const *v=nullptr)
Sets the supported int_vector to the given pointer.
rank_support_int< alphabet_size >::value_type value_type
size_type serialize(std::ostream &out, structure_tree_node *v=nullptr, const std::string name="") const
Serializes rank_support_int.
rank_support_int_scan(rank_support_int_scan &&rs)=default
size_type operator()(size_type idx, const value_type v) const
Alias for rank(idx, v)
int_vector int_vector_type
rank_support_int< alphabet_size >::size_type size_type
size_type prefix_rank(size_type idx, const value_type v) const
Counts the occurrences of elements smaller or equal to v in the prefix [0..idx-1].
rank_support_int_scan & operator=(rank_support_int_scan &&rs)=default
rank_support_int_scan(rank_support_int_scan const &rs)=default
The base class of classes supporting rank_queries for a sdsl::int_vector in constant time.
int_vector const * m_v
Pointer to the rank supported bit_vector.
int_vector ::value_type value_type
int_vector ::size_type size_type
Namespace for the succinct data structure library.
size_t serialize_empty_object(std::ostream &, structure_tree_node *v=nullptr, std::string name="", T const *t=nullptr)
rank_support_int.hpp contains classes that support a sdsl::int_vector with constant time rank informa...