Generated on Sat Jul 28 2018 17:11:27 for Gecode by doxygen 1.8.14
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: 2016-11-08 17:23:24 +0100 (Tue, 08 Nov 2016) $ by $Author: schulte $
11  * $Revision: 15253 $
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(ipl)+"::"+str(n),
61  n+1,-3,3,n==1,ipl),
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], ipl);
76  } else {
77  IntVarArgs y(2);
78  y[0]=x[0]; y[1]=x[1];
79  rel(home, y, irt, x[2], ipl);
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, ipl);
87  }
88  };
89 
91  class IntVarXX : public Test {
92  protected:
95  public:
98  : Test("Rel::Int::Var::XX::"+str(irt0)+"::"+str(ipl),
99  1,-3,3,true,ipl),
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], ipl);
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, ipl);
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(ipl),
273  n,-3,3,false,ipl),
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, ipl);
294  }
295  };
296 
298  class IntSharedSeq : public Test {
299  protected:
302  public:
305  : Test("Rel::Int::Seq::Shared::"+str(n)+"::"+str(irt0)+"::"+str(ipl),
306  n,-3,3,false,ipl),
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, ipl);
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 IntArrayVar : public Test {
412  protected:
415  public:
418  : Test("Rel::Int::Array::Var::"+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 IntArrayInt : public Test {
444  protected:
447  public:
450  : Test("Rel::Int::Array::Int::"+str(irt0),3,-2,2), irt(irt0) {}
452  virtual bool solution(const Assignment& x) const {
453  Gecode::IntArgs y(3, 0,0,0);
454  int n=x.size();
455  for (int i=0; i<n; i++)
456  if (x[i] != y[i])
457  return cmp(x[i],irt,y[i]);
458  return ((irt == Gecode::IRT_LQ) || (irt == Gecode::IRT_GQ) ||
459  (irt == Gecode::IRT_EQ));
460  GECODE_NEVER;
461  return false;
462  }
464  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
465  using namespace Gecode;
466  IntArgs y(3, 0,0,0);
467  rel(home, x, irt, y);
468  }
469  };
470 
472  class IntArrayDiff : public Test {
473  protected:
477  static const int n = 4;
479  int n_fst;
480  public:
483  : Test("Rel::Int::Array::"+str(irt0)+"::"+str(m)+"::"+str(n-m),
484  n,-2,2),
485  irt(irt0), n_fst(m) {
486  assert(n_fst <= n);
487  }
489  virtual bool solution(const Assignment& x) const {
490  int n_snd = n - n_fst;
491  for (int i=0; i<std::min(n_fst,n_snd); i++)
492  if (x[i] != x[n_fst+i])
493  return cmp(x[i],irt,x[n_fst+i]);
494  return cmp(n_fst,irt,n_snd);
495  }
497  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
498  using namespace Gecode;
499  int n_snd = n - n_fst;
500  IntVarArgs y(n_fst); IntVarArgs z(n_snd);
501  for (int i=0; i<n_fst; i++) {
502  y[i]=x[i];
503  }
504  for (int i=0; i<n_snd; i++) {
505  z[i]=x[n_fst + i];
506  }
507  rel(home, y, irt, z);
508  }
509  };
510 
512  class BoolArrayVar : public Test {
513  protected:
516  public:
519  : Test("Rel::Bool::Array::Var::"+str(irt0),10,0,1), irt(irt0) {}
521  virtual bool solution(const Assignment& x) const {
522  int n=x.size() >> 1;
523  for (int i=0; i<n; i++)
524  if (x[i] != x[n+i])
525  return cmp(x[i],irt,x[n+i]);
526  return ((irt == Gecode::IRT_LQ) || (irt == Gecode::IRT_GQ) ||
527  (irt == Gecode::IRT_EQ));
528  GECODE_NEVER;
529  return false;
530  }
532  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
533  using namespace Gecode;
534  int n=x.size() >> 1;
536  for (int i=0; i<n; i++) {
537  y[i]=channel(home,x[i]); z[i]=channel(home,x[n+i]);
538  }
539  rel(home, y, irt, z);
540  }
541  };
542 
544  class BoolArrayInt : public Test {
545  protected:
548  public:
551  : Test("Rel::Bool::Array::Int::"+str(irt0),5,0,1), irt(irt0) {}
553  virtual bool solution(const Assignment& x) const {
554  Gecode::IntArgs y(5, 0,0,1,0,0);
555  for (int i=0; i<5; i++)
556  if (x[i] != y[i])
557  return cmp(x[i],irt,y[i]);
558  return ((irt == Gecode::IRT_LQ) || (irt == Gecode::IRT_GQ) ||
559  (irt == Gecode::IRT_EQ));
560  GECODE_NEVER;
561  return false;
562  }
564  virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) {
565  using namespace Gecode;
566  Gecode::IntArgs z(5, 0,0,1,0,0);
567  int n=x.size();
568  BoolVarArgs y(n);
569  for (int i=0; i<n; i++)
570  y[i]=channel(home,x[i]);
571  rel(home, y, irt, z);
572  }
573  };
574 
576  class Create {
577  public:
579  Create(void) {
580  using namespace Gecode;
581  for (IntRelTypes irts; irts(); ++irts) {
582  for (IntPropLevels ipls; ipls(); ++ipls) {
583  (void) new IntVarXY(irts.irt(),1,ipls.ipl());
584  (void) new IntVarXY(irts.irt(),2,ipls.ipl());
585  (void) new IntVarXX(irts.irt(),ipls.ipl());
586  (void) new IntSeq(1,irts.irt(),ipls.ipl());
587  (void) new IntSeq(2,irts.irt(),ipls.ipl());
588  (void) new IntSeq(3,irts.irt(),ipls.ipl());
589  (void) new IntSeq(5,irts.irt(),ipls.ipl());
590  (void) new IntSharedSeq(1,irts.irt(),ipls.ipl());
591  (void) new IntSharedSeq(2,irts.irt(),ipls.ipl());
592  (void) new IntSharedSeq(3,irts.irt(),ipls.ipl());
593  (void) new IntSharedSeq(4,irts.irt(),ipls.ipl());
594  }
595  (void) new BoolVarXY(irts.irt(),1);
596  (void) new BoolVarXY(irts.irt(),2);
597  (void) new BoolVarXX(irts.irt());
598  (void) new BoolSeq(1,irts.irt());
599  (void) new BoolSeq(2,irts.irt());
600  (void) new BoolSeq(3,irts.irt());
601  (void) new BoolSeq(10,irts.irt());
602  (void) new BoolSharedSeq(1,irts.irt());
603  (void) new BoolSharedSeq(2,irts.irt());
604  (void) new BoolSharedSeq(3,irts.irt());
605  (void) new BoolSharedSeq(4,irts.irt());
606  (void) new BoolSharedSeq(8,irts.irt());
607  for (int c=-4; c<=4; c++) {
608  (void) new IntInt(irts.irt(),1,c);
609  (void) new IntInt(irts.irt(),2,c);
610  }
611  for (int c=0; c<=1; c++) {
612  (void) new BoolInt(irts.irt(),1,c);
613  (void) new BoolInt(irts.irt(),2,c);
614  }
615  (void) new IntArrayVar(irts.irt());
616  (void) new IntArrayInt(irts.irt());
617  for (int n_fst=0; n_fst<=4; n_fst++)
618  (void) new IntArrayDiff(irts.irt(),n_fst);
619  (void) new BoolArrayVar(irts.irt());
620  (void) new BoolArrayInt(irts.irt());
621  }
622  }
623  };
624 
627 
628  }
629 }}
630 
631 // STATISTICS: test-int
virtual bool solution(const Assignment &x) const
Test whether x is solution
Definition: rel.cpp:553
Test for relation between differently sized arrays of integer variables
Definition: rel.cpp:472
IntVarXY(Gecode::IntRelType irt0, int n, Gecode::IntPropLevel ipl)
Create and register test.
Definition: rel.cpp:59
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
static std::string str(Gecode::IntPropLevel ipl)
Map integer propagation level to string.
Definition: int.hpp:212
BoolArrayInt(Gecode::IntRelType irt0)
Create and register test.
Definition: rel.cpp:550
virtual bool solution(const Assignment &x) const
Test whether x is solution
Definition: rel.cpp:64
void channel(Home home, FloatVar x0, IntVar x1)
Post propagator for channeling a float and an integer variable .
Definition: channel.cpp:45
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 void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Definition: rel.cpp:431
static bool cmp(T x, Gecode::IntRelType r, T y)
Compare x and y with respect to r.
Definition: int.hpp:279
BoolArrayVar(Gecode::IntRelType irt0)
Create and register test.
Definition: rel.cpp:518
Less or equal ( )
Definition: int.hh:909
Gecode::IntRelType irt
Integer relation type to propagate.
Definition: rel.cpp:340
virtual bool solution(const Assignment &x) const
Test whether x is solution
Definition: rel.cpp:133
Help class to create and register tests.
Definition: rel.cpp:576
IntVarXX(Gecode::IntRelType irt0, Gecode::IntPropLevel ipl)
Create and register test.
Definition: rel.cpp:97
Test for relation between arrays of Boolean variables
Definition: rel.cpp:512
Create(void)
Perform creation and registration.
Definition: rel.cpp:579
Integer variable array.
Definition: int.hh:744
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Definition: rel.cpp:497
BoolSeq(int n, Gecode::IntRelType irt0)
Create and register test.
Definition: rel.cpp:343
Greater ( )
Definition: int.hh:912
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:564
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Definition: rel.cpp:182
virtual bool solution(const Assignment &x) const
Test whether x is solution
Definition: rel.cpp:202
ConTestLevel contest
Whether to test for certain consistency.
Definition: int.hh:240
Gecode::IntRelType irt
Integer relation type to propagate.
Definition: rel.cpp:475
Computation spaces.
Definition: core.hpp:1748
Greater or equal ( )
Definition: int.hh:911
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
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
Test for relation between same sized arrays of integer variables
Definition: rel.cpp:411
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Definition: rel.cpp:400
Test for sequence of relations between shared Boolean variables
Definition: rel.cpp:373
virtual bool solution(const Assignment &x) const
Test whether x is solution
Definition: rel.cpp:276
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Definition: rel.cpp:245
IntSeq(int n, Gecode::IntRelType irt0, Gecode::IntPropLevel ipl)
Create and register test.
Definition: rel.cpp:271
const FloatNum min
Smallest allowed float value.
Definition: float.hh:850
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:907
Gecode::IntRelType irt
Integer relation type to propagate.
Definition: rel.cpp:301
virtual bool solution(const Assignment &x) const
Test whether x is solution
Definition: rel.cpp:521
No consistency-test.
Definition: int.hh:144
void rel(Home home, IntVar x, SetRelType rt, SetVar s, Reify r)
Post propagator for .
Definition: rel.cpp:240
IntRelType
Relation types for integers.
Definition: int.hh:906
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x, Gecode::Reify r)
Post reified constraint on x for r.
Definition: rel.cpp:256
IntArrayInt(Gecode::IntRelType irt0)
Create and register test.
Definition: rel.cpp:449
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:370
Gecode::IntRelType irt
Integer relation type to propagate.
Definition: rel.cpp:446
Test for simple relation involving shared integer variables
Definition: rel.cpp:91
Reification specification.
Definition: int.hh:857
struct Gecode::@579::NNF::@61::@62 b
For binary nodes (and, or, eqv)
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
Gecode::IntRelType irt
Integer relation type to propagate.
Definition: rel.cpp:414
Test for simple relation involving Boolean variable and integer constant
Definition: rel.cpp:225
virtual bool solution(const Assignment &x) const
Test whether x is solution
Definition: rel.cpp:238
virtual bool solution(const Assignment &x) const
Test whether x is solution
Definition: rel.cpp:420
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Definition: rel.cpp:532
Less ( )
Definition: int.hh:910
Test for domain-consistency.
Definition: int.hh:145
Post propagator for SetVar SetOpType SetVar SetRelType SetVar z
Definition: set.hh:784
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:479
virtual bool solution(const Assignment &x) const
Test whether x is solution
Definition: rel.cpp:107
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Definition: rel.cpp:141
Gecode::IntPropLevel ipl
Propagation level.
Definition: int.hh:238
Passing integer variables.
Definition: int.hh:639
Passing integer arguments.
Definition: int.hh:610
Passing Boolean variables.
Definition: int.hh:693
Test for sequence of relations between shared integer variables
Definition: rel.cpp:298
Test for relation between same sized arrays of integer variables and integers
Definition: rel.cpp:443
Gecode::IntRelType irt
Integer relation type to propagate.
Definition: rel.cpp:228
Boolean integer variables.
Definition: int.hh:494
Gecode::IntRelType irt
Integer relation type to propagate.
Definition: rel.cpp:125
Create c
Definition: rel.cpp:625
General test support.
Definition: afc.cpp:43
IntPropLevel
Propagation levels for integer propagators.
Definition: int.hh:955
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x, Gecode::Reify r)
Post reified constraint on x for r.
Definition: rel.cpp:152
Post propagator for SetVar SetOpType SetVar y
Definition: set.hh:784
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
Region r
Definition: region.cpp:82
Base class for assignments
Definition: int.hh:63
Test for simple relation involving Boolean variables
Definition: rel.cpp:122
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
Definition: rel.cpp:47
Gecode::IntRelType irt
Integer relation type to propagate.
Definition: rel.cpp:515
virtual bool solution(const Assignment &x) const
Test whether x is solution
Definition: rel.cpp:452
IntArrayVar(Gecode::IntRelType irt0)
Create and register test.
Definition: rel.cpp:417
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Definition: rel.cpp:209
IntSharedSeq(int n, Gecode::IntRelType irt0, Gecode::IntPropLevel ipl)
Create and register test.
Definition: rel.cpp:304
Test for relation between arrays of Boolean variables and integers
Definition: rel.cpp:544
Gecode toplevel namespace
Test for simple relation involving integer variable and integer constant
Definition: rel.cpp:189
Disequality ( )
Definition: int.hh:908
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x, Gecode::Reify r)
Post reified constraint on x for r.
Definition: rel.cpp:217
#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
Gecode::IntRelType irt
Integer relation type to propagate.
Definition: rel.cpp:547
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
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post constraint on x.
Definition: rel.cpp:464
virtual bool solution(const Assignment &x) const
Test whether x is solution
Definition: rel.cpp:309
IntArrayDiff(Gecode::IntRelType irt0, int m)
Create and register test.
Definition: rel.cpp:482
Iterator for simple integer propagation levels.
Definition: int.hh:334
int c
Integer constant.
Definition: rel.cpp:230
virtual bool solution(const Assignment &x) const
Test whether x is solution
Definition: rel.cpp:489
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x, Gecode::Reify r)
Post reified constraint on x for r.
Definition: rel.cpp:83
virtual bool solution(const Assignment &x) const
Test whether x is solution
Definition: rel.cpp:383
virtual bool solution(const Assignment &x) const
Test whether x is solution
Definition: rel.cpp:347
virtual bool solution(const Assignment &x) const
Test whether x is solution
Definition: rel.cpp:178