template<util::AllocType AT = util::AllocType::MALLOC>
class sux::bits::Rank9Sel< AT >
A class implementing a combination of Rank9 for ranking and Select9 for selection. Select9 uses 25%-37.5% additional space (beside the 25% due to Rank9), depending on density, and provides constant-time selection.
The constructors of this class only store a reference to a provided bit vector. Should the content of the bit vector change, the results will be unpredictable.
Warning: if you plan an calling rank(size_t) with argument size(), you must have at least one additional free bit at the end of the provided bit vector.
template<util::AllocType AT = util::AllocType::MALLOC>
Creates a new instance using a given bit vector.
Note that this constructor only stores a reference to the provided bit vector. Should the content of the bit vector change, the results will be unpredictable.
Warning: if you plan an calling rank(size_t) with argument size(), you must have at least one additional free bit at the end of the provided bit vector.
- Parameters
-
bits | a bit vector of 64-bit words. |
num_bits | the length (in bits) of the bit vector. |