34namespace Gecode {
namespace Int {
namespace Linear {
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) {
108 for (
int i=0; i<
n; i++)
112 if (
y.max()+c == 0) {
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) {
150 for (
int i=0; i<
n; i++)
154 if (
y.max()+c == 0) {
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()))
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()))
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--; )
int p
Number of positive literals for node type.
int n
Number of negative literals for node type.
Base-class for both propagators and branchers.
virtual size_t dispose(Space &home)
Delete actor and return its size.
Home class for posting propagators
Propagator for integer equal to Boolean sum (cardinality)
static ExecStatus post(Home home, ViewArray< VX > &x, int c)
Post propagator for .
Propagator for equality to Boolean sum (cardinality)
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.
Propagator for integer less or equal to Boolean sum (cardinality)
static ExecStatus post(Home home, ViewArray< VX > &x, int c)
Post propagator for .
Propagator for greater or equal to Boolean sum (cardinality)
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.
Base-class for Boolean linear propagators.
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.
static ExecStatus post(Home home, ViewArray< VX > &b, int c)
Post propagator for .
Propagator for disequality to Boolean sum (cardinality)
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.
Base-class for propagators.
bool assigned(void) const
Test whether view is assigned.
void update(Space &home, ViewArray< View > &a)
Update array to be a clone of array a.
void subscribe(Space &home, Propagator &p, PropCond pc, bool schedule=true)
Subscribe propagator p with propagation condition pc to variable.
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.
#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
Post propagator for SetVar SetOpType SetVar y
@ ES_OK
Execution is okay.
@ ES_FIX
Propagation has computed fixpoint.
Post propagator for SetVar x