36 namespace 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);
88 }
else if (
x[
i].
one()) {
100 if (
y.glbSize()==
static_cast<unsigned int>(
y.glbMax()-
y.glbMin()+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())
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(),
276 SetDelta(delta.glbMin(), delta.glbMax(), 2, 0);
int p
Number of positive literals for node type.
Node * x
Pointer to corresponding Boolean expression node.
struct Gecode::@602::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
Array of views.
static PropCost quadratic(PropCost::Mod m, unsigned int n)
Quadratic complexity for modifier m and size measure n.
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
GLBndSet zeros
Accumulated zero Booleans.
ChannelBool(Space &home, ChannelBool &p)
Constructor for cloning p.
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
virtual void reschedule(Space &home)
Schedule function.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Council< IndexAdvisor > co
Council for managing advisors.
SetDelta delta
Accumulated delta information.
GLBndSet ones
Accumulated one Booleans.
bool running
Flag whether propagation is currently running.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as PC_QUADRATIC_LO)
static ExecStatus post(Home home, ViewArray< Gecode::Int::BoolView > &x, View y)
Post propagator for .
bool include(Space &home, int i, int j, SetDelta &d)
Include the set in this set.
Finite set delta information for advisors.
bool assigned(void) const
Test whether view is assigned.
static void schedule(Space &home, Propagator &p, ModEvent me)
Schedule propagator p with modification event me.
int size(void) const
Return size of array (number of elements)
@ ES_OK
Execution is okay.
@ ES_FIX
Propagation has computed fixpoint.
@ ES_NOFIX
Propagation has not computed fixpoint.
int ModEvent
Type for modification events.
TFE propagator(PropagatorGroup g)
Only propagators (but not post functions) from g are considered.
Post propagator for SetVar SetOpType SetVar y
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 FloatNum max
Largest allowed float value.
const FloatNum min
Smallest allowed float value.
bool assigned(View x, int v)
Whether x is assigned to value v.
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::FloatVal c(-8, 8)
bool one(const Gecode::FloatValArgs &a)
Check whether has only one coefficients.
Gecode::IntArgs i({1, 2, 3, 4})
Multi _d(Gecode::IntArgs({3, 2, 1}))
void dummy(Space &)
A dummy function for branching.