Generated on Sat Feb 7 2015 02:01:16 for Gecode by doxygen 1.8.9.1
rel.cpp
Go to the documentation of this file.
1 /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2 /*
3  * Main authors:
4  * Christian Schulte <schulte@gecode.org>
5  *
6  * Copyright:
7  * Christian Schulte, 2005
8  *
9  * Last modified:
10  * $Date: 2011-11-29 17:20:37 +0100 (Tue, 29 Nov 2011) $ by $Author: schulte $
11  * $Revision: 12486 $
12  *
13  * This file is part of Gecode, the generic constraint
14  * development environment:
15  * http://www.gecode.org
16  *
17  * Permission is hereby granted, free of charge, to any person obtaining
18  * a copy of this software and associated documentation files (the
19  * "Software"), to deal in the Software without restriction, including
20  * without limitation the rights to use, copy, modify, merge, publish,
21  * distribute, sublicense, and/or sell copies of the Software, and to
22  * permit persons to whom the Software is furnished to do so, subject to
23  * the following conditions:
24  *
25  * The above copyright notice and this permission notice shall be
26  * included in all copies or substantial portions of the Software.
27  *
28  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
29  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
30  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
31  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
32  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
33  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
34  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
35  *
36  */
37 
38 #include "test/int.hh"
39 
40 #include <gecode/minimodel.hh>
41 
42 namespace Test { namespace Int {
43 
45  namespace Rel {
46 
52  class IntVarXY : public Test {
54  protected:
57  public:
60  : Test("Rel::Int::Var::XY::"+str(irt0)+"::"+str(icl)+"::"+str(n),
61  n+1,-3,3,n==1,icl),
62  irt(irt0) {}
64  virtual bool solution(const Assignment& x) const {
65  if (x.size() == 2) {
66  return cmp(x[0],irt,x[1]);
67  } else {
68  return cmp(x[0],irt,x[2]) && cmp(x[1],irt,x[2]);
69  }
70  }
72  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
73  using namespace Gecode;
74  if (x.size() == 2) {
75  rel(home, x[0], irt, x[1], icl);
76  } else {
77  IntVarArgs y(2);
78  y[0]=x[0]; y[1]=x[1];
79  rel(home, y, irt, x[2], icl);
80  }
81  }
83  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x,
84  Gecode::Reify r) {
85  assert(x.size() == 2);
86  Gecode::rel(home, x[0], irt, x[1], r, icl);
87  }
88  };
89 
91  class IntVarXX : public Test {
92  protected:
95  public:
98  : Test("Rel::Int::Var::XX::"+str(irt0)+"::"+str(icl),
99  1,-3,3,true,icl),
100  irt(irt0) {
101  contest = ((irt != Gecode::IRT_LE) &&
102  (irt != Gecode::IRT_GR) &&
103  (irt != Gecode::IRT_NQ))
104  ? CTL_DOMAIN : CTL_NONE;
105  }
107  virtual bool solution(const Assignment& x) const {
108  return cmp(x[0],irt,x[0]);
109  }
111  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
112  Gecode::rel(home, x[0], irt, x[0], icl);
113  }
115  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x,
116  Gecode::Reify r) {
117  Gecode::rel(home, x[0], irt, x[0], r, icl);
118  }
119  };
120 
122  class BoolVarXY : public Test {
123  protected:
126  public:
129  : Test("Rel::Bool::Var::XY::"+str(irt0)+"::"+str(n),n+1,0,1,
130  n==1),
131  irt(irt0) {}
133  virtual bool solution(const Assignment& x) const {
134  if (x.size() == 2) {
135  return cmp(x[0],irt,x[1]);
136  } else {
137  return cmp(x[0],irt,x[2]) && cmp(x[1],irt,x[2]);
138  }
139  }
141  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
142  using namespace Gecode;
143  if (x.size() == 2) {
144  rel(home, channel(home,x[0]), irt, channel(home,x[1]));
145  } else {
146  BoolVarArgs y(2);
147  y[0]=channel(home,x[0]); y[1]=channel(home,x[1]);
148  rel(home, y, irt, channel(home,x[2]));
149  }
150  }
152  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x,
153  Gecode::Reify r) {
154  assert(x.size() == 2);
155  using namespace Gecode;
156  rel(home,
157  channel(home,x[0]), irt, channel(home,x[1]),
158  r);
159  }
160  };
161 
163  class BoolVarXX : public Test {
164  protected:
167  public:
170  : Test("Rel::Bool::Var::XX::"+str(irt0),1,0,1),
171  irt(irt0) {
172  contest = ((irt != Gecode::IRT_LE) &&
173  (irt != Gecode::IRT_GR) &&
174  (irt != Gecode::IRT_NQ))
175  ? CTL_DOMAIN : CTL_NONE;
176  }
178  virtual bool solution(const Assignment& x) const {
179  return cmp(x[0],irt,x[0]);
180  }
182  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
183  Gecode::BoolVar b = Gecode::channel(home,x[0]);
184  Gecode::rel(home, b, irt, b);
185  }
186  };
187 
189  class IntInt : public Test {
190  protected:
194  int c;
195  public:
197  IntInt(Gecode::IntRelType irt0, int n, int c0)
198  : Test("Rel::Int::Int::"+str(irt0)+"::"+str(n)+"::"+str(c0),
199  n,-3,3,n==1),
200  irt(irt0), c(c0) {}
202  virtual bool solution(const Assignment& x) const {
203  if (x.size() == 1)
204  return cmp(x[0],irt,c);
205  else
206  return cmp(x[0],irt,c) && cmp(x[1],irt,c);
207  }
209  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
210  using namespace Gecode;
211  if (x.size() == 1)
212  rel(home, x[0], irt, c);
213  else
214  rel(home, x, irt, c);
215  }
217  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x,
218  Gecode::Reify r) {
219  assert(x.size() == 1);
220  Gecode::rel(home, x[0], irt, c, r);
221  }
222  };
223 
225  class BoolInt : public Test {
226  protected:
230  int c;
231  public:
233  BoolInt(Gecode::IntRelType irt0, int n, int c0)
234  : Test("Rel::Bool::Int::"+str(irt0)+"::"+str(n)+"::"+str(c0),n,0,1,
235  n==1),
236  irt(irt0), c(c0) {}
238  virtual bool solution(const Assignment& x) const {
239  if (x.size() == 1)
240  return cmp(x[0],irt,c);
241  else
242  return cmp(x[0],irt,c) && cmp(x[1],irt,c);
243  }
245  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
246  using namespace Gecode;
247  if (x.size() == 1) {
248  rel(home, channel(home,x[0]), irt, c);
249  } else {
250  BoolVarArgs y(2);
251  y[0]=channel(home,x[0]); y[1]=channel(home,x[1]);
252  rel(home, y, irt, c);
253  }
254  }
256  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x,
257  Gecode::Reify r) {
258  assert(x.size() == 1);
259  using namespace Gecode;
260  rel(home, channel(home,x[0]), irt, c, r);
261  }
262  };
263 
265  class IntSeq : public Test {
266  protected:
269  public:
272  : Test("Rel::Int::Seq::"+str(n)+"::"+str(irt0)+"::"+str(icl),
273  n,-3,3,false,icl),
274  irt(irt0) {}
276  virtual bool solution(const Assignment& x) const {
277  if (irt == Gecode::IRT_NQ) {
278  if (x.size() < 2)
279  return false;
280  for (int i=0; i<x.size()-1; i++)
281  if (x[i] != x[i+1])
282  return true;
283  return false;
284  } else {
285  for (int i=0; i<x.size()-1; i++)
286  if (!cmp(x[i],irt,x[i+1]))
287  return false;
288  return true;
289  }
290  }
292  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
293  Gecode::rel(home, x, irt, icl);
294  }
295  };
296 
298  class IntSharedSeq : public Test {
299  protected:
302  public:
305  : Test("Rel::Int::Seq::Shared::"+str(n)+"::"+str(irt0)+"::"+str(icl),
306  n,-3,3,false,icl),
307  irt(irt0) {}
309  virtual bool solution(const Assignment& x) const {
310  if (irt == Gecode::IRT_NQ) {
311  if (x.size() < 2)
312  return false;
313  for (int i=0; i<x.size()-1; i++)
314  if (x[i] != x[i+1])
315  return true;
316  return false;
317  } else {
318  int n = x.size();
319  for (int i=0; i<2*n-1; i++)
320  if (!cmp(x[i % n],irt,x[(i+1) % n]))
321  return false;
322  return true;
323  }
324  }
326  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
327  using namespace Gecode;
328  int n = x.size();
329  IntVarArgs y(2*n);
330  for (int i=n; i--; )
331  y[i] = y[n+i] = x[i];
332  rel(home, y, irt, icl);
333  }
334  };
335 
337  class BoolSeq : public Test {
338  protected:
341  public:
344  : Test("Rel::Bool::Seq::"+str(n)+"::"+str(irt0),n,0,1),
345  irt(irt0) {}
347  virtual bool solution(const Assignment& x) const {
348  if (irt == Gecode::IRT_NQ) {
349  if (x.size() < 2)
350  return false;
351  for (int i=0; i<x.size()-1; i++)
352  if (x[i] != x[i+1])
353  return true;
354  return false;
355  } else {
356  for (int i=0; i<x.size()-1; i++)
357  if (!cmp(x[i],irt,x[i+1]))
358  return false;
359  return true;
360  }
361  }
363  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
364  using namespace Gecode;
365  BoolVarArgs b(x.size());
366  for (int i=x.size(); i--; )
367  b[i]=channel(home,x[i]);
368  rel(home, b, irt);
369  }
370  };
371 
373  class BoolSharedSeq : public Test {
374  protected:
377  public:
380  : Test("Rel::Bool::Seq::Shared::"+str(n)+"::"+str(irt0),n,0,1),
381  irt(irt0) {}
383  virtual bool solution(const Assignment& x) const {
384  if (irt == Gecode::IRT_NQ) {
385  if (x.size() < 2)
386  return false;
387  for (int i=0; i<x.size()-1; i++)
388  if (x[i] != x[i+1])
389  return true;
390  return false;
391  } else {
392  int n = x.size();
393  for (int i=0; i<2*n-1; i++)
394  if (!cmp(x[i % n],irt,x[(i+1) % n]))
395  return false;
396  return true;
397  }
398  }
400  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
401  using namespace Gecode;
402  int n = x.size();
403  BoolVarArgs b(2*n);
404  for (int i=n; i--; )
405  b[i]=b[n+i]=channel(home,x[i]);
406  rel(home, b, irt);
407  }
408  };
409 
411  class IntArray : public Test {
412  protected:
415  public:
418  : Test("Rel::Int::Array::"+str(irt0),6,-2,2), irt(irt0) {}
420  virtual bool solution(const Assignment& x) const {
421  int n=x.size() >> 1;
422  for (int i=0; i<n; i++)
423  if (x[i] != x[n+i])
424  return cmp(x[i],irt,x[n+i]);
425  return ((irt == Gecode::IRT_LQ) || (irt == Gecode::IRT_GQ) ||
426  (irt == Gecode::IRT_EQ));
427  GECODE_NEVER;
428  return false;
429  }
431  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
432  using namespace Gecode;
433  int n=x.size() >> 1;
434  IntVarArgs y(n); IntVarArgs z(n);
435  for (int i=0; i<n; i++) {
436  y[i]=x[i]; z[i]=x[n+i];
437  }
438  rel(home, y, irt, z);
439  }
440  };
441 
443  class IntArrayDiff : public Test {
444  protected:
448  static const int n = 4;
450  int n_fst;
451  public:
454  : Test("Rel::Int::Array::"+str(irt0)+"::"+str(m)+"::"+str(n-m),
455  n,-2,2),
456  irt(irt0), n_fst(m) {
457  assert(n_fst <= n);
458  }
460  virtual bool solution(const Assignment& x) const {
461  int n_snd = n - n_fst;
462  for (int i=0; i<std::min(n_fst,n_snd); i++)
463  if (x[i] != x[n_fst+i])
464  return cmp(x[i],irt,x[n_fst+i]);
465  return cmp(n_fst,irt,n_snd);
466  }
468  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
469  using namespace Gecode;
470  int n_snd = n - n_fst;
471  IntVarArgs y(n_fst); IntVarArgs z(n_snd);
472  for (int i=0; i<n_fst; i++) {
473  y[i]=x[i];
474  }
475  for (int i=0; i<n_snd; i++) {
476  z[i]=x[n_fst + i];
477  }
478  rel(home, y, irt, z);
479  }
480  };
481 
483  class BoolArray : public Test {
484  protected:
487  public:
490  : Test("Rel::Bool::Array::"+str(irt0),10,0,1), irt(irt0) {}
492  virtual bool solution(const Assignment& x) const {
493  int n=x.size() >> 1;
494  for (int i=0; i<n; i++)
495  if (x[i] != x[n+i])
496  return cmp(x[i],irt,x[n+i]);
497  return ((irt == Gecode::IRT_LQ) || (irt == Gecode::IRT_GQ) ||
498  (irt == Gecode::IRT_EQ));
499  GECODE_NEVER;
500  return false;
501  }
503  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
504  using namespace Gecode;
505  int n=x.size() >> 1;
506  BoolVarArgs y(n); BoolVarArgs z(n);
507  for (int i=0; i<n; i++) {
508  y[i]=channel(home,x[i]); z[i]=channel(home,x[n+i]);
509  }
510  rel(home, y, irt, z);
511  }
512  };
513 
515  class Create {
516  public:
518  Create(void) {
519  using namespace Gecode;
520  for (IntRelTypes irts; irts(); ++irts) {
521  for (IntConLevels icls; icls(); ++icls) {
522  (void) new IntVarXY(irts.irt(),1,icls.icl());
523  (void) new IntVarXY(irts.irt(),2,icls.icl());
524  (void) new IntVarXX(irts.irt(),icls.icl());
525  (void) new IntSeq(1,irts.irt(),icls.icl());
526  (void) new IntSeq(2,irts.irt(),icls.icl());
527  (void) new IntSeq(3,irts.irt(),icls.icl());
528  (void) new IntSeq(5,irts.irt(),icls.icl());
529  (void) new IntSharedSeq(1,irts.irt(),icls.icl());
530  (void) new IntSharedSeq(2,irts.irt(),icls.icl());
531  (void) new IntSharedSeq(3,irts.irt(),icls.icl());
532  (void) new IntSharedSeq(4,irts.irt(),icls.icl());
533  }
534  (void) new BoolVarXY(irts.irt(),1);
535  (void) new BoolVarXY(irts.irt(),2);
536  (void) new BoolVarXX(irts.irt());
537  (void) new BoolSeq(1,irts.irt());
538  (void) new BoolSeq(2,irts.irt());
539  (void) new BoolSeq(3,irts.irt());
540  (void) new BoolSeq(10,irts.irt());
541  (void) new BoolSharedSeq(1,irts.irt());
542  (void) new BoolSharedSeq(2,irts.irt());
543  (void) new BoolSharedSeq(3,irts.irt());
544  (void) new BoolSharedSeq(4,irts.irt());
545  (void) new BoolSharedSeq(8,irts.irt());
546  for (int c=-4; c<=4; c++) {
547  (void) new IntInt(irts.irt(),1,c);
548  (void) new IntInt(irts.irt(),2,c);
549  }
550  for (int c=0; c<=1; c++) {
551  (void) new BoolInt(irts.irt(),1,c);
552  (void) new BoolInt(irts.irt(),2,c);
553  }
554  (void) new IntArray(irts.irt());
555  for (int n_fst=0; n_fst<=4; n_fst++)
556  (void) new IntArrayDiff(irts.irt(),n_fst);
557  (void) new BoolArray(irts.irt());
558  }
559  }
560  };
561 
564 
565  }
566 }}
567 
568 // STATISTICS: test-int
Test for relation between same sized arrays of integer variables
Definition: rel.cpp:411
Test for relation between arrays of Boolean variables
Definition: rel.cpp:483
Test for relation between differently sized arrays of integer variables
Definition: rel.cpp:443
BoolVarXY(Gecode::IntRelType irt0, int n)
Create and register test.
Definition: rel.cpp:128
BoolVarXX(Gecode::IntRelType irt0)
Create and register test.
Definition: rel.cpp:169
IntSharedSeq(int n, Gecode::IntRelType irt0, Gecode::IntConLevel icl)
Create and register test.
Definition: rel.cpp:304
IntConLevel
Consistency levels for integer propagators.
Definition: int.hh:937
virtual bool solution(const Assignment &x) const
Test whether x is solution
Definition: rel.cpp:276
void channel(Home home, FloatVar x0, IntVar x1)
Post propagator for channeling a float and an integer variable .
Definition: arithmetic.cpp:218
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Definition: rel.cpp:111
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x, Gecode::Reify r)
Post reified constraint on x for r.
Definition: rel.cpp:115
virtual bool solution(const Assignment &x) const
Test whether x is solution
Definition: rel.cpp:347
static bool cmp(T x, Gecode::IntRelType r, T y)
Compare x and y with respect to r.
Definition: int.hpp:284
Less or equal ( )
Definition: int.hh:906
Gecode::IntRelType irt
Integer relation type to propagate.
Definition: rel.cpp:340
Help class to create and register tests.
Definition: rel.cpp:515
IntVarXX(Gecode::IntRelType irt0, Gecode::IntConLevel icl)
Create and register test.
Definition: rel.cpp:97
Create(void)
Perform creation and registration.
Definition: rel.cpp:518
Iterator for integer consistency levels.
Definition: int.hh:324
Integer variable array.
Definition: int.hh:741
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Definition: rel.cpp:468
BoolSeq(int n, Gecode::IntRelType irt0)
Create and register test.
Definition: rel.cpp:343
Greater ( )
Definition: int.hh:909
Test for simple relation involving integer variables
Definition: rel.cpp:53
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Definition: rel.cpp:182
ConTestLevel contest
Whether to test for certain consistency.
Definition: int.hh:228
Gecode::IntRelType irt
Integer relation type to propagate.
Definition: rel.cpp:446
virtual bool solution(const Assignment &x) const
Test whether x is solution
Definition: rel.cpp:178
Computation spaces.
Definition: core.hpp:1362
Greater or equal ( )
Definition: int.hh:908
Gecode::IntRelType irt
Integer relation type to propagate.
Definition: rel.cpp:376
IntInt(Gecode::IntRelType irt0, int n, int c0)
Create and register test.
Definition: rel.cpp:197
virtual bool solution(const Assignment &x) const
Test whether x is solution
Definition: rel.cpp:64
virtual bool solution(const Assignment &x) const
Test whether x is solution
Definition: rel.cpp:492
BoolSharedSeq(int n, Gecode::IntRelType irt0)
Create and register test.
Definition: rel.cpp:379
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Definition: rel.cpp:326
Gecode::IntRelType irt
Integer relation type to propagate.
Definition: rel.cpp:94
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Definition: rel.cpp:400
static std::string str(Gecode::ExtensionalPropKind epk)
Map extensional propagation kind to string.
Definition: int.hpp:212
Test for sequence of relations between shared Boolean variables
Definition: rel.cpp:373
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Definition: rel.cpp:245
virtual bool solution(const Assignment &x) const
Test whether x is solution
Definition: rel.cpp:383
const FloatNum min
Smallest allowed float value.
Definition: float.hh:833
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
Definition: bool-expr.cpp:238
Equality ( )
Definition: int.hh:904
Gecode::IntRelType irt
Integer relation type to propagate.
Definition: rel.cpp:301
No consistency-test.
Definition: int.hh:144
Gecode::IntConLevel icl
Consistency level.
Definition: int.hh:226
void rel(Home home, IntVar x, SetRelType rt, SetVar s, Reify r)
Post propagator for .
Definition: rel.cpp:229
IntRelType
Relation types for integers.
Definition: int.hh:903
NNF * r
Right subtree.
Definition: bool-expr.cpp:246
IntArray(Gecode::IntRelType irt0)
Create and register test.
Definition: rel.cpp:417
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x, Gecode::Reify r)
Post reified constraint on x for r.
Definition: rel.cpp:256
Gecode::IntRelType irt
Integer relation type to propagate.
Definition: rel.cpp:56
Gecode::IntRelType irt
Integer relation type to propagate.
Definition: rel.cpp:166
Iterator for integer relation types.
Definition: int.hh:342
Test for simple relation involving shared integer variables
Definition: rel.cpp:91
virtual bool solution(const Assignment &x) const
Test whether x is solution
Definition: rel.cpp:309
Reification specification.
Definition: int.hh:854
Gecode::IntRelType irt
Integer relation type to propagate.
Definition: rel.cpp:192
Test for simple relation involving shared Boolean variables
Definition: rel.cpp:163
int c
Integer constant.
Definition: rel.cpp:194
Test for simple relation involving Boolean variable and integer constant
Definition: rel.cpp:225
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Definition: rel.cpp:503
Less ( )
Definition: int.hh:907
Test for domain-consistency.
Definition: int.hh:145
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Definition: rel.cpp:292
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Definition: rel.cpp:363
int n_fst
How big is the first array.
Definition: rel.cpp:450
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Definition: rel.cpp:141
Passing integer variables.
Definition: int.hh:636
Passing Boolean variables.
Definition: int.hh:690
Test for sequence of relations between shared integer variables
Definition: rel.cpp:298
Gecode::IntRelType irt
Integer relation type to propagate.
Definition: rel.cpp:228
Boolean integer variables.
Definition: int.hh:491
Gecode::IntRelType irt
Integer relation type to propagate.
Definition: rel.cpp:125
Create c
Definition: rel.cpp:562
General test support.
Definition: afc.cpp:43
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x, Gecode::Reify r)
Post reified constraint on x for r.
Definition: rel.cpp:152
IntSeq(int n, Gecode::IntRelType irt0, Gecode::IntConLevel icl)
Create and register test.
Definition: rel.cpp:271
Gecode::IntRelType irt
Integer relation type to propagate.
Definition: rel.cpp:486
Node * x
Pointer to corresponding Boolean expression node.
Definition: bool-expr.cpp:253
Test for sequence of relations between Boolean variables
Definition: rel.cpp:337
virtual bool solution(const Assignment &x) const
Test whether x is solution
Definition: rel.cpp:107
virtual bool solution(const Assignment &x) const
Test whether x is solution
Definition: rel.cpp:133
Base class for assignments
Definition: int.hh:63
Test for simple relation involving Boolean variables
Definition: rel.cpp:122
BoolArray(Gecode::IntRelType irt0)
Create and register test.
Definition: rel.cpp:489
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
Definition: rel.cpp:47
virtual bool solution(const Assignment &x) const
Test whether x is solution
Definition: rel.cpp:238
Gecode::IntRelType irt
Integer relation type to propagate.
Definition: rel.cpp:414
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Definition: rel.cpp:209
virtual bool solution(const Assignment &x) const
Test whether x is solution
Definition: rel.cpp:420
virtual bool solution(const Assignment &x) const
Test whether x is solution
Definition: rel.cpp:202
IntVarXY(Gecode::IntRelType irt0, int n, Gecode::IntConLevel icl)
Create and register test.
Definition: rel.cpp:59
struct Gecode::@518::NNF::@57::@58 b
For binary nodes (and, or, eqv)
Gecode toplevel namespace
Test for simple relation involving integer variable and integer constant
Definition: rel.cpp:189
Disequality ( )
Definition: int.hh:905
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x, Gecode::Reify r)
Post reified constraint on x for r.
Definition: rel.cpp:217
int size(void) const
Return size of array (number of elements)
Definition: array.hpp:985
virtual bool solution(const Assignment &x) const
Test whether x is solution
Definition: rel.cpp:460
#define GECODE_NEVER
Assert that this command is never executed.
Definition: macros.hpp:60
BoolInt(Gecode::IntRelType irt0, int n, int c0)
Create and register test.
Definition: rel.cpp:233
Gecode::IntRelType irt
Integer relation type to propagate.
Definition: rel.cpp:268
Test for sequence of relations between integer variables
Definition: rel.cpp:265
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Definition: rel.cpp:72
int size(void) const
Return number of variables.
Definition: int.hpp:50
IntArrayDiff(Gecode::IntRelType irt0, int m)
Create and register test.
Definition: rel.cpp:453
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Definition: rel.cpp:431
int c
Integer constant.
Definition: rel.cpp:230
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x, Gecode::Reify r)
Post reified constraint on x for r.
Definition: rel.cpp:83