tlx
|
A BitArray of fixed size supporting reading, setting, and clearing of individual bits. More...
#include <radix_heap.hpp>
Public Member Functions | |
BitArray () noexcept=default | |
BitArray (const BitArray &) noexcept=default | |
BitArray (BitArray &&) noexcept=default | |
BitArray & | operator= (const BitArray &) noexcept=default |
BitArray & | operator= (BitArray &&) noexcept=default |
void | set_bit (const size_t i) |
Set the i-th bit to true. More... | |
void | clear_bit (const size_t i) |
Set the i-th bit to false. More... | |
bool | is_set (const size_t i) const |
Returns value of the i-th. More... | |
void | clear_all () |
Sets all bits to false. More... | |
bool | empty () const |
True if all bits are false. More... | |
size_t | find_lsb () const |
Finds the bit with smallest index that is set. More... | |
Static Public Attributes | |
static constexpr size_t | size |
Private Types | |
using | impl_type = BitArrayRecursive< Size, Size<=64 > |
Private Attributes | |
impl_type | impl_ |
A BitArray of fixed size supporting reading, setting, and clearing of individual bits.
The data structure is optimized to find the bit with smallest index that is set (find_lsb).
The BitArray is implemented as a search tree with a fan-out of up to 64. It is thus very flat, and all operations but with the exception of clear_all have a complexity of O(log_64(Size)) which is << 10 for all practical purposes.
Definition at line 226 of file radix_heap.hpp.
|
private |
Definition at line 228 of file radix_heap.hpp.
|
explicitdefaultnoexcept |
|
inline |
Sets all bits to false.
Definition at line 255 of file radix_heap.hpp.
|
inline |
Set the i-th bit to false.
Definition at line 245 of file radix_heap.hpp.
|
inline |
True if all bits are false.
Definition at line 260 of file radix_heap.hpp.
|
inline |
Finds the bit with smallest index that is set.
Definition at line 266 of file radix_heap.hpp.
|
inline |
Returns value of the i-th.
Definition at line 250 of file radix_heap.hpp.
|
inline |
Set the i-th bit to true.
Definition at line 240 of file radix_heap.hpp.
|
private |
Definition at line 271 of file radix_heap.hpp.
|
static |
Definition at line 231 of file radix_heap.hpp.