![]() |
Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
|
This class is like an ITIVector<IndexType, bool> except that it provides a more efficient way to iterate over the positions set to true. It achieves this by caching the current uint64_t bucket in the Iterator and using LeastSignificantBitPosition64() to iterate over the positions at 1 in this bucket.
#include <bitset.h>
Classes | |
| class | ConstView |
| When speed matter, caching the base pointer helps. More... | |
| class | Iterator |
| class | View |
Public Types | |
| using | value_type = IndexType |
Public Member Functions | |
| Bitset64 () | |
| Bitset64 (IndexType size) | |
| ConstView | const_view () const |
| View | view () |
| IndexType | size () const |
| Returns how many bits this Bitset64 can hold. | |
| void | PushBack (bool value) |
| Appends value at the end of the bitset. | |
| void | resize (int size) |
| Resizes the Bitset64 to the given number of bits. New bits are sets to 0. | |
| void | Resize (IndexType size) |
| void | ClearAndResize (IndexType size) |
| Changes the number of bits the Bitset64 can hold and set all of them to 0. | |
| void | ClearAll () |
| Sets all bits to 0. | |
| void | Clear (IndexType i) |
| Sets the bit at position i to 0. | |
| void | ClearBucket (IndexType i) |
| Sets bucket containing bit i to 0. | |
| void | ClearTwoBits (IndexType i) |
| Clears the bits at position i and i ^ 1. | |
| bool | AreOneOfTwoBitsSet (IndexType i) const |
| Returns true if the bit at position i or the one at position i ^ 1 is set. | |
| bool | IsSet (IndexType i) const |
| Returns true if the bit at position i is set. | |
| bool | operator[] (IndexType i) const |
| Same as IsSet(). | |
| void | Set (IndexType i) |
| Sets the bit at position i to 1. | |
| void | Set (IndexType i, bool value) |
| If value is true, sets the bit at position i to 1, sets it to 0 otherwise. | |
| void | CopyBucket (const Bitset64< IndexType > &other, IndexType i) |
| Copies bucket containing bit i from "other" to "this". | |
| template<typename OtherIndexType> | |
| void | SetContentFromBitset (const Bitset64< OtherIndexType > &other) |
| template<typename OtherIndexType> | |
| void | SetContentFromBitsetOfSameSize (const Bitset64< OtherIndexType > &other) |
| Same as SetContentFromBitset where "this" and "other" have the same size. | |
| void | Intersection (const Bitset64< IndexType > &other) |
| void | SetToIntersectionOf (const Bitset64< IndexType > &a, const Bitset64< IndexType > &b) |
| This one assume both given bitset to be of the same size. | |
| void | Union (const Bitset64< IndexType > &other) |
| Iterator | begin () const |
| Iterator | end () const |
| std::string | DebugString () const |
| Returns a 0/1 string representing the bitset. | |
| bool | IsAllFalse () const |
Static Public Member Functions | |
| static uint64_t | ConditionalXorOfTwoBits (IndexType i, uint64_t use1, Bitset64< IndexType >::ConstView set1, uint64_t use2, Bitset64< IndexType >::ConstView set2) |
Friends | |
| template<class OtherIndexType> | |
| class | Bitset64 |
| using operations_research::Bitset64< IndexType >::value_type = IndexType |
|
inline |
|
inlineexplicit |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |