This class represents a reversible bitset. More...
#include <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... | |
Friends | |
| class | RevBitMatrix |
This class represents a reversible bitset.
This class is useful to maintain supports.
Definition at line 441 of file constraint_solveri.h.
|
explicit |
| operations_research::RevBitSet::~RevBitSet | ( | ) |
| int64 operations_research::RevBitSet::Cardinality | ( | ) | const |
Returns the number of bits set to one.
| void operations_research::RevBitSet::ClearAll | ( | Solver *const | solver | ) |
Cleans all bits.
| int64 operations_research::RevBitSet::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.
| bool operations_research::RevBitSet::IsCardinalityOne | ( | ) | const |
Does it contains only one bit set?
| bool operations_research::RevBitSet::IsCardinalityZero | ( | ) | const |
Is bitset null?
| bool operations_research::RevBitSet::IsSet | ( | int64 | index | ) | const |
Returns whether the 'index' bit is set.
| void operations_research::RevBitSet::SetToOne | ( | Solver *const | solver, |
| int64 | index | ||
| ) |
Sets the 'index' bit.
| void operations_research::RevBitSet::SetToZero | ( | Solver *const | solver, |
| int64 | index | ||
| ) |
Erases the 'index' bit.
|
friend |
Definition at line 464 of file constraint_solveri.h.