Thrill
0.1
|
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 225 of file radix_heap.hpp.
#include <radix_heap.hpp>
Public Member Functions | |
BitArray () noexcept=default | |
BitArray (const BitArray &) noexcept=default | |
BitArray (BitArray &&) noexcept=default | |
void | clear_all () |
Sets all bits to false. More... | |
void | clear_bit (const size_t i) |
Set the i-th bit to false. More... | |
bool | empty () const |
True if all bits are false. More... | |
size_t | find_lsb () const |
bool | is_set (const size_t i) const |
Returns value of the i-th. More... | |
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... | |
Static Public Attributes | |
static constexpr size_t | size = Size |
Private Types | |
using | impl_type = BitArrayRecursive< Size, Size<=64 > |
Private Attributes | |
impl_type | impl_ |
|
private |
Definition at line 227 of file radix_heap.hpp.
|
explicitdefaultnoexcept |
|
inline |
Sets all bits to false.
Definition at line 254 of file radix_heap.hpp.
Referenced by RadixHeap< ValueType, KeyExtract, KeyType, Radix >::initialize_().
|
inline |
Set the i-th bit to false.
Definition at line 244 of file radix_heap.hpp.
Referenced by RadixHeap< ValueType, KeyExtract, KeyType, Radix >::reorganize_().
|
inline |
True if all bits are false.
Definition at line 259 of file radix_heap.hpp.
|
inline |
Finds the bit with smallest index that is set
Definition at line 265 of file radix_heap.hpp.
Referenced by RadixHeap< ValueType, KeyExtract, KeyType, Radix >::reorganize_().
|
inline |
Returns value of the i-th.
Definition at line 249 of file radix_heap.hpp.
|
inline |
Set the i-th bit to true.
Definition at line 239 of file radix_heap.hpp.
Referenced by RadixHeap< ValueType, KeyExtract, KeyType, Radix >::reorganize_(), and BitArray< num_buckets >::set_bit().
|
private |
Definition at line 270 of file radix_heap.hpp.
|
static |
Definition at line 230 of file radix_heap.hpp.