![]() |
OR-Tools
9.6
|
This class represents a small reversible bitset (size <= 64).
This class is useful to maintain supports.
Definition at line 397 of file constraint_solveri.h.
Public Member Functions | |
| SmallRevBitSet (int64_t size) | |
| void | SetToOne (Solver *const solver, int64_t pos) |
| Sets the 'pos' bit. More... | |
| void | SetToZero (Solver *const solver, int64_t pos) |
| Erases the 'pos' bit. More... | |
| int64_t | 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_t | GetFirstOne () const |
| Gets the index of the first bit set starting from 0. More... | |
|
explicit |
Definition at line 34 of file utilities.cc.
| int64_t Cardinality | ( | ) | const |
Returns the number of bits set to one.
Definition at line 49 of file utilities.cc.
| int64_t GetFirstOne | ( | ) | const |
Gets the index of the first bit set starting from 0.
It returns -1 if the bitset is empty.
Definition at line 53 of file utilities.cc.
|
inline |
Does it contains only one bit set?
Definition at line 409 of file constraint_solveri.h.
|
inline |
Is bitset null?
Definition at line 407 of file constraint_solveri.h.
| void SetToOne | ( | Solver *const | solver, |
| int64_t | pos | ||
| ) |
Sets the 'pos' bit.
Definition at line 39 of file utilities.cc.
| void SetToZero | ( | Solver *const | solver, |
| int64_t | pos | ||
| ) |
Erases the 'pos' bit.
Definition at line 44 of file utilities.cc.