#include <dynamic_bitset.h>
Public Member Functions | |
void | clear () |
DynamicBitset () | |
DynamicBitset (size_t size) | |
bool | empty () const |
checks if the bitset is empty | |
void | reset () |
void | reset (size_t index) |
set one bit to 0 | |
void | reset_block (size_t index) |
sets a specific bit to 0, and more bits too This function is useful when resetting a given set of bits so that the whole bitset ends up being 0: if that's the case, we don't care about setting other bits to 0 | |
void | resize (size_t size) |
void | set (size_t index) |
size_t | size () const |
bool | test (size_t index) const |
Private Member Functions | |
template<typename Archive > | |
void | serialize (Archive &ar) |
Private Attributes | |
std::vector< size_t > | bitset_ |
size_t | size_ |
Static Private Attributes | |
static const unsigned int | cell_bit_size_ = CHAR_BIT * sizeof(size_t) |
Friends | |
struct | serialization::access |
Class re-implementing the boost version of it This helps not depending on boost, it also does not do the bound checks and has a way to reset a block for speed
Definition at line 52 of file dynamic_bitset.h.
rtflann::DynamicBitset::DynamicBitset | ( | ) | [inline] |
default | constructor |
Definition at line 57 of file dynamic_bitset.h.
rtflann::DynamicBitset::DynamicBitset | ( | size_t | size | ) | [inline] |
only | constructor we use in our code |
the | size of the bitset (in bits) |
Definition at line 64 of file dynamic_bitset.h.
void rtflann::DynamicBitset::clear | ( | ) | [inline] |
Sets all the bits to 0
Definition at line 72 of file dynamic_bitset.h.
bool rtflann::DynamicBitset::empty | ( | ) | const [inline] |
checks if the bitset is empty
Definition at line 80 of file dynamic_bitset.h.
void rtflann::DynamicBitset::reset | ( | ) | [inline] |
set | all the bits to 0 |
Definition at line 87 of file dynamic_bitset.h.
void rtflann::DynamicBitset::reset | ( | size_t | index | ) | [inline] |
void rtflann::DynamicBitset::reset_block | ( | size_t | index | ) | [inline] |
sets a specific bit to 0, and more bits too This function is useful when resetting a given set of bits so that the whole bitset ends up being 0: if that's the case, we don't care about setting other bits to 0
Definition at line 106 of file dynamic_bitset.h.
void rtflann::DynamicBitset::resize | ( | size_t | size | ) | [inline] |
resize | the bitset so that it contains at least size bits |
size |
Definition at line 114 of file dynamic_bitset.h.
void rtflann::DynamicBitset::serialize | ( | Archive & | ar | ) | [inline, private] |
Definition at line 146 of file dynamic_bitset.h.
void rtflann::DynamicBitset::set | ( | size_t | index | ) | [inline] |
set | a bit to true |
index | the index of the bit to set to 1 |
Definition at line 123 of file dynamic_bitset.h.
size_t rtflann::DynamicBitset::size | ( | ) | const [inline] |
gives | the number of contained bits |
Definition at line 130 of file dynamic_bitset.h.
bool rtflann::DynamicBitset::test | ( | size_t | index | ) | const [inline] |
check | if a bit is set |
index | the index of the bit to check |
Definition at line 139 of file dynamic_bitset.h.
friend struct serialization::access [friend] |
Definition at line 151 of file dynamic_bitset.h.
std::vector<size_t> rtflann::DynamicBitset::bitset_ [private] |
Definition at line 154 of file dynamic_bitset.h.
const unsigned int rtflann::DynamicBitset::cell_bit_size_ = CHAR_BIT * sizeof(size_t) [static, private] |
Definition at line 156 of file dynamic_bitset.h.
size_t rtflann::DynamicBitset::size_ [private] |
Definition at line 155 of file dynamic_bitset.h.