Date item for bitsets. More...
#include <gecode/support/bitset-base.hpp>
Public Member Functions | |
| void | init (bool setbits=false) |
| Initialize with all bits set if setbits. | |
| bool | operator() (unsigned int i=0U) const |
| Test whether any bit with position greater or equal to i is set. | |
| bool | get (unsigned int i) const |
| Access value at bit i. | |
| void | set (unsigned int i) |
| Set bit i. | |
| void | clear (unsigned int i) |
| Clear bit i. | |
| unsigned int | next (unsigned int i=0U) const |
| Return next set bit with position greater or equal to i (there must be a bit). | |
| bool | all (void) const |
| Whether all bits are set. | |
| bool | all (unsigned int i) const |
| Whether all bits from bit 0 to bit i are set. | |
| bool | none (void) const |
| Whether no bits are set. | |
| bool | none (unsigned int i) const |
| Whether no bits from bit 0 to bit i are set. | |
| unsigned int | ones (void) const |
| Return the number of bits set. | |
| unsigned int | zeroes (void) const |
| Return the number of bits not set. | |
| bool | one (void) const |
| Check whether exactly one bit is set. | |
| void | a (BitSetData a) |
| Perform "and" with a. | |
| void | a (BitSetData a, unsigned int i) |
| Perform "and" with a for bits 0 to i. | |
| void | o (BitSetData a) |
| Perform "or" with a. | |
| void | o (BitSetData a, unsigned int i) |
| Perform "or" with a for bits 0 to i. | |
| bool | operator== (BitSetData a) const |
| Check if bits are the same as for a. | |
| bool | operator!= (BitSetData a) const |
| Check if bits are not the same as for a. | |
| BitSetData | operator~ (void) const |
| Invert all bits in b. | |
Static Public Member Functions | |
| static unsigned int | data (unsigned int s) |
| Get number of data elements for s bits. | |
| static BitSetData | a (BitSetData a, BitSetData b) |
| Return "and" of a and b. | |
| static BitSetData | o (BitSetData a, BitSetData b) |
| Return "or" of a and b. | |
Static Public Attributes | |
| static const unsigned int | bpb |
| Bits per base. | |
Protected Types | |
| typedef unsigned long long int | Base |
| Basetype for bits. | |
Protected Attributes | |
| Base | bits |
| The bits. | |
Detailed Description
Date item for bitsets.
Definition at line 65 of file bitset-base.hpp.
Member Typedef Documentation
◆ Base
|
protected |
Basetype for bits.
Definition at line 73 of file bitset-base.hpp.
Member Function Documentation
◆ init()
|
inline |
Initialize with all bits set if setbits.
Definition at line 246 of file bitset-base.hpp.
◆ data()
|
inlinestatic |
Get number of data elements for s bits.
Definition at line 250 of file bitset-base.hpp.
◆ operator()()
|
inline |
Test whether any bit with position greater or equal to i is set.
Definition at line 254 of file bitset-base.hpp.
◆ get()
|
inline |
Access value at bit i.
Definition at line 258 of file bitset-base.hpp.
◆ set()
|
inline |
Set bit i.
Definition at line 262 of file bitset-base.hpp.
◆ clear()
|
inline |
Clear bit i.
Definition at line 266 of file bitset-base.hpp.
◆ next()
|
inline |
Return next set bit with position greater or equal to i (there must be a bit).
Definition at line 270 of file bitset-base.hpp.
◆ all() [1/2]
|
inline |
Whether all bits are set.
Definition at line 294 of file bitset-base.hpp.
◆ all() [2/2]
|
inline |
Whether all bits from bit 0 to bit i are set.
Definition at line 298 of file bitset-base.hpp.
◆ none() [1/2]
|
inline |
Whether no bits are set.
Definition at line 303 of file bitset-base.hpp.
◆ none() [2/2]
|
inline |
Whether no bits from bit 0 to bit i are set.
Definition at line 307 of file bitset-base.hpp.
◆ ones()
|
inline |
Return the number of bits set.
Definition at line 313 of file bitset-base.hpp.
◆ zeroes()
|
inline |
Return the number of bits not set.
Definition at line 336 of file bitset-base.hpp.
◆ one()
|
inline |
Check whether exactly one bit is set.
Definition at line 340 of file bitset-base.hpp.
◆ a() [1/3]
|
inline |
Perform "and" with a.
Definition at line 346 of file bitset-base.hpp.
◆ a() [2/3]
|
inline |
Perform "and" with a for bits 0 to i.
Definition at line 350 of file bitset-base.hpp.
◆ a() [3/3]
|
inlinestatic |
Return "and" of a and b.
Definition at line 355 of file bitset-base.hpp.
◆ o() [1/3]
|
inline |
Perform "or" with a.
Definition at line 362 of file bitset-base.hpp.
◆ o() [2/3]
|
inline |
Perform "or" with a for bits 0 to i.
Definition at line 366 of file bitset-base.hpp.
◆ o() [3/3]
|
inlinestatic |
Return "or" of a and b.
Definition at line 371 of file bitset-base.hpp.
◆ operator==()
|
inline |
Check if bits are the same as for a.
Definition at line 384 of file bitset-base.hpp.
◆ operator!=()
|
inline |
Check if bits are not the same as for a.
Definition at line 388 of file bitset-base.hpp.
◆ operator~()
|
inline |
Invert all bits in b.
Definition at line 378 of file bitset-base.hpp.
Member Data Documentation
◆ bits
|
protected |
The bits.
Definition at line 76 of file bitset-base.hpp.
◆ bpb
|
static |
Bits per base.
Definition at line 79 of file bitset-base.hpp.
The documentation for this class was generated from the following file:
- gecode/support/bitset-base.hpp
