42 :
b(nullptr),
e(nullptr) {}
61 return (
b ==
nullptr) || (
b >=
e);
72 }
else if (widx > m->
widx) {
81 template<
class IndexType>
82 forceinline
unsigned int
87 template<
class IndexType>
93 template<
class IndexType>
94 forceinline
unsigned int
99 template<
class IndexType>
100 forceinline
unsigned int
105 template<
class IndexType>
106 forceinline
unsigned int
112 assert(
static_cast<unsigned int>(
width+1U) >=
words());
113 return static_cast<unsigned int>(
width+1U);
116 template<
class IndexType>
119 bool track_positions)
134 template<
class IndexType>
135 template<
class OldIndexType>
161 template<
class IndexType>
168 template<
class IndexType>
174 template<
class IndexType>
180 template<
class IndexType>
186 template<
class IndexType>
193 template<
class IndexType>
199 if (word != old_word) {
203 const IndexType removed_word_index =
_word_index[active_pos];
217 template<
class IndexType>
223 assert(mask[i].none());
227 template<
class IndexType>
236 template<
class IndexType>
246 if (support_word !=
nullptr)
252 s<support.
end(); ++s) {
256 if (active_pos == 0U)
262 template<
class IndexType>
263 template<
bool sparse>
286 template<
class IndexType>
296 if (support_word ==
nullptr) {
297 new_word.
init(
false);
306 template<
class IndexType>
322 template<
class IndexType>
335 if (first_support_word !=
nullptr) {
336 union_word = *first_support_word;
338 union_word.
init(
false);
340 if (second_support_word !=
nullptr)
348 template<
class IndexType>
361 template<
class IndexType>
371 if (support_word !=
nullptr) {
380 s<support.
end(); ++s) {
384 if (active_pos == 0U)
386 const IndexType i = active_pos-1;
392 template<
class IndexType>
401 template<
class IndexType>
410 if ((support_word !=
nullptr) &&
417 s<support.
end(); ++s) {
421 if ((active_pos != 0U) &&
428 template<
class IndexType>
429 forceinline
unsigned long long int
431 unsigned long long int count = 0U;
433 count +=
static_cast<unsigned long long int>
438 template<
class IndexType>
439 forceinline
unsigned long long int
441 unsigned long long int count = 0U;
448 if (support_word !=
nullptr)
449 count +=
static_cast<unsigned long long int>
455 s<support.
end(); ++s) {
459 if (active_pos == 0U)
461 count +=
static_cast<unsigned long long int>
467 template<
class IndexType>
468 forceinline
unsigned long long int
470 unsigned long long int count = 0U;
476 template<
class IndexType>
477 forceinline
unsigned long long int
BitSetData * _word_bits
Active word data.
unsigned long long int bits(void) const
Return an upper bound on the number of bits.
void add_to_mask(const BitSetData *support, BitSetData *mask) const
Add support to mask.
bool intersects(const BitSetData *mask) const
Check if has a non-empty intersection with the set.
void intersect_with_mask(const BitSetData *mask)
Intersect with mask, sparse mask if sparse is true.
unsigned int width(void) const
Return the highest active index.
IndexType _word_capacity
Number of addressable word slots.
unsigned long long int ones(void) const
Return the number of ones.
IndexType _active_words
Number of active words.
void intersect_with_masks(const BitSetData *a, const BitSetData *b)
Intersect with the "or" of a and b.
IndexType * _word_index
Original word index for each active word position.
unsigned int size(void) const
Return the number of required bit set words.
unsigned int limit(void) const
Get the number of active words.
void replace_and_decrease(IndexType active_pos, BitSetData word)
Replace active word active_pos, dropping it if word is zero.
void clear_mask(BitSetData *mask) const
Clear all active words in mask.
bool empty(void) const
Check whether the set is empty.
unsigned int words(void) const
Return the number of required bit set words.
IndexType * _active_position
Reverse map from word index to active position+1 (optional).
void flush(void)
Make the set empty.
void nand_with_mask(const BitSetData *mask)
Perform "nand" with mask.
Compressed tuple-word support list.
const TupleSet::CSupportWord * end(void) const
Return one past last support word.
const TupleSet::CSupportWord * begin(void) const
Return first support word.
bool empty(void) const
Whether support list is empty.
const TupleSet::CSupportWord * e
One past last support word.
const TupleSet::CSupportWord * b
First support word.
CompressedSupport(void)
Initialize as empty support list.
static const unsigned int bpb
Bits per base.
void init(bool setbits=false)
Initialize with all bits set if setbits.
void a(BitSetData a)
Perform "and" with a.
bool none(void) const
Whether no bits are set.
void o(BitSetData a)
Perform "or" with a.
Compressed support data for one tuple-word block.
unsigned int widx
Word index in tuple-word array.
BitSetData bits
Support bits in that word.
Gecode::Support::BitSetData BitSetData
Import bit set data type.
const TupleSet::BitSetData * find_support_word(const CompressedSupport &s, unsigned int widx)
Gecode::Support::BitSetData BitSetData
Import type.
Gecode toplevel namespace
void count(Home home, const IntVarArgs &x, int n, IntRelType irt, int m, IntPropLevel ipl=IPL_DEF)
Post propagator for .
#define GECODE_NEVER
Assert that this command is never executed.