Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#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. | |
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 3122 of file constraint_solveri.h.
|
explicit |
Size is the number of bits to store in the bitset.
--— UnsortedNullableRevBitset --—
Definition at line 227 of file utilities.cc.
|
inline |
Definition at line 3127 of file constraint_solveri.h.
|
inline |
Returns the set of active word indices.
Definition at line 3162 of file constraint_solveri.h.
|
inline |
This method returns the number of non null 64 bit words in the bitset representation.
Definition at line 3143 of file constraint_solveri.h.
|
inline |
Returns the number of bits given in the constructor of the bitset.
Definition at line 3158 of file constraint_solveri.h.
|
inline |
This method returns true if the active bitset is null.
Definition at line 3146 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 233 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 296 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.
Zero the word as the mask is implicitly null.
Definition at line 271 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 244 of file utilities.cc.
|
inline |
Returns the number of 64 bit words used to store the bitset.
Definition at line 3160 of file constraint_solveri.h.