Expand description
The raw functions for building and using rank/select indexes.
The functions here do minimal if any checking on the size or validity of indexes vs. the bitvectors they are used with, so you may run into panics from e.g. out of bounds accesses to slices. They should all be memory-safe though.
Structs§
- Index
Size Error - Indicates the index storage was the wrong size for the bit vector it was used with.
Functions§
- build_
index_ for - Build the index data for a given bitvector (O(n)).
- check_
index_ size - Check an index is the right size for a given bitvector.
- count_
ones - Count the set bits using the index (fast O(1)).
- count_
zeros - Count the unset bits using the index (fast O(1)).
- index_
size_ for - Calculate the storage size for an index for a given bitvector (O(1)).
- rank_
ones - Count the set bits before a position in the bits using the index (O(1)).
- rank_
zeros - Count the unset bits before a position in the bits using the index (O(1)).
- select_
ones - Find the position of a set bit by its rank using the index (O(log n)).
- select_
zeros - Find the position of an unset bit by its rank using the index (O(log n)).