Sux
|
#include <SimpleSelect.hpp>
Public Member Functions | |
SimpleSelect () | |
SimpleSelect (const uint64_t *const bits, const uint64_t num_bits, const int max_log2_longwords_per_subinventory) | |
size_t | select (const uint64_t rank) |
size_t | bitCount () const |
Public Member Functions inherited from sux::Select | |
virtual | ~Select ()=default |
A simple Select implementation based on a two-level inventory, a spill list and broadword bit search.
This implementation uses around 13.75% additional space on evenly distributed bit arrays, and, under the same conditions, provide very fast selects. For very unevenly distributed arrays the space occupancy will grow significantly, and access time might vary wildly.
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.
AT | a type of memory allocation out of sux::util::AllocType. |
|
inline |
|
inline |
Creates a new instance using a given bit vector.
bits | a bit vector of 64-bit words. |
num_bits | the length (in bits) of the bit vector. |
max_log2_longwords_per_subinventory | the number of words per subinventory: a larger value yields a faster map that uses more space; typical values are between 0 and 3. |
|
inline |
Returns an estimate of the size (in bits) of this structure.
|
inlinevirtual |
Returns the position of the one with given rank.
rank | the desired rank (index) of a one in the bit vector. |
Implements sux::Select.