Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#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 |
This class represents a reversible bitset. This class is useful to maintain supports.
Definition at line 433 of file constraint_solveri.h.
|
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 456 of file constraint_solveri.h.