36namespace Gecode {
namespace Set {
namespace Channel {
46 p.y.subscribe(home,*
this);
48 p.x[idx].subscribe(home,*this);
69 p.
y.cancel(home,*
this);
71 p.x[idx].cancel(home,*
this);
82 bool assigned =
false;
83 for (
int i=
x.
size(); i--;) {
87 zeros.include(home, i, i, d);
88 }
else if (
x[i].one()) {
106 (void)
new (home) IndexAdvisor(home,*
this,co,-1);
112 :
Super(home,
p), running(false) {
113 co.update(home,
p.co);
142 (void) Super::dispose(home);
143 return sizeof(*this);
156 if (zeros.size() > 0) {
161 if (ones.size() > 0) {
168 if (delta.glbMin() != 1 || delta.glbMax() != 0) {
169 if (!delta.glbAny()) {
170 for (
int i=delta.glbMin(); i<=delta.glbMax(); i++)
179 if (delta.lubMin() != 1 || delta.lubMax() != 0) {
180 if (!delta.lubAny()) {
181 for (
int i=delta.lubMin(); i<=delta.lubMax(); i++)
186 for (; cur < lub.min(); cur++) {
191 for (; cur <
x.size(); cur++) {
209 int index =
a.index();
210 if ( (running && index == -1 && me !=
ME_SET_VAL)
216 if (
x[index].zero()) {
218 zeros.include(home, index, index, dummy);
220 assert(
x[index].one());
222 ones.include(home, index, index, dummy);
230 SetDelta(2,0, delta.lubMin(), delta.lubMax());
232 if (delta.glbMin() == 1 && delta.glbMax() == 0) {
235 delta.lubMin(), delta.lubMax());
237 if (delta.glbMin() != 2 || delta.glbMax() != 0) {
238 if ((delta.glbMin() <= d.glbMin() && delta.glbMax() >= d.glbMin())
240 (delta.glbMin() <= d.glbMax() && delta.glbMax() >= d.glbMax())
243 SetDelta(std::min(delta.glbMin(), d.glbMin()),
244 std::max(delta.glbMax(), d.glbMax()),
245 delta.lubMin(), delta.lubMax());
248 SetDelta(2, 0, delta.lubMin(), delta.lubMax());
257 SetDelta(delta.glbMin(), delta.glbMax(), 2,0);
259 if (delta.lubMin() == 1 && delta.lubMax() == 0) {
261 SetDelta(delta.glbMin(), delta.glbMax(),
262 d.lubMin(), d.lubMax());
264 if (delta.lubMin() != 2 || delta.lubMax() != 0) {
265 if ((delta.lubMin() <= d.lubMin() && delta.lubMax() >= d.lubMin())
267 (delta.lubMin() <= d.lubMax() && delta.lubMax() >= d.lubMax())
270 SetDelta(delta.lubMin(), delta.lubMax(),
271 std::min(delta.lubMin(), d.lubMin()),
272 std::max(delta.lubMax(), d.lubMax())
276 SetDelta(delta.glbMin(), delta.glbMax(), 2, 0);
int p
Number of positive literals for node type.
struct Gecode::@603::NNF::@65::@67 a
For atomic nodes.
Base-class for both propagators and branchers.
void dispose(Space &home, Council< A > &c)
Dispose the advisor.
Generic domain change information to be supplied to advisors.
Home class for posting propagators
Value iterator from range iterator.
ViewArray< Gecode::Int::BoolView > x
static PropCost quadratic(PropCost::Mod m, unsigned int n)
Quadratic complexity for modifier m and size measure n.
unsigned int glbSize(void) const
Return number of elements in the greatest lower bound.
int glbMin(void) const
Return minimum element of greatest lower bound.
int glbMax(void) const
Return maximum of greatest lower bound.
Range iterator for integer sets.
Advisor storing a single index
IndexAdvisor(Space &home, ChannelBool< View > &p, Council< A > &c, int index)
Constructor for creation.
int index(void) const
Access index.
void dispose(Space &home, Council< A > &c)
Delete advisor.
Propagator for channelling between set variable and its characteristic function
ChannelBool(Space &home, ChannelBool &p)
Constructor for cloning p.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Council< IndexAdvisor > co
Council for managing advisors.
GLBndSet ones
Accumulated one Booleans.
bool running
Flag whether propagation is currently running.
bool include(Space &home, int i, int j, SetDelta &d)
Include the set in this set.
Range iterator for the greatest lower bound.
Range iterator for the least upper bound.
Finite set delta information for advisors.
bool assigned(void) const
Test whether view is assigned.
static void schedule(Space &home, Propagator &p, ModEvent me)
int size(void) const
Return size of array (number of elements)
ExecStatus ES_NOFIX_DISPOSE(Council< A > &c, A &a)
Advisor a must be disposed and its propagator must be run
ExecStatus ES_SUBSUMED(Propagator &p)
int ModEventDelta
Modification event deltas.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
const Gecode::ModEvent ME_BOOL_VAL
Domain operation has resulted in a value (assigned variable)
const Gecode::PropCond PC_BOOL_VAL
Propagate when a view becomes assigned (single value)
bool testSetEventLB(ModEvent me0, ModEvent me1, ModEvent me2)
bool testSetEventUB(ModEvent me0, ModEvent me1, ModEvent me2)
const Gecode::ModEvent ME_SET_VAL
Domain operation has resulted in a value (assigned variable)
const Gecode::ModEvent ME_SET_CARD
Domain operation has changed the variable cardinality.
const Gecode::ModEvent ME_SET_BB
Domain operation has changed both greatest lower and least upper bound.
Gecode toplevel namespace
Post propagator for SetVar SetOpType SetVar y
TFE propagator(PropagatorGroup g)
Only propagators (but not post functions) from g are considered.
@ ES_OK
Execution is okay.
@ ES_FIX
Propagation has computed fixpoint.
@ ES_NOFIX
Propagation has not computed fixpoint.
Post propagator for SetVar x
int ModEvent
Type for modification events.