Sux
|
#include <WordDynRankSel.hpp>
Public Member Functions | |
WordDynRankSel (uint64_t bitvector[], size_t size) | |
uint64_t * | bitvector () const |
virtual uint64_t | rank (size_t pos) |
virtual size_t | select (uint64_t rank) |
virtual size_t | selectZero (uint64_t rank) |
virtual uint64_t | update (size_t index, uint64_t word) |
virtual bool | set (size_t index) |
virtual bool | clear (size_t index) |
virtual bool | toggle (size_t index) |
virtual size_t | size () const |
virtual size_t | bitCount () const |
virtual uint64_t | rank (std::size_t pos)=0 |
uint64_t | rank (std::size_t from, std::size_t to) |
virtual uint64_t | rankZero (std::size_t pos) |
uint64_t | rankZero (std::size_t from, std::size_t to) |
Public Member Functions inherited from sux::bits::DynamicBitVector | |
virtual | ~DynamicBitVector ()=default |
Public Member Functions inherited from sux::Rank | |
virtual | ~Rank ()=default |
virtual uint64_t | rank (std::size_t pos)=0 |
uint64_t | rank (std::size_t from, std::size_t to) |
virtual uint64_t | rankZero (std::size_t pos) |
uint64_t | rankZero (std::size_t from, std::size_t to) |
Public Member Functions inherited from sux::Select | |
virtual | ~Select ()=default |
Public Member Functions inherited from sux::SelectZero | |
virtual | ~SelectZero ()=default |
Friends | |
std::ostream & | operator<< (std::ostream &os, const WordDynRankSel< SPS, AT > &bv) |
std::istream & | operator>> (std::istream &is, WordDynRankSel< SPS, AT > &bv) |
Ranking and selection in a dynamic bit vector by means of a searchable prefix-sum data structure and broadword operations on a single word.
The constructors of this class only store a reference to a provided bit vector. The content of the bit vector should be changed only through the mutation methods of this class, or 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.
SPS | underlying sux::util::SearchablePrefixSums implementation. |
AT | a type of memory allocation for the underlying structure. |
|
inline |
Creates a new instance using a given bit vector.
Thus constructor only store a reference to the provided bit vector. The content of the bit vector should be changed only through the mutation methods of this class, or 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.
bitvector | a bit vector of 64-bit words. |
size | the length (in bits) of the bit vector. |
|
inlinevirtual |
Returns an estimate of the size (in bits) of this structure.
Implements sux::bits::DynamicBitVector.
|
inline |
|
inlinevirtual |
Clear (set to 0) a given bit in the bitvector.
index | index (in bits) in the bitvector. |
Implements sux::bits::DynamicBitVector.
|
inlinevirtual |
|
inline |
virtual uint64_t sux::Rank::rank |
Returns the number of ones before the given posistion.
pos | A position from 0 to size() (included). |
|
inline |
|
inline |
Returns the number of zeros before the given posistion.
pos | A position from 0 to size() (included). |
|
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.
|
inlinevirtual |
Returns the position of the zero with given rank.
rank | the desired rank (index) of a zero in the bit vector. |
Implements sux::SelectZero.
|
inlinevirtual |
Set (set to 1) a given bit in the bitvector.
index | index (in bits) in the bitvector. |
Implements sux::bits::DynamicBitVector.
|
inlinevirtual |
Returns the length (in bits) of the underlying bit vector.
Implements sux::Rank.
|
inlinevirtual |
Change the value of a given bit in the bitvector.
index | index (in bits) in the bitvector. |
Implements sux::bits::DynamicBitVector.
|
inlinevirtual |
Replace a given word in the bitvector.
index | index (in words) in the bitvector. |
word | new value for bitvector[index] . |
Implements sux::bits::DynamicBitVector.
|
friend |
|
friend |