![]() |
Google OR-Tools v9.15
a fast and portable software suite for combinatorial optimization
|
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 4146 of file constraint_solveri.h.
#include <constraint_solveri.h>
Public Member Functions | |
| UnsortedNullableRevBitset (int bit_size) | |
| Size is the number of bits to store in the bitset. | |
| ~UnsortedNullableRevBitset () | |
| void | Init (Solver *solver, const std::vector< uint64_t > &mask) |
| bool | RevSubtract (Solver *solver, const std::vector< uint64_t > &mask) |
| bool | RevAnd (Solver *solver, const std::vector< uint64_t > &mask) |
| int | ActiveWordSize () const |
| bool | Empty () const |
| This method returns true if the active bitset is null. | |
| bool | Intersects (const std::vector< uint64_t > &mask, int *support_index) |
| int64_t | bit_size () const |
| Returns the number of bits given in the constructor of the bitset. | |
| int64_t | word_size () const |
| Returns the number of 64 bit words used to store the bitset. | |
| const RevIntSet< int > & | active_words () const |
| Returns the set of active word indices. | |
|
explicit |
Size is the number of bits to store in the bitset.
Definition at line 222 of file utilities.cc.
|
inline |
Definition at line 4151 of file constraint_solveri.h.
|
inline |
Returns the set of active word indices.
Definition at line 4186 of file constraint_solveri.h.
|
inline |
This method returns the number of non null 64 bit words in the bitset representation.
Definition at line 4167 of file constraint_solveri.h.
|
inline |
Returns the number of bits given in the constructor of the bitset.
Definition at line 4182 of file constraint_solveri.h.
|
inline |
This method returns true if the active bitset is null.
Definition at line 4170 of file constraint_solveri.h.
| void operations_research::UnsortedNullableRevBitset::Init | ( | Solver * | solver, |
| const std::vector< uint64_t > & | mask ) |
This methods overwrites the active bitset with the mask. This method should be called only once.
Definition at line 228 of file utilities.cc.
| bool operations_research::UnsortedNullableRevBitset::Intersects | ( | const std::vector< uint64_t > & | 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 291 of file utilities.cc.
| bool operations_research::UnsortedNullableRevBitset::RevAnd | ( | Solver * | solver, |
| const std::vector< uint64_t > & | mask ) |
This method ANDs the mask with the active bitset. It returns true if the active bitset was changed in the process.
Definition at line 266 of file utilities.cc.
| bool operations_research::UnsortedNullableRevBitset::RevSubtract | ( | Solver * | solver, |
| const std::vector< uint64_t > & | mask ) |
This method subtracts the mask from the active bitset. It returns true if the active bitset was changed in the process.
Definition at line 239 of file utilities.cc.
|
inline |
Returns the number of 64 bit words used to store the bitset.
Definition at line 4184 of file constraint_solveri.h.