40 template<
class XV,
class YV>
49 template<
class XV,
class YV>
58 template<
class XV,
class YV>
66 template<
class XV,
class YV>
72 template<
class XV,
class YV>
84 template<
class XV,
class YV>
89 template<
class XV,
class YV>
98 }
else if (
x[i].zero()) {
106 if (
y.min()+
c == n) {
107 assert(
y.assigned());
108 for (
int i=0; i<n; i++)
112 if (
y.max()+
c == 0) {
113 assert(
y.assigned());
114 for (
int i=0; i<n; i++)
122 template<
class XV,
class YV>
127 template<
class XV,
class YV>
133 template<
class XV,
class YV>
140 }
else if (
x[i].zero()) {
148 if (
y.min()+
c == n) {
149 assert(
y.assigned());
150 for (
int i=0; i<n; i++)
154 if (
y.max()+
c == 0) {
155 assert(
y.assigned());
156 for (
int i=0; i<n; i++)
170 template<
class XV,
class YV>
175 template<
class XV,
class YV>
181 for (
int i = n; i--; )
184 }
else if (
x[i].zero()) {
188 if ((n-
c <
y.min() ) || (-
c >
y.max()))
194 if ((n == 1) &&
y.assigned()) {
195 if (
y.val()+
c == 1) {
198 assert(
y.val()+
c == 0);
208 template<
class XV,
class YV>
213 template<
class XV,
class YV>
219 template<
class XV,
class YV>
223 for (
int i = n; i--; )
226 }
else if (
x[i].zero()) {
230 if ((n-
c <
y.min() ) || (-
c >
y.max()))
236 if ((n == 1) &&
y.assigned()) {
237 if (
y.val()+
c == 1) {
240 assert(
y.val()+
c == 0);
253 template<
class XV,
class YV>
258 template<
class XV,
class YV>
265 for (
int i = n; i--; )
268 }
else if (
x[i].zero()) {
275 if (
y.min()+
c == n) {
276 for (
int i = n; i--; )
285 template<
class XV,
class YV>
290 template<
class XV,
class YV>
296 template<
class XV,
class YV>
300 for (
int i = n; i--; )
303 }
else if (
x[i].zero()) {
310 if (
y.min()+
c == n) {
311 for (
int i = n; i--; )
Base-class for both propagators and branchers.
virtual size_t dispose(Space &home)
Delete actor and return its size.
Home class for posting propagators
static ExecStatus post(Home home, ViewArray< VX > &x, int c)
Post propagator for .
EqBoolView(Space &home, EqBoolView &p)
Constructor for cloning p.
static ExecStatus post(Home home, ViewArray< XV > &x, YV y, int c)
Post propagator for .
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual Actor * copy(Space &home)
Create copy during cloning.
static ExecStatus post(Home home, ViewArray< VX > &x, int c)
Post propagator for .
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
GqBoolView(Space &home, GqBoolView &p)
Constructor for cloning p.
static ExecStatus post(Home home, ViewArray< XV > &x, YV y, int c)
Post propagator for .
virtual Actor * copy(Space &home)
Create copy during cloning.
LinBoolView(Space &home, LinBoolView &p)
Constructor for cloning p.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
virtual void reschedule(Space &home)
Schedule function.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low linear)
YV y
View to compare number of assigned Boolean views to.
ViewArray< XV > x
Boolean views.
int c
Righthandside (constant part from Boolean views assigned to 1)
static ExecStatus post(Home home, ViewArray< VX > &b, int c)
Post propagator for .
NqBoolView(Space &home, NqBoolView &p)
Constructor for cloning p.
static ExecStatus post(Home home, ViewArray< XV > &x, YV y, int c)
Post propagator for .
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual Actor * copy(Space &home)
Create copy during cloning.
static PropCost linear(PropCost::Mod m, unsigned int n)
Linear complexity for modifier pcm and size measure n.
Propagator(Home home)
Constructor for posting.
ExecStatus ES_SUBSUMED(Propagator &p)
Propagator p is subsumed
int ModEventDelta
Modification event deltas.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
#define GECODE_REWRITE(prop, post)
Rewrite propagator by executing post function.
const Gecode::PropCond PC_INT_VAL
Propagate when a view becomes assigned (single value)
const Gecode::PropCond PC_INT_BND
Propagate when minimum or maximum of a view changes.
Gecode toplevel namespace
@ ES_OK
Execution is okay.
@ ES_FIX
Propagation has computed fixpoint.