![]() |
OR-Tools
8.2
|
This class represents a reversible bitset.
It is meant to represent a set of active bits. It does not offer direct access, but just methods that can reversibly subtract another bitset, or check if the current active bitset intersects with another bitset.
Definition at line 2775 of file constraint_solveri.h.
Public Member Functions | |
UnsortedNullableRevBitset (int bit_size) | |
Size is the number of bits to store in the bitset. More... | |
~UnsortedNullableRevBitset () | |
void | Init (Solver *const solver, const std::vector< uint64 > &mask) |
This methods overwrites the active bitset with the mask. More... | |
bool | RevSubtract (Solver *const solver, const std::vector< uint64 > &mask) |
This method subtracts the mask from the active bitset. More... | |
bool | RevAnd (Solver *const solver, const std::vector< uint64 > &mask) |
This method ANDs the mask with the active bitset. More... | |
int | ActiveWordSize () const |
This method returns the number of non null 64 bit words in the bitset representation. More... | |
bool | Empty () const |
This method returns true if the active bitset is null. More... | |
bool | Intersects (const std::vector< uint64 > &mask, int *support_index) |
This method returns true iff the mask and the active bitset have a non null intersection. More... | |
int64 | bit_size () const |
Returns the number of bits given in the constructor of the bitset. More... | |
int64 | word_size () const |
Returns the number of 64 bit words used to store the bitset. More... | |
const RevIntSet< int > & | active_words () const |
Returns the set of active word indices. More... | |
|
explicit |
Size is the number of bits to store in the bitset.
Definition at line 221 of file utilities.cc.
|
inline |
Definition at line 2780 of file constraint_solveri.h.
|
inline |
Returns the set of active word indices.
Definition at line 2815 of file constraint_solveri.h.
|
inline |
This method returns the number of non null 64 bit words in the bitset representation.
Definition at line 2796 of file constraint_solveri.h.
|
inline |
Returns the number of bits given in the constructor of the bitset.
Definition at line 2811 of file constraint_solveri.h.
|
inline |
This method returns true if the active bitset is null.
Definition at line 2799 of file constraint_solveri.h.
This methods overwrites the active bitset with the mask.
This method should be called only once.
Definition at line 227 of file utilities.cc.
bool Intersects | ( | const std::vector< uint64 > & | mask, |
int * | support_index | ||
) |
This method returns true iff the mask and the active bitset have a non null intersection.
support_index is used as an accelerator:
Definition at line 290 of file utilities.cc.
This method ANDs the mask with the active bitset.
It returns true if the active bitset was changed in the process.
Definition at line 265 of file utilities.cc.
This method subtracts the mask from the active bitset.
It returns true if the active bitset was changed in the process.
Definition at line 238 of file utilities.cc.
|
inline |
Returns the number of 64 bit words used to store the bitset.
Definition at line 2813 of file constraint_solveri.h.