Generated on Thu Jan 16 2025 00:00:00 for Gecode by doxygen 1.14.0
extensional.hh
Go to the documentation of this file.
1/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2/*
3 * Main authors:
4 * Linnea Ingmar <linnea.ingmar@hotmail.com>
5 * Mikael Lagerkvist <lagerkvist@gecode.org>
6 * Christian Schulte <schulte@gecode.org>
7 *
8 * Copyright:
9 * Linnea Ingmar, 2017
10 * Mikael Lagerkvist, 2007
11 * Christian Schulte, 2004
12 *
13 * This file is part of Gecode, the generic constraint
14 * development environment:
15 * http://www.gecode.org
16 *
17 * Permission is hereby granted, free of charge, to any person obtaining
18 * a copy of this software and associated documentation files (the
19 * "Software"), to deal in the Software without restriction, including
20 * without limitation the rights to use, copy, modify, merge, publish,
21 * distribute, sublicense, and/or sell copies of the Software, and to
22 * permit persons to whom the Software is furnished to do so, subject to
23 * the following conditions:
24 *
25 * The above copyright notice and this permission notice shall be
26 * included in all copies or substantial portions of the Software.
27 *
28 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
29 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
30 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
31 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
32 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
33 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
34 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
35 *
36 */
37
38#ifndef __GECODE_INT_EXTENSIONAL_HH__
39#define __GECODE_INT_EXTENSIONAL_HH__
40
41#include <gecode/int.hh>
42
43#include <gecode/int/rel.hh>
44
49
50namespace Gecode { namespace Int { namespace Extensional {
51
66 template<class View, class Val, class Degree, class StateIdx>
67 class LayeredGraph : public Propagator {
68 protected:
70 class State {
71 public:
72 Degree i_deg;
73 Degree o_deg;
75 void init(void);
76 };
77
78 class Edge {
79 public:
80 StateIdx i_state;
81 StateIdx o_state;
82 };
83
84 class Support {
85 public:
87 Degree n_edges;
89 };
90
93 class Layer {
94 public:
96 StateIdx n_states;
100 };
101
103 private:
104 const Support* s1;
105 const Support* s2;
106 public:
108 LayerValues(void);
110 LayerValues(const Layer& l);
112 void init(const Layer& l);
114 bool operator ()(void) const;
116 void operator ++(void);
118 int val(void) const;
119 };
120
121 class Index : public Advisor {
122 public:
124 int i;
126 Index(Space& home, Propagator& p, Council<Index>& c, int i);
128 Index(Space& home, Index& a);
129 };
130
132 private:
133 int _fst;
134 int _lst;
135 public:
137 IndexRange(void);
139 void reset(void);
141 void add(int i);
143 void add(const IndexRange& ir);
145 void lshift(int n);
147 bool empty(void) const;
149 int fst(void) const;
151 int lst(void) const;
152 };
153
156 int n;
160 StateIdx max_states;
162 unsigned int n_states;
164 unsigned int n_edges;
172 State& i_state(int i, StateIdx is);
174 State& i_state(int i, const Edge& e);
176 bool i_dec(int i, const Edge& e);
178 State& o_state(int i, StateIdx os);
180 State& o_state(int i, const Edge& e);
182 bool o_dec(int i, const Edge& e);
184 void audit(void);
186 template<class Var>
188 const VarArgArray<Var>& x, const DFA& dfa);
191 public:
193 template<class Var>
194 LayeredGraph(Home home,
195 const VarArgArray<Var>& x, const DFA& dfa);
197 virtual Actor* copy(Space& home);
199 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
201 virtual void reschedule(Space& home);
203 virtual ExecStatus advise(Space& home, Advisor& a, const Delta& d);
205 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
207 virtual size_t dispose(Space& home);
209 template<class Var>
210 static ExecStatus post(Home home,
211 const VarArgArray<Var>& x, const DFA& dfa);
212 };
213
215 template<class Var>
217 const VarArgArray<Var>& x, const DFA& dfa);
218
219}}}
220
222
223namespace Gecode { namespace Int { namespace Extensional {
224
227
228 /*
229 * Forward declarations
230 */
231 template<unsigned int size> class TinyBitSet;
232
234 template<class IndexType>
235 class BitSet {
236 template<class> friend class BitSet;
237 template<unsigned int> friend class TinyBitSet;
238 protected:
240 IndexType _limit;
242 IndexType* _index;
246 void replace_and_decrease(IndexType i, BitSetData w);
247 public:
249 BitSet(Space& home, unsigned int n);
251 template<class OldIndexType>
252 BitSet(Space& home, const BitSet<OldIndexType>& bs);
254 BitSet(Space& home, const TinyBitSet<1U>& tbs);
256 BitSet(Space& home, const TinyBitSet<2U>& tbs);
258 BitSet(Space& home, const TinyBitSet<3U>& tbs);
260 BitSet(Space& home, const TinyBitSet<4U>& tbs);
262 unsigned int limit(void) const;
264 bool empty(void) const;
266 void flush(void);
268 unsigned int width(void) const;
270 void clear_mask(BitSetData* mask) const;
272 void add_to_mask(const BitSetData* b, BitSetData* mask) const;
274 template<bool sparse>
275 void intersect_with_mask(const BitSetData* mask);
277 void intersect_with_masks(const BitSetData* a, const BitSetData* b);
279 bool intersects(const BitSetData* b) const;
281 void nand_with_mask(const BitSetData* b);
283 unsigned long long int ones(void) const;
285 unsigned long long int ones(const BitSetData* b) const;
287 unsigned long long int bits(void) const;
289 unsigned int words(void) const;
291 unsigned int size(void) const;
292 };
293
294}}}
295
297
298namespace Gecode { namespace Int { namespace Extensional {
299
301 template<unsigned int _size>
303 template<unsigned int> friend class TinyBitSet;
304 protected:
307 public:
309 TinyBitSet(Space& home, unsigned int n);
311 template<unsigned int largersize>
314 template<class IndexType>
315 TinyBitSet(Space& home, const BitSet<IndexType>& bs);
317 int limit(void) const;
319 bool empty(void) const;
321 void flush(void);
323 unsigned int width(void) const;
325 void clear_mask(BitSetData* mask);
327 void add_to_mask(const BitSetData* b, BitSetData* mask) const;
329 template<bool sparse>
330 void intersect_with_mask(const BitSetData* mask);
332 void intersect_with_masks(const BitSetData* a, const BitSetData* b);
334 bool intersects(const BitSetData* b);
336 void nand_with_mask(const BitSetData* b);
338 void nand_with_masks(const BitSetData* a, const BitSetData* b);
340 unsigned long long int ones(void) const;
342 unsigned long long int ones(const BitSetData* b) const;
344 unsigned long long int bits(void) const;
346 unsigned int words(void) const;
348 unsigned int size(void) const;
349 };
350
351}}}
352
354
355namespace Gecode { namespace Int { namespace Extensional {
356
359
361 template<class View, bool pos>
362 class Compact : public Propagator {
363 protected:
367 class CTAdvisor : public ViewAdvisor<View> {
368 public:
369 using ViewAdvisor<View>::view;
370 protected:
372 const Range* _fst;
374 const Range* _lst;
375 public:
377
378
380 const TupleSet& ts, View x0, int i);
382 CTAdvisor(Space& home, CTAdvisor& a);
384
385 void adjust(void);
387 const Range* fst(void) const;
389 const Range* lst(void) const;
391 void dispose(Space& home, Council<CTAdvisor>& c);
392 };
393
394
396
398 protected:
400 const unsigned int n_words;
402 int max;
406 const Range* sr;
408 const Range* lst;
410 int n;
412 const BitSetData* s;
414 void find(void);
415 public:
419 ValidSupports(const TupleSet& ts, int i, View x);
421 void operator ++(void);
423 bool operator ()(void) const;
425 const BitSetData* supports(void) const;
427 int val(void) const;
428 };
429
431 protected:
433 const unsigned int n_words;
435 const Range* r;
437 const Range* lst;
439 int l;
441 int h;
443 const BitSetData* s;
444 public:
447 int l, int h);
449 void operator ++(void);
451 bool operator ()(void) const;
453 const BitSetData* supports(void) const;
454 };
455
456
458
459 bool all(void) const;
461 bool atmostone(void) const;
463 protected:
465 const unsigned int n_words;
473 Compact(Home home, const TupleSet& ts);
475 template<class Table>
476 void setup(Space& home, Table& table, ViewArray<View>& x);
478 template<class Table>
479 bool full(const Table& table) const;
481 const Range* range(CTAdvisor& a, int n);
483 const BitSetData* supports(CTAdvisor& a, int n);
484 public:
486 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
488 size_t dispose(Space& home);
489 };
490
503 template<class View, class Table>
504 class PosCompact : public Compact<View,true> {
505 public:
510
511 using Compact<View,true>::setup;
512 using Compact<View,true>::supports;
513 using Compact<View,true>::all;
514 using Compact<View,true>::atmostone;
515 using Compact<View,true>::c;
516 using Compact<View,true>::ts;
517
519
520
527
528 class Status {
529 protected:
531 ptrdiff_t s;
532 public:
536 Status(const Status& s);
538 StatusType type(void) const;
540 bool single(CTAdvisor& a) const;
542 void touched(CTAdvisor& a);
544 void none(void);
546 void propagating(void);
547 };
548
551 Table table;
553 bool empty(void) const;
555 template<class TableProp>
556 PosCompact(Space& home, TableProp& p);
558 PosCompact(Home home, ViewArray<View>& x, const TupleSet& ts);
559 public:
561 virtual void reschedule(Space& home);
563 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
565 virtual Actor* copy(Space& home);
567 static ExecStatus post(Home home, ViewArray<View>& x, const TupleSet& ts);
569 size_t dispose(Space& home);
571 virtual ExecStatus advise(Space& home, Advisor& a, const Delta& d);
572 };
573
575 template<class View>
577
593 template<class View, class Table>
594 class NegCompact : public Compact<View,false> {
595 public:
599
600 using Compact<View,false>::setup;
601 using Compact<View,false>::full;
602 using Compact<View,false>::supports;
603 using Compact<View,false>::atmostone;
604 using Compact<View,false>::c;
605 using Compact<View,false>::ts;
606
608 Table table;
610 template<class TableProp>
611 NegCompact(Space& home, TableProp& p);
613 NegCompact(Home home, ViewArray<View>& x, const TupleSet& ts);
614 public:
616 virtual void reschedule(Space& home);
618 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
620 virtual Actor* copy(Space& home);
622 static ExecStatus post(Home home, ViewArray<View>& x, const TupleSet& ts);
624 size_t dispose(Space& home);
626 virtual ExecStatus advise(Space& home, Advisor& a, const Delta& d);
627 };
628
630 template<class View>
632
633
635 template<class View, class Table, class CtrlView, ReifyMode rm>
636 class ReCompact : public Compact<View,false> {
637 public:
641
642 using Compact<View,false>::setup;
643 using Compact<View,false>::full;
644 using Compact<View,false>::supports;
645 using Compact<View,false>::c;
646 using Compact<View,false>::ts;
647
649 Table table;
651 CtrlView b;
655 template<class TableProp>
656 ReCompact(Space& home, TableProp& p);
658 ReCompact(Home home, ViewArray<View>& x, const TupleSet& ts, CtrlView b);
659 public:
661 virtual void reschedule(Space& home);
663 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
665 virtual Actor* copy(Space& home);
667 static ExecStatus post(Home home, ViewArray<View>& x, const TupleSet& ts,
668 CtrlView b);
670 size_t dispose(Space& home);
672 virtual ExecStatus advise(Space& home, Advisor& a, const Delta& d);
673 };
674
676 template<class View, class CtrlView, ReifyMode rm>
678 CtrlView b);
679
680}}}
681
683
684#endif
685
686// STATISTICS: int-prop
Advisor(Space &home, Propagator &p, Council< A > &c)
Constructor for creation.
Definition core.hpp:3838
friend class Council
Definition core.hpp:1296
Deterministic finite automaton (DFA)
Definition int.hh:2064
Generic domain change information to be supplied to advisors.
Definition core.hpp:204
Home class for posting propagators
Definition core.hpp:856
unsigned long long int bits(void) const
Return an upper bound on the number of bits.
Definition bit-set.hpp:247
void intersect_with_mask(const BitSetData *mask)
Intersect with mask, sparse mask if sparse is true.
Definition bit-set.hpp:168
unsigned int width(void) const
Return the highest active index.
Definition bit-set.hpp:66
void replace_and_decrease(IndexType i, BitSetData w)
Replace the i th word with w, decrease limit if w is zero.
Definition bit-set.hpp:133
unsigned long long int ones(void) const
Return the number of ones.
Definition bit-set.hpp:238
bool intersects(const BitSetData *b) const
Check if has a non-empty intersection with the set.
Definition bit-set.hpp:219
void intersect_with_masks(const BitSetData *a, const BitSetData *b)
Intersect with the "or" of and b.
Definition bit-set.hpp:191
void add_to_mask(const BitSetData *b, BitSetData *mask) const
Add to mask.
Definition bit-set.hpp:159
unsigned int size(void) const
Return the number of required bit set words.
Definition bit-set.hpp:60
unsigned int limit(void) const
Get the limit.
Definition bit-set.hpp:42
void clear_mask(BitSetData *mask) const
Clear the first limit words in mask.
Definition bit-set.hpp:149
bool empty(void) const
Check whether the set is empty.
Definition bit-set.hpp:48
unsigned int words(void) const
Return the number of required bit set words.
Definition bit-set.hpp:54
void flush(void)
Make the set empty.
Definition bit-set.hpp:105
void nand_with_mask(const BitSetData *b)
Perform "nand" with b.
Definition bit-set.hpp:207
Advisor for updating current table.
const Range * lst(void) const
Return lasst range of support data structure.
Definition compact.hpp:99
const Range * _lst
Last range of support data structure.
const Range * fst(void) const
Return first range of support data structure.
Definition compact.hpp:93
void adjust(void)
Adjust supports.
Definition compact.hpp:47
void dispose(Space &home, Council< CTAdvisor > &c)
Dispose advisor.
Definition compact.hpp:105
CTAdvisor(Space &home, Propagator &p, Council< CTAdvisor > &c, const TupleSet &ts, View x0, int i)
Initialise from parameters.
Definition compact.hpp:80
const Range * _fst
First range of support data structure.
const BitSetData * s
The lost value's support.
bool operator()(void) const
Whether iterator is done.
Definition compact.hpp:307
const BitSetData * supports(void) const
Provide access to corresponding supports.
Definition compact.hpp:312
void operator++(void)
Move iterator to next value.
Definition compact.hpp:299
LostSupports(const Compact< View, pos > &p, CTAdvisor &a, int l, int h)
Initialize iterator for values between l and h.
Definition compact.hpp:288
const unsigned int n_words
Number of words.
bool operator()(void) const
Whether there are still supports left.
Definition compact.hpp:266
const BitSetData * supports(void) const
Return supports.
Definition compact.hpp:271
void operator++(void)
Move to next supports.
Definition compact.hpp:239
ViewRanges< View > xr
Range iterator.
ValidSupports(const Compact< View, pos > &p, CTAdvisor &a)
Initialize from initialized propagator.
Definition compact.hpp:209
void find(void)
Find a new value (only for negative case)
Definition compact.hpp:179
const BitSetData * s
The value's support.
const unsigned int n_words
Number of words.
int val(void) const
Return supported value.
Definition compact.hpp:277
Compact(Space &home, Compact &p)
Constructor for cloning p.
Definition compact.hpp:335
size_t dispose(Space &home)
Delete propagator and return its size.
Definition compact.hpp:402
Compact(Home home, const TupleSet &ts)
Constructor for posting.
Definition compact.hpp:342
const BitSetData * supports(CTAdvisor &a, int n)
Return supports for value n.
Definition compact.hpp:148
bool full(const Table &table) const
Check whether the table covers the whole Cartedion product.
Definition compact.hpp:379
void setup(Space &home, Table &table, ViewArray< View > &x)
Setup the actual table.
Definition compact.hpp:350
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Definition compact.hpp:391
bool all(void) const
Whether all variables are assigned.
Definition compact.hpp:320
const Range * range(CTAdvisor &a, int n)
Find range for n.
Definition compact.hpp:116
bool atmostone(void) const
Whether at most one variable is unassigned.
Definition compact.hpp:326
TupleSet::Range Range
Range type for supports.
Council< CTAdvisor > c
The advisor council.
Edge defined by in-state and out-state
StateIdx o_state
Number of out-state.
Range approximation of which positions have changed.
void add(const IndexRange &ir)
Add index range ir to range.
int fst(void) const
Return first position.
void lshift(int n)
Shift index range by n elements to the left.
int lst(void) const
Return last position.
bool empty(void) const
Test whether range is empty.
Index(Space &home, Propagator &p, Council< Index > &c, int i)
Create index advisor.
int i
The position of the view in the view array.
bool operator()(void) const
Test whether more values supported.
void operator++(void)
Move to next supported value.
int val(void) const
Return supported value.
Layer for a view in the layered graph
State * states
States used by outgoing edges.
ValSize size
Number of supported values.
StateIdx n_states
Number of states used by outgoing edges.
States are described by number of incoming and outgoing edges.
Degree o_deg
The out-degree (number of outgoing edges) Initialize with zeroes.
Degree i_deg
The in-degree (number of incoming edges)
Edge * edges
Supporting edges in layered graph.
Degree n_edges
Number of supporting edges.
ExecStatus initialize(Space &home, const VarArgArray< Var > &x, const DFA &dfa)
Initialize layered graph.
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
unsigned int n_edges
Total number of edges.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Gecode::Support::IntTypeTraits< Val >::utype ValSize
Type for support size.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as high linear)
StateIdx max_states
Maximal number of states per layer.
unsigned int n_states
Total number of states.
State & o_state(int i, const Edge &e)
Return state for layer i and out state of edge e.
bool i_dec(int i, const Edge &e)
Decrement out degree for in state of edge e for layer i.
int n
Number of layers (and views)
IndexRange o_ch
Index range with out-degree modifications.
IndexRange a_ch
Index range for any change (for compression)
virtual size_t dispose(Space &home)
Delete propagator and return its size.
LayeredGraph(Space &home, LayeredGraph< View, Val, Degree, StateIdx > &p)
Constructor for cloning p.
void audit(void)
Perform consistency check on data structures.
IndexRange i_ch
Index range with in-degree modifications.
Council< Index > c
The advisor council.
static ExecStatus post(Home home, const VarArgArray< Var > &x, const DFA &dfa)
Post propagator on views x and DFA dfa.
State & i_state(int i, const Edge &e)
Return in state for layer i and in state of edge e.
State & o_state(int i, StateIdx os)
Return out state for layer i and state index os.
bool o_dec(int i, const Edge &e)
Decrement in degree for out state of edge e for layer i.
State & i_state(int i, StateIdx is)
Return in state for layer i and state index is.
virtual void reschedule(Space &home)
Schedule function.
Layer * layers
The layers of the graph.
Compact< View, false >::ValidSupports ValidSupports
Compact< View, false >::CTAdvisor CTAdvisor
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition compact.hpp:743
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
Definition compact.hpp:904
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition compact.hpp:819
NegCompact(Space &home, TableProp &p)
Constructor for cloning p.
Definition compact.hpp:736
size_t dispose(Space &home)
Delete propagator and return its size.
Definition compact.hpp:806
virtual void reschedule(Space &home)
Schedule function.
Definition compact.hpp:813
static ExecStatus post(Home home, ViewArray< View > &x, const TupleSet &ts)
Post propagator for views x and table t.
Definition compact.hpp:798
Compact< View, false >::Range Range
void none(void)
Set status to NONE.
Definition compact.hpp:444
ptrdiff_t s
A tagged pointer for storing the status.
bool single(CTAdvisor &a) const
Check whether status is single and equal to a.
Definition compact.hpp:430
Status(StatusType t)
Initialize with type t (either NONE or SEVERAL)
Definition compact.hpp:417
void touched(CTAdvisor &a)
Set status to SINGLE or MULTIPLE depending on a.
Definition compact.hpp:438
StatusType type(void) const
Return status type.
Definition compact.hpp:425
void propagating(void)
Set status to PROPAGATING.
Definition compact.hpp:449
size_t dispose(Space &home)
Delete propagator and return its size.
Definition compact.hpp:531
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition compact.hpp:467
Compact< View, true >::ValidSupports ValidSupports
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
Definition compact.hpp:615
Compact< View, true >::Range Range
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition compact.hpp:547
Compact< View, true >::CTAdvisor CTAdvisor
Status status
Propagator status.
@ NONE
No view has been touched.
@ PROPAGATING
The propagator is currently running.
@ SINGLE
A single view has been touched.
@ MULTIPLE
Multiple view have been touched.
Compact< View, true >::LostSupports LostSupports
static ExecStatus post(Home home, ViewArray< View > &x, const TupleSet &ts)
Post propagator for views x and table t.
Definition compact.hpp:522
virtual void reschedule(Space &home)
Schedule function.
Definition compact.hpp:538
bool empty(void) const
Check whether the table is empty.
PosCompact(Space &home, TableProp &p)
Constructor for cloning p.
Definition compact.hpp:460
Compact< View, false >::Range Range
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Definition compact.hpp:1014
ViewArray< View > y
The views (for rewriting)
Compact< View, false >::CTAdvisor CTAdvisor
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
Definition compact.hpp:1140
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Definition compact.hpp:1109
ReCompact(Space &home, TableProp &p)
Constructor for cloning p.
Definition compact.hpp:1005
static ExecStatus post(Home home, ViewArray< View > &x, const TupleSet &ts, CtrlView b)
Post propagator for views x and table t.
Definition compact.hpp:1077
CtrlView b
Boolean control view.
Compact< View, false >::ValidSupports ValidSupports
virtual void reschedule(Space &home)
Schedule function.
Definition compact.hpp:1103
size_t dispose(Space &home)
Delete propagator and return its size.
Definition compact.hpp:1095
TinyBitSet(Space &home, const TinyBitSet< largersize > &tbs)
Initialize during cloning.
void intersect_with_mask(const BitSetData *mask)
Intersect with mask, sparse mask if sparse is true.
unsigned int words(void) const
Return the number of required bit set words.
unsigned int width(void) const
Return the highest active index.
bool intersects(const BitSetData *b)
Check if has a non-empty intersection with the set.
void add_to_mask(const BitSetData *b, BitSetData *mask) const
Add to mask.
int limit(void) const
Get the limit.
unsigned long long int bits(void) const
Return an upper bound on the number of bits.
void nand_with_masks(const BitSetData *a, const BitSetData *b)
Perform "nand" with and the "or" of a and b.
unsigned long long int ones(void) const
Return the number of ones.
unsigned int size(void) const
Return the total number of words.
bool empty(void) const
Check whether the set is empty.
void intersect_with_masks(const BitSetData *a, const BitSetData *b)
Intersect with the "or" of and b.
void flush(void)
Make the set empty.
void nand_with_mask(const BitSetData *b)
Perform "nand" with b.
void clear_mask(BitSetData *mask)
Clear the first limit words in mask.
Range iterator for integer views.
Definition view.hpp:54
Propagation cost.
Definition core.hpp:486
friend class Space
Definition core.hpp:1068
friend class Advisor
Definition core.hpp:1070
friend class Council
Definition core.hpp:1071
ModEventDelta med
A set of modification events (used during propagation)
Definition core.hpp:1077
Propagator(Home home)
Constructor for posting.
Definition core.hpp:3505
Computation spaces.
Definition core.hpp:1744
Date item for bitsets.
Traits to for information about integer types.
Definition int-type.hpp:52
Range information.
Definition int.hh:2216
Class represeting a set of tuples.
Definition int.hh:2206
int * Tuple
Type of a tuple.
Definition int.hh:2212
Argument array for variables.
Definition array.hpp:777
ViewAdvisor(Space &home, Propagator &p, Council< A > &c, View x0)
Constructor for creation.
Definition advisor.hpp:66
View view(void) const
Access view.
Definition advisor.hpp:79
View arrays.
Definition array.hpp:253
int ModEventDelta
Modification event deltas.
Definition core.hpp:89
Extensional propagators
TupleSet::Tuple Tuple
Tuple type.
ExecStatus postnegcompact(Home home, ViewArray< View > &x, const TupleSet &ts)
Post function for compact table propagator.
Definition compact.hpp:955
ExecStatus postposcompact(Home home, ViewArray< View > &x, const TupleSet &ts)
Post function for positive compact table propagator.
Definition compact.hpp:685
Gecode::Support::BitSetData BitSetData
Import type.
ExecStatus postrecompact(Home home, ViewArray< View > &x, const TupleSet &ts, CtrlView b)
Post function for compact table propagator.
Definition compact.hpp:1192
ExecStatus post_lgp(Home home, const VarArgArray< Var > &x, const DFA &dfa)
Select small types for the layered graph propagator.
Finite domain integers.
Gecode toplevel namespace
ExecStatus
Definition core.hpp:472
Post propagator for SetVar x
Definition set.hh:773