Go to the documentation of this file.
38 namespace Gecode {
namespace Int {
namespace Linear {
44 template<
class XV,
class YV>
53 template<
class XV,
class YV>
62 template<
class XV,
class YV>
67 y.update(home,share,
p.y);
70 template<
class XV,
class YV>
76 template<
class XV,
class YV>
88 template<
class XV,
class YV>
93 template<
class XV,
class YV>
99 for (
int i =
n;
i--; )
102 }
else if (
x[
i].zero()) {
110 if (
y.min()+
c ==
n) {
112 for (
int i =
n;
i--; )
116 if (
y.max()+
c == 0) {
118 for (
int i =
n;
i--; )
126 template<
class XV,
class YV>
131 template<
class XV,
class YV>
137 template<
class XV,
class YV>
141 for (
int i =
n;
i--; )
144 }
else if (
x[
i].zero()) {
152 if (
y.min()+
c ==
n) {
154 for (
int i =
n;
i--; )
158 if (
y.max()+
c == 0) {
160 for (
int i =
n;
i--; )
174 template<
class XV,
class YV>
179 template<
class XV,
class YV>
185 for (
int i =
n;
i--; )
188 }
else if (
x[
i].zero()) {
192 if ((
n-
c <
y.min() ) || (-
c >
y.max()))
199 if (
y.val()+
c == 1) {
202 assert(
y.val()+
c == 0);
212 template<
class XV,
class YV>
217 template<
class XV,
class YV>
223 template<
class XV,
class YV>
227 for (
int i =
n;
i--; )
230 }
else if (
x[
i].zero()) {
234 if ((
n-
c <
y.min() ) || (-
c >
y.max()))
241 if (
y.val()+
c == 1) {
244 assert(
y.val()+
c == 0);
257 template<
class XV,
class YV>
262 template<
class XV,
class YV>
269 for (
int i =
n;
i--; )
272 }
else if (
x[
i].zero()) {
279 if (
y.min()+
c ==
n) {
280 for (
int i =
n;
i--; )
289 template<
class XV,
class YV>
294 template<
class XV,
class YV>
300 template<
class XV,
class YV>
304 for (
int i =
n;
i--; )
307 }
else if (
x[
i].zero()) {
314 if (
y.min()+
c ==
n) {
315 for (
int i =
n;
i--; )
Post propagator for SetVar x
static ExecStatus post(Home home, ViewArray< XV > &x, YV y, int c)
Post propagator for .
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Post propagator for SetVar SetOpType SetVar y
void update(Space &, bool share, 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)
static ExecStatus post(Home home, ViewArray< XV > &x, YV y, int c)
Post propagator for .
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as low linear)
Gecode::IntArgs i(4, 1, 2, 3, 4)
static PropCost linear(PropCost::Mod m, unsigned int n)
Linear complexity for modifier pcm and size measure n.
Base-class for both propagators and branchers.
EqBoolView(Space &home, bool share, EqBoolView &p)
Constructor for cloning p.
bool assigned(void) const
Test whether view is assigned.
Propagator for integer less or equal to Boolean sum (cardinality)
Propagator for integer equal to Boolean sum (cardinality)
static ExecStatus post(Home home, ViewArray< VX > &b, int c)
Post propagator for .
Gecode toplevel namespace
Base-class for propagators.
NqBoolView(Space &home, bool share, NqBoolView &p)
Constructor for cloning p.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
static ExecStatus post(Home home, ViewArray< VX > &x, int c)
Post propagator for .
Propagator for equality to Boolean sum (cardinality)
Home class for posting propagators
Propagator for greater or equal to Boolean sum (cardinality)
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
LinBoolView(Space &home, bool share, LinBoolView &p)
Constructor for cloning p.
YV y
View to compare number of assigned Boolean views to.
bool one(const Gecode::FloatValArgs &a)
Check whether has only one coefficients.
virtual void reschedule(Space &home)
Schedule function.
Base-class for Boolean linear propagators.
static ExecStatus post(Home home, ViewArray< VX > &x, int c)
Post propagator for .
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
const Gecode::PropCond PC_INT_BND
Propagate when minimum or maximum of a view changes.
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.
const Gecode::PropCond PC_INT_VAL
Propagate when a view becomes assigned (single value)
@ ES_FIX
Propagation has computed fixpoint.
ViewArray< XV > x
Boolean views.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
virtual size_t dispose(Space &home)
Delete actor and return its size.
Gecode::FloatVal c(-8, 8)
int n
Number of negative literals for node type.
int ModEventDelta
Modification event deltas.
#define GECODE_REWRITE(prop, post)
Rewrite propagator by executing post function.
virtual Actor * copy(Space &home, bool share)
Create copy during cloning.
@ ES_OK
Execution is okay.
int p
Number of positive literals for node type.
Propagator for disequality to Boolean sum (cardinality)
GqBoolView(Space &home, bool share, GqBoolView &p)
Constructor for cloning p.