Go to the documentation of this file.
34 namespace 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--; )
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 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)
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 both propagators and branchers.
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.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
void update(Space &home, ViewArray< View > &a)
Update array to be a clone of array a.
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)
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.
EqBoolView(Space &home, EqBoolView &p)
Constructor for cloning p.
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 ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual Actor * copy(Space &home)
Create copy during cloning.
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.
virtual Actor * copy(Space &home)
Create copy during cloning.
NqBoolView(Space &home, NqBoolView &p)
Constructor for cloning p.
#define GECODE_ME_CHECK(me)
Check whether modification event me is failed, and forward failure.
LinBoolView(Space &home, LinBoolView &p)
Constructor for cloning p.
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.
Gecode::IntArgs i({1, 2, 3, 4})
#define GECODE_REWRITE(prop, post)
Rewrite propagator by executing post function.
@ ES_OK
Execution is okay.
int p
Number of positive literals for node type.
Propagator for disequality to Boolean sum (cardinality)