8 #ifndef INCLUDED_SDSL_RANK_SUPPORT
9 #define INCLUDED_SDSL_RANK_SUPPORT
76 template <u
int8_t bit_pattern, u
int8_t pattern_len>
133 data = data + (idx >> 6);
134 uint64_t carry = (idx > 63) ? *(data - 1) >> 63 : 0;
140 data = data + (idx >> 6);
141 uint64_t carry = (idx > 63) ? *(data - 1) >> 63 : 0;
157 data = data + (idx >> 6);
158 uint64_t carry = (idx > 63) ? *(data - 1) >> 63 : 1;
164 data = data + (idx >> 6);
165 uint64_t carry = (idx > 63) ? *(data - 1) >> 63 : 1;
186 data = data + (idx >> 6);
187 uint64_t carry = (idx > 63) ? *(data - 1) >> 63 : 1;
193 data = data + (idx >> 6);
194 uint64_t carry = (idx > 63) ? *(data - 1) >> 63 : 1;
195 return bits::cnt(~(*data | ((*data) << 1 | carry)));
215 data = data + (idx >> 6);
216 uint64_t carry = (idx > 63) ? *(data - 1) >> 63 : 0;
222 data = data + (idx >> 6);
223 uint64_t carry = (idx > 63) ? *(data - 1) >> 63 : 0;
224 return bits::cnt(*data & ((*data) << 1 | carry));
int_vector_size_type size_type
The base class of classes supporting rank_queries for a sdsl::bit_vector in constant time.
virtual size_type rank(size_type i) const =0
Answers rank queries for the supported bit_vector.
virtual ~rank_support()
Destructor.
virtual void set_vector(const bit_vector *v=nullptr)=0
Sets the supported bit_vector to the given pointer.
virtual void load(std::istream &in, const bit_vector *v=nullptr)=0
Loads the rank_support.
rank_support & operator=(rank_support &&)=default
virtual size_type operator()(size_type idx) const =0
Alias for rank(i)
rank_support(rank_support &&)=default
virtual size_type serialize(std::ostream &out, structure_tree_node *v, std::string name) const =0
Serializes rank_support.
const bit_vector * m_v
Pointer to the rank supported bit_vector.
rank_support(const rank_support &)=default
Copy constructor.
bit_vector::size_type size_type
rank_support & operator=(const rank_support &)=default
rank_support(const bit_vector *v=nullptr)
Constructor.
int_vector.hpp contains the sdsl::int_vector class.
Namespace for the succinct data structure library.
rank_support_scan.hpp contains rank_support_scan that support a sdsl::bit_vector with linear time ran...
rank_support_v5.hpp contains rank_support_v5.5
rank_support_v.hpp contains rank_support_v.
static SDSL_CONSTEXPR uint32_t cnt10(uint64_t x, uint64_t &c)
Count 10 bit pairs in the word x.
static SDSL_CONSTEXPR uint64_t map01(uint64_t x, uint64_t c=1)
Map all 01 bit pairs to 01 or 1 if c=1 and the lsb=0. All other pairs are mapped to 00.
static SDSL_CONSTEXPR uint32_t cnt01(uint64_t x, uint64_t &c)
Count 01 bit pairs in the word x.
constexpr static uint64_t lo_set[65]
lo_set[i] is a 64-bit word with the i least significant bits set and the high bits not set.
static SDSL_CONSTEXPR uint64_t cnt(uint64_t x)
Counts the number of set bits in x.
static SDSL_CONSTEXPR uint64_t map10(uint64_t x, uint64_t c=0)
Map all 10 bit pairs to 01 or 1 if c=1 and the lsb=0. All other pairs are mapped to 00.
static uint32_t word_rank(const uint64_t *data, size_type idx)
static size_type args_in_the_word(uint64_t w, uint64_t &carry)
static uint32_t full_word_rank(const uint64_t *data, size_type idx)
rank_support::size_type size_type
static uint64_t init_carry()
static uint32_t word_rank(const uint64_t *data, size_type idx)
static uint32_t full_word_rank(const uint64_t *data, size_type idx)
rank_support::size_type size_type
static size_type args_in_the_word(uint64_t w, uint64_t &carry)
static uint64_t init_carry()
static uint32_t full_word_rank(const uint64_t *data, size_type idx)
static size_type args_in_the_word(uint64_t w, uint64_t &)
rank_support::size_type size_type
static uint64_t init_carry()
static uint32_t word_rank(const uint64_t *data, size_type idx)
static uint32_t word_rank(const uint64_t *data, size_type idx)
rank_support::size_type size_type
static uint64_t init_carry()
static uint32_t full_word_rank(const uint64_t *data, size_type idx)
static size_type args_in_the_word(uint64_t w, uint64_t &carry)
rank_support::size_type size_type
static uint64_t init_carry()
static uint32_t word_rank(const uint64_t *data, size_type idx)
static size_type args_in_the_word(uint64_t w, uint64_t &carry)
static uint32_t full_word_rank(const uint64_t *data, size_type idx)
rank_support::size_type size_type
static uint64_t init_carry()
static uint32_t word_rank(const uint64_t *data, size_type idx)
static size_type args_in_the_word(uint64_t w, uint64_t &)
static uint32_t full_word_rank(const uint64_t *data, size_type idx)
rank_support::size_type size_type
static uint32_t word_rank(const uint64_t *, size_type)
static uint64_t init_carry()
static uint32_t full_word_rank(const uint64_t *, size_type)
static size_type args_in_the_word(uint64_t, uint64_t &)