![]() |
OR-Tools
8.2
|
This class represents a reversible bitset.
This class is useful to maintain supports.
Definition at line 428 of file constraint_solveri.h.
Public Member Functions | |
RevBitSet (int64 size) | |
~RevBitSet () | |
void | SetToOne (Solver *const solver, int64 index) |
Sets the 'index' bit. More... | |
void | SetToZero (Solver *const solver, int64 index) |
Erases the 'index' bit. More... | |
bool | IsSet (int64 index) const |
Returns whether the 'index' bit is set. More... | |
int64 | Cardinality () const |
Returns the number of bits set to one. More... | |
bool | IsCardinalityZero () const |
Is bitset null? More... | |
bool | IsCardinalityOne () const |
Does it contains only one bit set? More... | |
int64 | GetFirstBit (int start) const |
Gets the index of the first bit set starting from start. More... | |
void | ClearAll (Solver *const solver) |
Cleans all bits. More... | |
Definition at line 58 of file utilities.cc.
~RevBitSet | ( | ) |
Definition at line 68 of file utilities.cc.
int64 Cardinality | ( | ) | const |
Returns the number of bits set to one.
Definition at line 109 of file utilities.cc.
void ClearAll | ( | Solver *const | solver | ) |
Cleans all bits.
Definition at line 148 of file utilities.cc.
int64 GetFirstBit | ( | int | start | ) | const |
Gets the index of the first bit set starting from start.
It returns -1 if the bitset is empty after start.
Definition at line 144 of file utilities.cc.
bool IsCardinalityOne | ( | ) | const |
Does it contains only one bit set?
Definition at line 126 of file utilities.cc.
bool IsCardinalityZero | ( | ) | const |
Is bitset null?
Definition at line 117 of file utilities.cc.
bool IsSet | ( | int64 | index | ) | const |
Returns whether the 'index' bit is set.
Definition at line 103 of file utilities.cc.
Sets the 'index' bit.
Definition at line 81 of file utilities.cc.
Erases the 'index' bit.
Definition at line 92 of file utilities.cc.