![]() |
Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
|
This class represents a reversible bitset. This class is useful to maintain supports.
Definition at line 438 of file constraint_solveri.h.
#include <constraint_solveri.h>
Public Member Functions | |
| RevBitSet (int64_t size) | |
| -------— RevBitSet -------— | |
| ~RevBitSet () | |
| void | SetToOne (Solver *solver, int64_t index) |
| Sets the 'index' bit. | |
| void | SetToZero (Solver *solver, int64_t index) |
| Erases the 'index' bit. | |
| bool | IsSet (int64_t index) const |
| Returns whether the 'index' bit is set. | |
| int64_t | Cardinality () const |
| Returns the number of bits set to one. | |
| bool | IsCardinalityZero () const |
| Is bitset null? | |
| bool | IsCardinalityOne () const |
| Does it contains only one bit set? | |
| int64_t | GetFirstBit (int start) const |
| void | ClearAll (Solver *solver) |
| Cleans all bits. | |
Friends | |
| class | RevBitMatrix |
|
explicit |
-------— RevBitSet -------—
Definition at line 62 of file utilities.cc.
| operations_research::RevBitSet::~RevBitSet | ( | ) |
Definition at line 72 of file utilities.cc.
| int64_t operations_research::RevBitSet::Cardinality | ( | ) | const |
Returns the number of bits set to one.
Definition at line 113 of file utilities.cc.
| void operations_research::RevBitSet::ClearAll | ( | Solver * | solver | ) |
Cleans all bits.
Definition at line 152 of file utilities.cc.
| int64_t 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.
Definition at line 148 of file utilities.cc.
| bool operations_research::RevBitSet::IsCardinalityOne | ( | ) | const |
Does it contains only one bit set?
Definition at line 130 of file utilities.cc.
| bool operations_research::RevBitSet::IsCardinalityZero | ( | ) | const |
Is bitset null?
Definition at line 121 of file utilities.cc.
| bool operations_research::RevBitSet::IsSet | ( | int64_t | index | ) | const |
Returns whether the 'index' bit is set.
Definition at line 107 of file utilities.cc.
| void operations_research::RevBitSet::SetToOne | ( | Solver * | solver, |
| int64_t | index ) |
Sets the 'index' bit.
Definition at line 85 of file utilities.cc.
| void operations_research::RevBitSet::SetToZero | ( | Solver * | solver, |
| int64_t | index ) |
Erases the 'index' bit.
Definition at line 96 of file utilities.cc.
|
friend |
Definition at line 461 of file constraint_solveri.h.