Gecode::Support::BitSetData Class Reference
Date item for bitsets. More...
#include <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 wether 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. | |
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. | |
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. | |
Protected Types | |
typedef unsigned long int | Base |
Basetype for bits. | |
Protected Attributes | |
Base | bits |
The bits. | |
Static Protected Attributes | |
static const unsigned int | bpb |
Bits per base. |
Detailed Description
Date item for bitsets.
Definition at line 65 of file bitset-base.hpp.
Member Typedef Documentation
typedef unsigned long int Gecode::Support::BitSetData::Base [protected] |
Basetype for bits.
Definition at line 73 of file bitset-base.hpp.
Member Function Documentation
void Gecode::Support::BitSetData::init | ( | bool | setbits = false |
) | [inline] |
Initialize with all bits set if setbits.
Definition at line 234 of file bitset-base.hpp.
unsigned int Gecode::Support::BitSetData::data | ( | unsigned int | s | ) | [inline, static] |
Get number of data elements for s bits.
Definition at line 238 of file bitset-base.hpp.
bool Gecode::Support::BitSetData::operator() | ( | unsigned int | i = 0U |
) | const [inline] |
Test wether any bit with position greater or equal to i is set.
Definition at line 242 of file bitset-base.hpp.
bool Gecode::Support::BitSetData::get | ( | unsigned int | i | ) | const [inline] |
Access value at bit i.
Definition at line 246 of file bitset-base.hpp.
void Gecode::Support::BitSetData::set | ( | unsigned int | i | ) | [inline] |
Set bit i.
Definition at line 250 of file bitset-base.hpp.
void Gecode::Support::BitSetData::clear | ( | unsigned int | i | ) | [inline] |
Clear bit i.
Definition at line 254 of file bitset-base.hpp.
unsigned int Gecode::Support::BitSetData::next | ( | unsigned int | i = 0U |
) | const [inline] |
Return next set bit with position greater or equal to i (there must be a bit).
Definition at line 258 of file bitset-base.hpp.
bool Gecode::Support::BitSetData::all | ( | void | ) | const [inline] |
Whether all bits are set.
Definition at line 282 of file bitset-base.hpp.
bool Gecode::Support::BitSetData::all | ( | unsigned int | i | ) | const [inline] |
Whether all bits from bit 0 to bit i are set.
Definition at line 286 of file bitset-base.hpp.
bool Gecode::Support::BitSetData::none | ( | void | ) | const [inline] |
Whether no bits are set.
Definition at line 291 of file bitset-base.hpp.
bool Gecode::Support::BitSetData::none | ( | unsigned int | i | ) | const [inline] |
Whether no bits from bit 0 to bit i are set.
Definition at line 295 of file bitset-base.hpp.
void Gecode::Support::BitSetData::a | ( | BitSetData | a | ) | [inline] |
Perform "and" with a.
Definition at line 301 of file bitset-base.hpp.
void Gecode::Support::BitSetData::a | ( | BitSetData | a, | |
unsigned int | i | |||
) | [inline] |
Perform "and" with a for bits 0 to i.
Definition at line 305 of file bitset-base.hpp.
BitSetData Gecode::Support::BitSetData::a | ( | BitSetData | a, | |
BitSetData | b | |||
) | [inline, static] |
Return "and" of a and b.
Definition at line 310 of file bitset-base.hpp.
void Gecode::Support::BitSetData::o | ( | BitSetData | a | ) | [inline] |
Perform "or" with a.
Definition at line 317 of file bitset-base.hpp.
void Gecode::Support::BitSetData::o | ( | BitSetData | a, | |
unsigned int | i | |||
) | [inline] |
Perform "or" with a for bits 0 to i.
Definition at line 321 of file bitset-base.hpp.
BitSetData Gecode::Support::BitSetData::o | ( | BitSetData | a, | |
BitSetData | b | |||
) | [inline, static] |
Return "or" of a and b.
Definition at line 326 of file bitset-base.hpp.
Member Data Documentation
Base Gecode::Support::BitSetData::bits [protected] |
The bits.
Definition at line 76 of file bitset-base.hpp.
const unsigned int Gecode::Support::BitSetData::bpb [static, protected] |
static_cast<unsigned int>(CHAR_BIT * sizeof(Base))
Bits per base.
Definition at line 78 of file bitset-base.hpp.
The documentation for this class was generated from the following file:
- gecode/support/bitset-base.hpp (Revision: 14967)