Generated on Sat Jun 2 2018 07:17:44 for Gecode by doxygen 1.8.13
int.hh
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  * Guido Tack <tack@gecode.org>
6  *
7  * Contributing authors:
8  * Stefano Gualandi <stefano.gualandi@gmail.com>
9  * Mikael Lagerkvist <lagerkvist@gecode.org>
10  * David Rijsman <David.Rijsman@quintiq.com>
11  *
12  * Copyright:
13  * Stefano Gualandi, 2013
14  * Mikael Lagerkvist, 2006
15  * David Rijsman, 2009
16  * Christian Schulte, 2002
17  * Guido Tack, 2004
18  *
19  * This file is part of Gecode, the generic constraint
20  * development environment:
21  * http://www.gecode.org
22  *
23  * Permission is hereby granted, free of charge, to any person obtaining
24  * a copy of this software and associated documentation files (the
25  * "Software"), to deal in the Software without restriction, including
26  * without limitation the rights to use, copy, modify, merge, publish,
27  * distribute, sublicense, and/or sell copies of the Software, and to
28  * permit persons to whom the Software is furnished to do so, subject to
29  * the following conditions:
30  *
31  * The above copyright notice and this permission notice shall be
32  * included in all copies or substantial portions of the Software.
33  *
34  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
35  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
36  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
37  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
38  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
39  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
40  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
41  *
42  */
43 
44 #ifndef __GECODE_INT_HH__
45 #define __GECODE_INT_HH__
46 
47 #include <climits>
48 #include <cfloat>
49 #include <iostream>
50 
51 #include <vector>
52 
53 #include <functional>
54 
55 #include <gecode/kernel.hh>
56 #include <gecode/search.hh>
57 #include <gecode/iter.hh>
58 
59 /*
60  * Configure linking
61  *
62  */
63 #if !defined(GECODE_STATIC_LIBS) && \
64  (defined(__CYGWIN__) || defined(__MINGW32__) || defined(_MSC_VER))
65 
66 #ifdef GECODE_BUILD_INT
67 #define GECODE_INT_EXPORT __declspec( dllexport )
68 #else
69 #define GECODE_INT_EXPORT __declspec( dllimport )
70 #endif
71 
72 #else
73 
74 #ifdef GECODE_GCC_HAS_CLASS_VISIBILITY
75 #define GECODE_INT_EXPORT __attribute__ ((visibility("default")))
76 #else
77 #define GECODE_INT_EXPORT
78 #endif
79 
80 #endif
81 
82 // Configure auto-linking
83 #ifndef GECODE_BUILD_INT
84 #define GECODE_LIBRARY_NAME "Int"
86 #endif
87 
99 #include <gecode/int/exception.hpp>
100 
101 namespace Gecode { namespace Int {
102 
110  namespace Limits {
112  const int max = INT_MAX - 1;
114  const int min = -max;
116  const int infinity = max + 1;
118  const long long int llmax = LLONG_MAX - 1;
120  const long long int llmin = -llmax;
122  const long long int llinfinity = llmax + 1;
124  bool valid(int n);
126  bool valid(long long int n);
128  void check(int n, const char* l);
130  void check(long long int n, const char* l);
132  void positive(int n, const char* l);
134  void positive(long long int n, const char* l);
136  void nonnegative(int n, const char* l);
138  void nonnegative(long long int n, const char* l);
140  bool overflow_add(int n, int m);
142  bool overflow_add(long long int n, long long int m);
144  bool overflow_sub(int n, int m);
146  bool overflow_sub(long long int n, long long int m);
148  bool overflow_mul(int n, int m);
150  bool overflow_mul(long long int n, long long int m);
151  }
152 
153 }}
154 
155 #include <gecode/int/limits.hpp>
156 
157 namespace Gecode {
158 
159  class IntSetRanges;
160 
161  template<class I> class IntSetInit;
162 
170  class IntSet : public SharedHandle {
171  friend class IntSetRanges;
172  template<class I> friend class IntSetInit;
173  private:
175  class Range {
176  public:
177  int min, max;
178  };
179  class IntSetObject : public SharedHandle::Object {
180  public:
182  unsigned int size;
184  int n;
186  Range* r;
188  GECODE_INT_EXPORT static IntSetObject* allocate(int m);
190  GECODE_INT_EXPORT bool in(int n) const;
192  GECODE_INT_EXPORT virtual ~IntSetObject(void);
193  };
195  class MinInc;
197  GECODE_INT_EXPORT void normalize(Range* r, int n);
199  GECODE_INT_EXPORT void init(int n, int m);
201  GECODE_INT_EXPORT void init(const int r[], int n);
203  GECODE_INT_EXPORT void init(const int r[][2], int n);
204  public:
206 
207  IntSet(void);
213  IntSet(int n, int m);
215  IntSet(const int r[], int n);
221  IntSet(const int r[][2], int n);
223  template<class I>
224  explicit IntSet(I& i);
226  template<class I>
227  explicit IntSet(const I& i);
229 
231 
232  int ranges(void) const;
235  int min(int i) const;
237  int max(int i) const;
239  unsigned int width(int i) const;
241 
243 
244  bool in(int n) const;
247  unsigned int size(void) const;
249  unsigned int width(void) const;
251  int min(void) const;
253  int max(void) const;
255 
257 
258  GECODE_INT_EXPORT static const IntSet empty;
261  };
262 
268  class IntSetRanges {
269  private:
271  const IntSet::Range* i;
273  const IntSet::Range* e;
274  public:
276 
277  IntSetRanges(void);
280  IntSetRanges(const IntSet& s);
282  void init(const IntSet& s);
284 
286 
287  bool operator ()(void) const;
290  void operator ++(void);
292 
294 
295  int min(void) const;
298  int max(void) const;
300  unsigned int width(void) const;
302  };
303 
309  class IntSetValues : public Iter::Ranges::ToValues<IntSetRanges> {
310  public:
312 
313  IntSetValues(void);
316  IntSetValues(const IntSet& s);
318  void init(const IntSet& s);
320  };
321 
326  template<class Char, class Traits>
327  std::basic_ostream<Char,Traits>&
328  operator <<(std::basic_ostream<Char,Traits>& os, const IntSet& s);
329 
330 }
331 
332 #include <gecode/int/int-set-1.hpp>
333 
334 #include <gecode/int/var-imp.hpp>
335 
336 namespace Gecode {
337 
338  namespace Int {
339  class IntView;
340  }
341 
347  class IntVar : public VarImpVar<Int::IntVarImp> {
348  friend class IntVarArray;
349  friend class IntVarArgs;
350  private:
358  void _init(Space& home, int min, int max);
365  void _init(Space& home, const IntSet& d);
366  public:
368 
369  IntVar(void);
372  IntVar(const IntVar& y);
374  IntVar(const Int::IntView& y);
386  GECODE_INT_EXPORT IntVar(Space& home, int min, int max);
398  GECODE_INT_EXPORT IntVar(Space& home, const IntSet& d);
400 
402 
403  int min(void) const;
406  int max(void) const;
408  int med(void) const;
416  int val(void) const;
417 
419  unsigned int size(void) const;
421  unsigned int width(void) const;
423  unsigned int regret_min(void) const;
425  unsigned int regret_max(void) const;
427 
429 
430  bool range(void) const;
433  bool in(int n) const;
435  };
436 
441  template<class Char, class Traits>
442  std::basic_ostream<Char,Traits>&
443  operator <<(std::basic_ostream<Char,Traits>& os, const IntVar& x);
444 
450  public:
452 
453  IntVarRanges(void);
456  IntVarRanges(const IntVar& x);
458  void init(const IntVar& x);
460  };
461 
466  class IntVarValues : public Iter::Ranges::ToValues<IntVarRanges> {
467  public:
469 
470  IntVarValues(void);
473  IntVarValues(const IntVar& x);
475  void init(const IntVar& x);
477  };
478 
479  namespace Int {
480  class BoolView;
481  }
482 
488  class BoolVar : public VarImpVar<Int::BoolVarImp> {
489  friend class BoolVarArray;
490  friend class BoolVarArgs;
491  private:
499  void _init(Space& home, int min, int max);
500  public:
502 
503  BoolVar(void);
506  BoolVar(const BoolVar& y);
508  BoolVar(const Int::BoolView& y);
520  GECODE_INT_EXPORT BoolVar(Space& home, int min, int max);
522 
524 
525  int min(void) const;
528  int max(void) const;
530  int med(void) const;
538  int val(void) const;
539 
541  unsigned int size(void) const;
543  unsigned int width(void) const;
545  unsigned int regret_min(void) const;
547  unsigned int regret_max(void) const;
549 
551 
552  bool range(void) const;
555  bool in(int n) const;
557 
559 
560  bool zero(void) const;
563  bool one(void) const;
565  bool none(void) const;
567  };
568 
573  template<class Char, class Traits>
574  std::basic_ostream<Char,Traits>&
575  operator <<(std::basic_ostream<Char,Traits>& os, const BoolVar& x);
576 
577 }
578 
579 
580 #include <gecode/int/view.hpp>
581 #include <gecode/int/propagator.hpp>
582 
583 namespace Gecode {
584 
596 
597 }
598 
600 
601 namespace Gecode {
602 
604  class IntArgs : public PrimArgArray<int> {
605  public:
607 
608  IntArgs(void);
611  explicit IntArgs(int n);
613  IntArgs(const SharedArray<int>& x);
615  IntArgs(const std::vector<int>& x);
617  template<class InputIterator>
618  IntArgs(InputIterator first, InputIterator last);
621  IntArgs(int n, int e0, ...);
623  IntArgs(int n, const int* e);
625  IntArgs(const PrimArgArray<int>& a);
626 
628  static IntArgs create(int n, int start, int inc=1);
630  };
631 
633  class IntVarArgs : public VarArgArray<IntVar> {
634  public:
636 
637  IntVarArgs(void) {}
640  explicit IntVarArgs(int n) : VarArgArray<IntVar>(n) {}
646  IntVarArgs(const std::vector<IntVar>& a) : VarArgArray<IntVar>(a) {}
648  template<class InputIterator>
649  IntVarArgs(InputIterator first, InputIterator last)
650  : VarArgArray<IntVar>(first,last) {}
663  IntVarArgs(Space& home, int n, int min, int max);
676  IntVarArgs(Space& home, int n, const IntSet& s);
678  };
687  class BoolVarArgs : public VarArgArray<BoolVar> {
688  public:
690 
691  BoolVarArgs(void) {}
694  explicit BoolVarArgs(int n) : VarArgArray<BoolVar>(n) {}
699  : VarArgArray<BoolVar>(a) {}
701  BoolVarArgs(const std::vector<BoolVar>& a) : VarArgArray<BoolVar>(a) {}
703  template<class InputIterator>
704  BoolVarArgs(InputIterator first, InputIterator last)
705  : VarArgArray<BoolVar>(first,last) {}
718  BoolVarArgs(Space& home, int n, int min, int max);
720  };
722 
738  class IntVarArray : public VarArray<IntVar> {
739  public:
741 
742  IntVarArray(void);
745  IntVarArray(Space& home, int n);
747  IntVarArray(const IntVarArray& a);
749  IntVarArray(Space& home, const IntVarArgs& a);
762  IntVarArray(Space& home, int n, int min, int max);
775  IntVarArray(Space& home, int n, const IntSet& s);
777  };
778 
783  class BoolVarArray : public VarArray<BoolVar> {
784  public:
786 
787  BoolVarArray(void);
790  BoolVarArray(Space& home, int n);
792  BoolVarArray(const BoolVarArray& a);
794  BoolVarArray(Space& home, const BoolVarArgs& a);
807  BoolVarArray(Space& home, int n, int min, int max);
809  };
810 
811 }
812 
813 #include <gecode/int/int-set-2.hpp>
814 
815 #include <gecode/int/array.hpp>
816 
817 namespace Gecode {
818 
823  enum ReifyMode {
845  };
846 
851  class Reify {
852  protected:
857  public:
859  Reify(void);
861  Reify(BoolVar x, ReifyMode rm=RM_EQV);
863  BoolVar var(void) const;
865  ReifyMode mode(void) const;
867  void var(BoolVar x);
869  void mode(ReifyMode rm);
870  };
871 
876  Reify eqv(BoolVar x);
877 
882  Reify imp(BoolVar x);
883 
888  Reify pmi(BoolVar x);
889 
890 }
891 
892 #include <gecode/int/reify.hpp>
893 
894 namespace Gecode {
895 
900  enum IntRelType {
907  };
908 
911 
914 
915 }
916 
917 #include <gecode/int/irt.hpp>
918 
919 namespace Gecode {
920 
925  enum BoolOpType {
931  };
932 
951  IPL_DEF = 0,
952  IPL_VAL = 1,
953  IPL_BND = 2,
954  IPL_DOM = 3,
955  IPL_BASIC = 4,
959  };
960 
963 
966 
967 }
968 
969 #include <gecode/int/ipl.hpp>
970 
971 namespace Gecode {
972 
978  enum TaskType {
979  TT_FIXP, //< Task with fixed processing time
980  TT_FIXS, //< Task with fixed start time
981  TT_FIXE //< Task with fixed end time
982  };
983 
990 
992  template<>
994  public:
995  typedef TaskTypeArgs StorageType;
997  typedef TaskTypeArgs ArgsType;
998  };
999 
1000 
1008  GECODE_INT_EXPORT void
1010  dom(Home home, IntVar x, int n,
1011  IntPropLevel ipl=IPL_DEF);
1013  GECODE_INT_EXPORT void
1014  dom(Home home, const IntVarArgs& x, int n,
1015  IntPropLevel ipl=IPL_DEF);
1016 
1018  GECODE_INT_EXPORT void
1019  dom(Home home, IntVar x, int l, int m,
1020  IntPropLevel ipl=IPL_DEF);
1022  GECODE_INT_EXPORT void
1023  dom(Home home, const IntVarArgs& x, int l, int m,
1024  IntPropLevel ipl=IPL_DEF);
1025 
1027  GECODE_INT_EXPORT void
1028  dom(Home home, IntVar x, const IntSet& s,
1029  IntPropLevel ipl=IPL_DEF);
1031  GECODE_INT_EXPORT void
1032  dom(Home home, const IntVarArgs& x, const IntSet& s,
1033  IntPropLevel ipl=IPL_DEF);
1034 
1036  GECODE_INT_EXPORT void
1037  dom(Home home, IntVar x, int n, Reify r,
1038  IntPropLevel ipl=IPL_DEF);
1040  GECODE_INT_EXPORT void
1041  dom(Home home, IntVar x, int l, int m, Reify r,
1042  IntPropLevel ipl=IPL_DEF);
1044  GECODE_INT_EXPORT void
1045  dom(Home home, IntVar x, const IntSet& s, Reify r,
1046  IntPropLevel ipl=IPL_DEF);
1047 
1049  GECODE_INT_EXPORT void
1050  dom(Home home, IntVar x, IntVar d,
1051  IntPropLevel ipl=IPL_DEF);
1053  GECODE_INT_EXPORT void
1054  dom(Home home, BoolVar x, BoolVar d,
1055  IntPropLevel ipl=IPL_DEF);
1057  GECODE_INT_EXPORT void
1058  dom(Home home, const IntVarArgs& x, const IntVarArgs& d,
1059  IntPropLevel ipl=IPL_DEF);
1061  GECODE_INT_EXPORT void
1062  dom(Home home, const BoolVarArgs& x, const BoolVarArgs& d,
1063  IntPropLevel ipl=IPL_DEF);
1065 
1066 
1077  GECODE_INT_EXPORT void
1078  rel(Home home, IntVar x0, IntRelType irt, IntVar x1,
1079  IntPropLevel ipl=IPL_DEF);
1086  GECODE_INT_EXPORT void
1087  rel(Home home, const IntVarArgs& x, IntRelType irt, IntVar y,
1088  IntPropLevel ipl=IPL_DEF);
1092  GECODE_INT_EXPORT void
1093  rel(Home home, IntVar x, IntRelType irt, int c,
1094  IntPropLevel ipl=IPL_DEF);
1098  GECODE_INT_EXPORT void
1099  rel(Home home, const IntVarArgs& x, IntRelType irt, int c,
1100  IntPropLevel ipl=IPL_DEF);
1107  GECODE_INT_EXPORT void
1108  rel(Home home, IntVar x0, IntRelType irt, IntVar x1, Reify r,
1109  IntPropLevel ipl=IPL_DEF);
1116  GECODE_INT_EXPORT void
1117  rel(Home home, IntVar x, IntRelType irt, int c, Reify r,
1118  IntPropLevel ipl=IPL_DEF);
1133  GECODE_INT_EXPORT void
1134  rel(Home home, const IntVarArgs& x, IntRelType irt,
1135  IntPropLevel ipl=IPL_DEF);
1150  GECODE_INT_EXPORT void
1151  rel(Home home, const IntVarArgs& x, IntRelType irt, const IntVarArgs& y,
1152  IntPropLevel ipl=IPL_DEF);
1166  GECODE_INT_EXPORT void
1167  rel(Home home, const IntVarArgs& x, IntRelType irt, const IntArgs& y,
1168  IntPropLevel ipl=IPL_DEF);
1182  GECODE_INT_EXPORT void
1183  rel(Home home, const IntArgs& x, IntRelType irt, const IntVarArgs& y,
1184  IntPropLevel ipl=IPL_DEF);
1185 
1193  GECODE_INT_EXPORT void
1194  rel(Home home, BoolVar x0, IntRelType irt, BoolVar x1,
1195  IntPropLevel ipl=IPL_DEF);
1199  GECODE_INT_EXPORT void
1200  rel(Home home, BoolVar x0, IntRelType irt, BoolVar x1, Reify r,
1201  IntPropLevel ipl=IPL_DEF);
1205  GECODE_INT_EXPORT void
1206  rel(Home home, const BoolVarArgs& x, IntRelType irt, BoolVar y,
1207  IntPropLevel ipl=IPL_DEF);
1215  GECODE_INT_EXPORT void
1216  rel(Home home, BoolVar x, IntRelType irt, int n,
1217  IntPropLevel ipl=IPL_DEF);
1225  GECODE_INT_EXPORT void
1226  rel(Home home, BoolVar x, IntRelType irt, int n, Reify r,
1227  IntPropLevel ipl=IPL_DEF);
1235  GECODE_INT_EXPORT void
1236  rel(Home home, const BoolVarArgs& x, IntRelType irt, int n,
1237  IntPropLevel ipl=IPL_DEF);
1250  GECODE_INT_EXPORT void
1251  rel(Home home, const BoolVarArgs& x, IntRelType irt, const BoolVarArgs& y,
1252  IntPropLevel ipl=IPL_DEF);
1265  GECODE_INT_EXPORT void
1266  rel(Home home, const BoolVarArgs& x, IntRelType irt, const IntArgs& y,
1267  IntPropLevel ipl=IPL_DEF);
1280  GECODE_INT_EXPORT void
1281  rel(Home home, const IntArgs& x, IntRelType irt, const BoolVarArgs& y,
1282  IntPropLevel ipl=IPL_DEF);
1293  GECODE_INT_EXPORT void
1294  rel(Home home, const BoolVarArgs& x, IntRelType irt,
1295  IntPropLevel ipl=IPL_DEF);
1301  GECODE_INT_EXPORT void
1302  rel(Home home, BoolVar x0, BoolOpType o, BoolVar x1, BoolVar x2,
1303  IntPropLevel ipl=IPL_DEF);
1312  GECODE_INT_EXPORT void
1313  rel(Home home, BoolVar x0, BoolOpType o, BoolVar x1, int n,
1314  IntPropLevel ipl=IPL_DEF);
1324  GECODE_INT_EXPORT void
1325  rel(Home home, BoolOpType o, const BoolVarArgs& x, BoolVar y,
1326  IntPropLevel ipl=IPL_DEF);
1339  GECODE_INT_EXPORT void
1340  rel(Home home, BoolOpType o, const BoolVarArgs& x, int n,
1341  IntPropLevel ipl=IPL_DEF);
1352  GECODE_INT_EXPORT void
1353  clause(Home home, BoolOpType o, const BoolVarArgs& x, const BoolVarArgs& y,
1354  BoolVar z, IntPropLevel ipl=IPL_DEF);
1368  GECODE_INT_EXPORT void
1369  clause(Home home, BoolOpType o, const BoolVarArgs& x, const BoolVarArgs& y,
1370  int n, IntPropLevel ipl=IPL_DEF);
1380  GECODE_INT_EXPORT void
1381  ite(Home home, BoolVar b, IntVar x, IntVar y, IntVar z,
1382  IntPropLevel ipl=IPL_DEF);
1389  GECODE_INT_EXPORT void
1390  ite(Home home, BoolVar b, BoolVar x, BoolVar y, BoolVar z,
1391  IntPropLevel ipl=IPL_DEF);
1392 
1393 
1405  GECODE_INT_EXPORT void
1406  precede(Home home, const IntVarArgs& x, int s, int t,
1415  GECODE_INT_EXPORT void
1416  precede(Home home, const IntVarArgs& x, const IntArgs& c,
1418 
1419 
1425  GECODE_INT_EXPORT void
1427  member(Home home, const IntVarArgs& x, IntVar y,
1428  IntPropLevel ipl=IPL_DEF);
1430  GECODE_INT_EXPORT void
1431  member(Home home, const BoolVarArgs& x, BoolVar y,
1432  IntPropLevel ipl=IPL_DEF);
1434  GECODE_INT_EXPORT void
1435  member(Home home, const IntVarArgs& x, IntVar y, Reify r,
1436  IntPropLevel ipl=IPL_DEF);
1438  GECODE_INT_EXPORT void
1439  member(Home home, const BoolVarArgs& x, BoolVar y, Reify r,
1440  IntPropLevel ipl=IPL_DEF);
1442 
1443 
1457  GECODE_INT_EXPORT void
1458  element(Home home, IntSharedArray n, IntVar x0, IntVar x1,
1459  IntPropLevel ipl=IPL_DEF);
1465  GECODE_INT_EXPORT void
1466  element(Home home, IntSharedArray n, IntVar x0, BoolVar x1,
1467  IntPropLevel ipl=IPL_DEF);
1473  GECODE_INT_EXPORT void
1474  element(Home home, IntSharedArray n, IntVar x0, int x1,
1475  IntPropLevel ipl=IPL_DEF);
1481  GECODE_INT_EXPORT void
1482  element(Home home, const IntVarArgs& x, IntVar y0, IntVar y1,
1483  IntPropLevel ipl=IPL_DEF);
1489  GECODE_INT_EXPORT void
1490  element(Home home, const IntVarArgs& x, IntVar y0, int y1,
1491  IntPropLevel ipl=IPL_DEF);
1493  GECODE_INT_EXPORT void
1494  element(Home home, const BoolVarArgs& x, IntVar y0, BoolVar y1,
1495  IntPropLevel ipl=IPL_DEF);
1497  GECODE_INT_EXPORT void
1498  element(Home home, const BoolVarArgs& x, IntVar y0, int y1,
1499  IntPropLevel ipl=IPL_DEF);
1500 
1513  GECODE_INT_EXPORT void
1514  element(Home home, IntSharedArray a,
1515  IntVar x, int w, IntVar y, int h, IntVar z,
1516  IntPropLevel ipl=IPL_DEF);
1529  GECODE_INT_EXPORT void
1530  element(Home home, IntSharedArray a,
1531  IntVar x, int w, IntVar y, int h, BoolVar z,
1532  IntPropLevel ipl=IPL_DEF);
1548  GECODE_INT_EXPORT void
1549  element(Home home, const IntVarArgs& a,
1550  IntVar x, int w, IntVar y, int h, IntVar z,
1551  IntPropLevel ipl=IPL_DEF);
1564  GECODE_INT_EXPORT void
1565  element(Home home, const BoolVarArgs& a,
1566  IntVar x, int w, IntVar y, int h, BoolVar z,
1567  IntPropLevel ipl=IPL_DEF);
1569 
1570 
1585  GECODE_INT_EXPORT void
1586  distinct(Home home, const IntVarArgs& x,
1587  IntPropLevel ipl=IPL_DEF);
1600  GECODE_INT_EXPORT void
1601  distinct(Home home, const IntArgs& n, const IntVarArgs& x,
1602  IntPropLevel ipl=IPL_DEF);
1617  GECODE_INT_EXPORT void
1618  distinct(Home home, const BoolVarArgs& b, const IntVarArgs& x,
1619  IntPropLevel ipl=IPL_DEF);
1632  GECODE_INT_EXPORT void
1633  distinct(Home home, const IntVarArgs& x, int c,
1634  IntPropLevel ipl=IPL_DEF);
1636 
1637 
1655  GECODE_INT_EXPORT void
1656  channel(Home home, const IntVarArgs& x, const IntVarArgs& y,
1657  IntPropLevel ipl=IPL_DEF);
1658 
1672  GECODE_INT_EXPORT void
1673  channel(Home home, const IntVarArgs& x, int xoff,
1674  const IntVarArgs& y, int yoff,
1675  IntPropLevel ipl=IPL_DEF);
1676 
1678  GECODE_INT_EXPORT void
1679  channel(Home home, BoolVar x0, IntVar x1,
1680  IntPropLevel ipl=IPL_DEF);
1682  void
1683  channel(Home home, IntVar x0, BoolVar x1,
1684  IntPropLevel ipl=IPL_DEF);
1690  GECODE_INT_EXPORT void
1691  channel(Home home, const BoolVarArgs& x, IntVar y, int o=0,
1692  IntPropLevel ipl=IPL_DEF);
1694 
1695 }
1696 
1697 #include <gecode/int/channel.hpp>
1698 
1699 namespace Gecode {
1700 
1717  GECODE_INT_EXPORT void
1718  sorted(Home home, const IntVarArgs& x, const IntVarArgs& y,
1719  IntPropLevel ipl=IPL_DEF);
1720 
1732  GECODE_INT_EXPORT void
1733  sorted(Home home, const IntVarArgs& x, const IntVarArgs& y,
1734  const IntVarArgs& z,
1735  IntPropLevel ipl=IPL_DEF);
1737 
1738 
1757  GECODE_INT_EXPORT void
1758  count(Home home, const IntVarArgs& x, int n, IntRelType irt, int m,
1759  IntPropLevel ipl=IPL_DEF);
1764  GECODE_INT_EXPORT void
1765  count(Home home, const IntVarArgs& x, const IntSet& y, IntRelType irt, int m,
1766  IntPropLevel ipl=IPL_DEF);
1774  GECODE_INT_EXPORT void
1775  count(Home home, const IntVarArgs& x, IntVar y, IntRelType irt, int m,
1776  IntPropLevel ipl=IPL_DEF);
1784  GECODE_INT_EXPORT void
1785  count(Home home, const IntVarArgs& x, const IntArgs& y, IntRelType irt, int m,
1786  IntPropLevel ipl=IPL_DEF);
1791  GECODE_INT_EXPORT void
1792  count(Home home, const IntVarArgs& x, int n, IntRelType irt, IntVar z,
1793  IntPropLevel ipl=IPL_DEF);
1798  GECODE_INT_EXPORT void
1799  count(Home home, const IntVarArgs& x, const IntSet& y, IntRelType irt, IntVar z,
1800  IntPropLevel ipl=IPL_DEF);
1808  GECODE_INT_EXPORT void
1809  count(Home home, const IntVarArgs& x, IntVar y, IntRelType irt, IntVar z,
1810  IntPropLevel ipl=IPL_DEF);
1818  GECODE_INT_EXPORT void
1819  count(Home home, const IntVarArgs& x, const IntArgs& y, IntRelType irt, IntVar z,
1820  IntPropLevel ipl=IPL_DEF);
1821 
1835  GECODE_INT_EXPORT void
1836  count(Home home, const IntVarArgs& x, const IntVarArgs& c,
1837  IntPropLevel ipl=IPL_DEF);
1838 
1852  GECODE_INT_EXPORT void
1853  count(Home home, const IntVarArgs& x, const IntSetArgs& c,
1854  IntPropLevel ipl=IPL_DEF);
1855 
1872  GECODE_INT_EXPORT void
1873  count(Home home, const IntVarArgs& x,
1874  const IntVarArgs& c, const IntArgs& v,
1875  IntPropLevel ipl=IPL_DEF);
1876 
1893  GECODE_INT_EXPORT void
1894  count(Home home, const IntVarArgs& x,
1895  const IntSetArgs& c, const IntArgs& v,
1896  IntPropLevel ipl=IPL_DEF);
1897 
1914  GECODE_INT_EXPORT void
1915  count(Home home, const IntVarArgs& x,
1916  const IntSet& c, const IntArgs& v,
1917  IntPropLevel ipl=IPL_DEF);
1918 
1920 
1935  GECODE_INT_EXPORT void
1936  nvalues(Home home, const IntVarArgs& x, IntRelType irt, int y,
1937  IntPropLevel ipl=IPL_DEF);
1941  GECODE_INT_EXPORT void
1942  nvalues(Home home, const IntVarArgs& x, IntRelType irt, IntVar y,
1943  IntPropLevel ipl=IPL_DEF);
1947  GECODE_INT_EXPORT void
1948  nvalues(Home home, const BoolVarArgs& x, IntRelType irt, int y,
1949  IntPropLevel ipl=IPL_DEF);
1953  GECODE_INT_EXPORT void
1954  nvalues(Home home, const BoolVarArgs& x, IntRelType irt, IntVar y,
1955  IntPropLevel ipl=IPL_DEF);
1957 
1978  GECODE_INT_EXPORT void
1979  sequence(Home home, const IntVarArgs& x, const IntSet& s,
1980  int q, int l, int u, IntPropLevel ipl=IPL_DEF);
1981 
1996  GECODE_INT_EXPORT void
1997  sequence(Home home, const BoolVarArgs& x, const IntSet& s,
1998  int q, int l, int u, IntPropLevel ipl=IPL_DEF);
1999 
2001 
2023  class DFA : public SharedHandle {
2024  private:
2026  class DFAI;
2029  bool equal(const DFA& d) const;
2030  public:
2032  class Transition {
2033  public:
2034  int i_state;
2035  int symbol;
2036  int o_state;
2037  Transition(void);
2040  Transition(int i_state0, int symbol0, int o_state0);
2041  };
2043  class Transitions {
2044  private:
2046  const Transition* c_trans;
2048  const Transition* e_trans;
2049  public:
2051  Transitions(const DFA& d);
2053  Transitions(const DFA& d, int n);
2055  bool operator ()(void) const;
2057  void operator ++(void);
2059  int i_state(void) const;
2061  int symbol(void) const;
2063  int o_state(void) const;
2064  };
2066  class Symbols {
2067  private:
2069  const Transition* c_trans;
2071  const Transition* e_trans;
2072  public:
2074  Symbols(const DFA& d);
2076  bool operator ()(void) const;
2078  void operator ++(void);
2080  int val(void) const;
2081  };
2082  public:
2083  friend class Transitions;
2085  DFA(void);
2098  DFA(int s, Transition t[], int f[], bool minimize=true);
2100  DFA(const DFA& d);
2103  bool operator ==(const DFA& d) const;
2105  bool operator !=(const DFA& d) const;
2107  int n_states(void) const;
2109  int n_transitions(void) const;
2111  unsigned int n_symbols(void) const;
2113  unsigned int max_degree(void) const;
2115  int final_fst(void) const;
2117  int final_lst(void) const;
2119  int symbol_min(void) const;
2121  int symbol_max(void) const;
2123  std::size_t hash(void) const;
2124  };
2125 
2126 }
2127 
2129 
2130 namespace Gecode {
2131 
2140  class TupleSet : public SharedHandle {
2141  public:
2146  typedef int* Tuple;
2150  class Range {
2151  public:
2153  int min;
2155  int max;
2157  BitSetData* s;
2159  unsigned int width(void) const;
2161  const BitSetData* supports(unsigned int n_words, int n) const;
2162  };
2163  protected:
2165  class ValueData {
2166  public:
2168  unsigned int n;
2172  unsigned int start(int n) const;
2173  };
2179  protected:
2181  static const int n_initial_free = 1024;
2182  public:
2184  int arity;
2186  unsigned int n_words;
2190  int n_free;
2192  int min;
2194  int max;
2196  std::size_t key;
2198  int* td;
2204  BitSetData* support;
2205 
2207  Tuple add(void);
2209  Tuple get(int i) const;
2211  static void set(BitSetData* d, unsigned int n);
2213  static bool get(const BitSetData* d, unsigned int n);
2215  unsigned int tuple2idx(Tuple t) const;
2217  const Range* fst(int i) const;
2219  const Range* lst(int i) const;
2222  void finalize(void);
2225  void resize(void);
2227  bool finalized(void) const;
2229  Data(int a);
2232  virtual ~Data(void);
2233  };
2234 
2236  Data& data(void) const;
2238  Data& raw(void) const;
2241  void _add(const IntArgs& t);
2244  bool equal(const TupleSet& t) const;
2245  public:
2247 
2248  TupleSet(void);
2252  TupleSet(int a);
2255  void init(int a);
2258  TupleSet(const TupleSet& t);
2261  TupleSet& operator =(const TupleSet& t);
2264  TupleSet(int a, const DFA& dfa);
2266  operator bool(void) const;
2268  bool operator ==(const TupleSet& t) const;
2270  bool operator !=(const TupleSet& t) const;
2272 
2274 
2275  TupleSet& add(const IntArgs& t);
2279  TupleSet& add(int n, ...);
2281  bool finalized(void) const;
2283  void finalize(void);
2285 
2287 
2288  int arity(void) const;
2291  int tuples(void) const;
2293  unsigned int words(void) const;
2295  Tuple operator [](int i) const;
2297  int min(void) const;
2299  int max(void) const;
2301  std::size_t hash(void) const;
2303 
2305 
2306  const Range* fst(int i) const;
2309  const Range* lst(int i) const;
2311  class Ranges {
2312  protected:
2314  const Range* c;
2316  const Range* l;
2317  public:
2319 
2320  Ranges(const TupleSet& ts, int i);
2323 
2325 
2326  bool operator ()(void) const;
2329  void operator ++(void);
2331 
2333 
2334  int min(void) const;
2337  int max(void) const;
2339  unsigned int width(void) const;
2341  };
2343  };
2344 
2345 }
2346 
2348 
2349 namespace Gecode {
2350 
2363  GECODE_INT_EXPORT void
2364  extensional(Home home, const IntVarArgs& x, DFA d,
2365  IntPropLevel ipl=IPL_DEF);
2366 
2379  GECODE_INT_EXPORT void
2380  extensional(Home home, const BoolVarArgs& x, DFA d,
2381  IntPropLevel ipl=IPL_DEF);
2382 
2393  GECODE_INT_EXPORT void
2394  extensional(Home home, const IntVarArgs& x, const TupleSet& t,
2395  IntPropLevel ipl=IPL_DEF);
2396 
2407  GECODE_INT_EXPORT void
2408  extensional(Home home, const BoolVarArgs& x, const TupleSet& t,
2409  IntPropLevel ipl=IPL_DEF);
2410 }
2411 
2412 namespace Gecode {
2413 
2425  GECODE_INT_EXPORT void
2426  min(Home home, IntVar x0, IntVar x1, IntVar x2,
2427  IntPropLevel ipl=IPL_DEF);
2435  GECODE_INT_EXPORT void
2436  min(Home home, const IntVarArgs& x, IntVar y,
2437  IntPropLevel ipl=IPL_DEF);
2443  GECODE_INT_EXPORT void
2444  max(Home home, IntVar x0, IntVar x1, IntVar x2,
2445  IntPropLevel ipl=IPL_DEF);
2453  GECODE_INT_EXPORT void
2454  max(Home home, const IntVarArgs& x, IntVar y,
2455  IntPropLevel ipl=IPL_DEF);
2456 
2466  GECODE_INT_EXPORT void
2467  argmin(Home home, const IntVarArgs& x, IntVar y, bool tiebreak=true,
2468  IntPropLevel ipl=IPL_DEF);
2478  GECODE_INT_EXPORT void
2479  argmin(Home home, const IntVarArgs& x, int o, IntVar y, bool tiebreak=true,
2480  IntPropLevel ipl=IPL_DEF);
2490  GECODE_INT_EXPORT void
2491  argmax(Home home, const IntVarArgs& x, IntVar y, bool tiebreak=true,
2492  IntPropLevel ipl=IPL_DEF);
2502  GECODE_INT_EXPORT void
2503  argmax(Home home, const IntVarArgs& x, int o, IntVar y, bool tiebreak=true,
2504  IntPropLevel ipl=IPL_DEF);
2505 
2511  GECODE_INT_EXPORT void
2512  abs(Home home, IntVar x0, IntVar x1,
2513  IntPropLevel ipl=IPL_DEF);
2514 
2520  GECODE_INT_EXPORT void
2521  mult(Home home, IntVar x0, IntVar x1, IntVar x2,
2522  IntPropLevel ipl=IPL_DEF);
2523 
2528  GECODE_INT_EXPORT void
2529  divmod(Home home, IntVar x0, IntVar x1, IntVar x2, IntVar x3,
2530  IntPropLevel ipl=IPL_DEF);
2531 
2536  GECODE_INT_EXPORT void
2537  div(Home home, IntVar x0, IntVar x1, IntVar x2,
2538  IntPropLevel ipl=IPL_DEF);
2539 
2544  GECODE_INT_EXPORT void
2545  mod(Home home, IntVar x0, IntVar x1, IntVar x2,
2546  IntPropLevel ipl=IPL_DEF);
2547 
2553  GECODE_INT_EXPORT void
2554  sqr(Home home, IntVar x0, IntVar x1,
2555  IntPropLevel ipl=IPL_DEF);
2556 
2562  GECODE_INT_EXPORT void
2563  sqrt(Home home, IntVar x0, IntVar x1,
2564  IntPropLevel ipl=IPL_DEF);
2565 
2574  GECODE_INT_EXPORT void
2575  pow(Home home, IntVar x0, int n, IntVar x1,
2576  IntPropLevel ipl=IPL_DEF);
2577 
2586  GECODE_INT_EXPORT void
2587  nroot(Home home, IntVar x0, int n, IntVar x1,
2588  IntPropLevel ipl=IPL_DEF);
2589 
2591 
2627  GECODE_INT_EXPORT void
2628  linear(Home home, const IntVarArgs& x,
2629  IntRelType irt, int c,
2630  IntPropLevel ipl=IPL_DEF);
2634  GECODE_INT_EXPORT void
2635  linear(Home home, const IntVarArgs& x,
2636  IntRelType irt, IntVar y,
2637  IntPropLevel ipl=IPL_DEF);
2641  GECODE_INT_EXPORT void
2642  linear(Home home, const IntVarArgs& x,
2643  IntRelType irt, int c, Reify r,
2644  IntPropLevel ipl=IPL_DEF);
2648  GECODE_INT_EXPORT void
2649  linear(Home home, const IntVarArgs& x,
2650  IntRelType irt, IntVar y, Reify r,
2651  IntPropLevel ipl=IPL_DEF);
2658  GECODE_INT_EXPORT void
2659  linear(Home home, const IntArgs& a, const IntVarArgs& x,
2660  IntRelType irt, int c,
2661  IntPropLevel ipl=IPL_DEF);
2668  GECODE_INT_EXPORT void
2669  linear(Home home, const IntArgs& a, const IntVarArgs& x,
2670  IntRelType irt, IntVar y,
2671  IntPropLevel ipl=IPL_DEF);
2678  GECODE_INT_EXPORT void
2679  linear(Home home, const IntArgs& a, const IntVarArgs& x,
2680  IntRelType irt, int c, Reify r,
2681  IntPropLevel ipl=IPL_DEF);
2688  GECODE_INT_EXPORT void
2689  linear(Home home, const IntArgs& a, const IntVarArgs& x,
2690  IntRelType irt, IntVar y, Reify r,
2691  IntPropLevel ipl=IPL_DEF);
2692 
2693 
2721  GECODE_INT_EXPORT void
2722  linear(Home home, const BoolVarArgs& x,
2723  IntRelType irt, int c,
2724  IntPropLevel ipl=IPL_DEF);
2728  GECODE_INT_EXPORT void
2729  linear(Home home, const BoolVarArgs& x,
2730  IntRelType irt, int c, Reify r,
2731  IntPropLevel ipl=IPL_DEF);
2735  GECODE_INT_EXPORT void
2736  linear(Home home, const BoolVarArgs& x,
2737  IntRelType irt, IntVar y,
2738  IntPropLevel ipl=IPL_DEF);
2742  GECODE_INT_EXPORT void
2743  linear(Home home, const BoolVarArgs& x,
2744  IntRelType irt, IntVar y, Reify r,
2745  IntPropLevel ipl=IPL_DEF);
2752  GECODE_INT_EXPORT void
2753  linear(Home home, const IntArgs& a, const BoolVarArgs& x,
2754  IntRelType irt, int c,
2755  IntPropLevel ipl=IPL_DEF);
2762  GECODE_INT_EXPORT void
2763  linear(Home home, const IntArgs& a, const BoolVarArgs& x,
2764  IntRelType irt, int c, Reify r,
2765  IntPropLevel ipl=IPL_DEF);
2772  GECODE_INT_EXPORT void
2773  linear(Home home, const IntArgs& a, const BoolVarArgs& x,
2774  IntRelType irt, IntVar y,
2775  IntPropLevel ipl=IPL_DEF);
2782  GECODE_INT_EXPORT void
2783  linear(Home home, const IntArgs& a, const BoolVarArgs& x,
2784  IntRelType irt, IntVar y, Reify r,
2785  IntPropLevel ipl=IPL_DEF);
2786 
2787 
2814  GECODE_INT_EXPORT void
2815  binpacking(Home home,
2816  const IntVarArgs& l,
2817  const IntVarArgs& b, const IntArgs& s,
2818  IntPropLevel ipl=IPL_DEF);
2819  /* \brief Post propagator for multi-dimensional bin packing
2820  *
2821  * In the following \a n refers to the number of items and \a m
2822  * refers to the number of bins.
2823  *
2824  * The multi-dimensional bin-packing constraint enforces that
2825  * all items are packed into bins
2826  * \f$b_i\in\{0,\ldots,m-1\}\f$ for \f$0\leq i<n\f$
2827  * and that the load of each bin corresponds to the items
2828  * packed into it for each dimension \f$l_{j\cdot
2829  * d + k} = \sum_{\{i\in\{0,\ldots,n-1\}|
2830  * b_{j\cdot d+k}=i}\}s_{i\cdot d+k}\f$
2831  * for \f$0\leq j<m\f$, \f$0\leq k<d\f$
2832  * Furthermore, the load variables must satisfy the capacity
2833  * constraints \f$l_{j\cdot d + k} \leq
2834  * c_k\f$ for \f$0\leq j<m\f$, \f$0\leq k<d\f$.
2835  *
2836  * The constraint is implemented by the decomposition
2837  * introduced in: Stefano Gualandi and Michele Lombardi. A
2838  * simple and effective decomposition for the multidimensional
2839  * binpacking constraint. CP 2013, pages 356--364.
2840  *
2841  * Posting the constraint returns a maximal set containing conflicting
2842  * items that require pairwise different bins.
2843  *
2844  * Note that posting the constraint has exponential complexity in the
2845  * number of items due to the Bron-Kerbosch algorithm used for finding
2846  * the maximal conflict item sets.
2847  *
2848  * Throws the following exceptions:
2849  * - Of type Int::ArgumentSizeMismatch if any of the following properties
2850  * is violated: \f$|b|=n\f$, \f$|l|=m\cdot d\f$, \f$|s|=n\cdot d\f$,
2851  * and \f$|c|=d\f$.
2852  * - Of type Int::ArgumentSame if \a l and \a b share unassigned variables.
2853  * - Of type Int::OutOfLimits if \a s or \a c contains a negative number.
2854  *
2855  * \ingroup TaskModelIntBinPacking
2856  */
2858  binpacking(Home home, int d,
2859  const IntVarArgs& l, const IntVarArgs& b,
2860  const IntArgs& s, const IntArgs& c,
2861  IntPropLevel ipl=IPL_DEF);
2862 
2863 
2882  GECODE_INT_EXPORT void
2883  nooverlap(Home home,
2884  const IntVarArgs& x, const IntArgs& w,
2885  const IntVarArgs& y, const IntArgs& h,
2886  IntPropLevel ipl=IPL_DEF);
2900  GECODE_INT_EXPORT void
2901  nooverlap(Home home,
2902  const IntVarArgs& x, const IntArgs& w,
2903  const IntVarArgs& y, const IntArgs& h,
2904  const BoolVarArgs& o,
2905  IntPropLevel ipl=IPL_DEF);
2922  GECODE_INT_EXPORT void
2923  nooverlap(Home home,
2924  const IntVarArgs& x0, const IntVarArgs& w, const IntVarArgs& x1,
2925  const IntVarArgs& y0, const IntVarArgs& h, const IntVarArgs& y1,
2926  IntPropLevel ipl=IPL_DEF);
2944  GECODE_INT_EXPORT void
2945  nooverlap(Home home,
2946  const IntVarArgs& x0, const IntVarArgs& w, const IntVarArgs& x1,
2947  const IntVarArgs& y0, const IntVarArgs& h, const IntVarArgs& y1,
2948  const BoolVarArgs& o,
2949  IntPropLevel ipl=IPL_DEF);
2950 
2951 
2957 
3000  GECODE_INT_EXPORT void
3001  cumulatives(Home home, const IntVarArgs& m,
3002  const IntVarArgs& s, const IntVarArgs& p,
3003  const IntVarArgs& e, const IntVarArgs& u,
3004  const IntArgs& c, bool at_most,
3005  IntPropLevel ipl=IPL_DEF);
3010  GECODE_INT_EXPORT void
3011  cumulatives(Home home, const IntArgs& m,
3012  const IntVarArgs& s, const IntVarArgs& p,
3013  const IntVarArgs& e, const IntVarArgs& u,
3014  const IntArgs& c, bool at_most,
3015  IntPropLevel ipl=IPL_DEF);
3020  GECODE_INT_EXPORT void
3021  cumulatives(Home home, const IntVarArgs& m,
3022  const IntVarArgs& s, const IntArgs& p,
3023  const IntVarArgs& e, const IntVarArgs& u,
3024  const IntArgs& c, bool at_most,
3025  IntPropLevel ipl=IPL_DEF);
3030  GECODE_INT_EXPORT void
3031  cumulatives(Home home, const IntArgs& m,
3032  const IntVarArgs& s, const IntArgs& p,
3033  const IntVarArgs& e, const IntVarArgs& u,
3034  const IntArgs& c, bool at_most,
3035  IntPropLevel ipl=IPL_DEF);
3040  GECODE_INT_EXPORT void
3041  cumulatives(Home home, const IntVarArgs& m,
3042  const IntVarArgs& s, const IntVarArgs& p,
3043  const IntVarArgs& e, const IntArgs& u,
3044  const IntArgs& c, bool at_most,
3045  IntPropLevel ipl=IPL_DEF);
3050  GECODE_INT_EXPORT void
3051  cumulatives(Home home, const IntArgs& m,
3052  const IntVarArgs& s, const IntVarArgs& p,
3053  const IntVarArgs& e, const IntArgs& u,
3054  const IntArgs& c, bool at_most,
3055  IntPropLevel ipl=IPL_DEF);
3060  GECODE_INT_EXPORT void
3061  cumulatives(Home home, const IntVarArgs& m,
3062  const IntVarArgs& s, const IntArgs& p,
3063  const IntVarArgs& e, const IntArgs& u,
3064  const IntArgs& c, bool at_most,
3065  IntPropLevel ipl=IPL_DEF);
3070  GECODE_INT_EXPORT void
3071  cumulatives(Home home, const IntArgs& m,
3072  const IntVarArgs& s, const IntArgs& p,
3073  const IntVarArgs& e, const IntArgs& u,
3074  const IntArgs& c, bool at_most,
3075  IntPropLevel ipl=IPL_DEF);
3076 
3103  GECODE_INT_EXPORT void
3104  unary(Home home, const IntVarArgs& s, const IntArgs& p,
3105  IntPropLevel ipl=IPL_DEF);
3106 
3135  GECODE_INT_EXPORT void
3136  unary(Home home, const IntVarArgs& s, const IntArgs& p,
3137  const BoolVarArgs& m, IntPropLevel ipl=IPL_DEF);
3138 
3175  GECODE_INT_EXPORT void
3176  unary(Home home, const TaskTypeArgs& t,
3177  const IntVarArgs& flex, const IntArgs& fix, IntPropLevel ipl=IPL_DEF);
3178 
3217  GECODE_INT_EXPORT void
3218  unary(Home home, const TaskTypeArgs& t,
3219  const IntVarArgs& flex, const IntArgs& fix,
3220  const BoolVarArgs& m, IntPropLevel ipl=IPL_DEF);
3221 
3248  GECODE_INT_EXPORT void
3249  unary(Home home, const IntVarArgs& s, const IntVarArgs& p,
3250  const IntVarArgs& e, IntPropLevel ipl=IPL_DEF);
3251 
3280  GECODE_INT_EXPORT void
3281  unary(Home home, const IntVarArgs& s, const IntVarArgs& p,
3282  const IntVarArgs& e, const BoolVarArgs& m, IntPropLevel ipl=IPL_DEF);
3283 
3284 
3285 
3328  GECODE_INT_EXPORT void
3329  cumulative(Home home, int c, const TaskTypeArgs& t,
3330  const IntVarArgs& flex, const IntArgs& fix, const IntArgs& u,
3331  IntPropLevel ipl=IPL_DEF);
3332 
3333 
3338  GECODE_INT_EXPORT void
3339  cumulative(Home home, IntVar c, const TaskTypeArgs& t,
3340  const IntVarArgs& flex, const IntArgs& fix, const IntArgs& u,
3341  IntPropLevel ipl=IPL_DEF);
3342 
3387  GECODE_INT_EXPORT void
3388  cumulative(Home home, int c, const TaskTypeArgs& t,
3389  const IntVarArgs& flex, const IntArgs& fix, const IntArgs& u,
3390  const BoolVarArgs& m, IntPropLevel ipl=IPL_DEF);
3391 
3395  GECODE_INT_EXPORT void
3396  cumulative(Home home, IntVar c, const TaskTypeArgs& t,
3397  const IntVarArgs& flex, const IntArgs& fix, const IntArgs& u,
3398  const BoolVarArgs& m, IntPropLevel ipl=IPL_DEF);
3399 
3432  GECODE_INT_EXPORT void
3433  cumulative(Home home, int c, const IntVarArgs& s, const IntArgs& p,
3434  const IntArgs& u, IntPropLevel ipl=IPL_DEF);
3435 
3439  GECODE_INT_EXPORT void
3440  cumulative(Home home, IntVar c, const IntVarArgs& s, const IntArgs& p,
3441  const IntArgs& u, IntPropLevel ipl=IPL_DEF);
3442 
3477  GECODE_INT_EXPORT void
3478  cumulative(Home home, int c, const IntVarArgs& s, const IntArgs& p,
3479  const IntArgs& u, const BoolVarArgs& m, IntPropLevel ipl=IPL_DEF);
3480 
3484  GECODE_INT_EXPORT void
3485  cumulative(Home home, IntVar c, const IntVarArgs& s, const IntArgs& p,
3486  const IntArgs& u, const BoolVarArgs& m, IntPropLevel ipl=IPL_DEF);
3487 
3524  GECODE_INT_EXPORT void
3525  cumulative(Home home, int c, const IntVarArgs& s, const IntVarArgs& p,
3526  const IntVarArgs& e, const IntArgs& u, IntPropLevel ipl=IPL_DEF);
3527 
3531  GECODE_INT_EXPORT void
3532  cumulative(Home home, IntVar c, const IntVarArgs& s, const IntVarArgs& p,
3533  const IntVarArgs& e, const IntArgs& u, IntPropLevel ipl=IPL_DEF);
3534 
3573  GECODE_INT_EXPORT void
3574  cumulative(Home home, int c, const IntVarArgs& s, const IntVarArgs& p,
3575  const IntVarArgs& e, const IntArgs& u, const BoolVarArgs& m,
3576  IntPropLevel ipl=IPL_DEF);
3577 
3581  GECODE_INT_EXPORT void
3582  cumulative(Home home, IntVar c, const IntVarArgs& s, const IntVarArgs& p,
3583  const IntVarArgs& e, const IntArgs& u, const BoolVarArgs& m,
3584  IntPropLevel ipl=IPL_DEF);
3586 
3587 
3607  GECODE_INT_EXPORT void
3608  circuit(Home home, const IntVarArgs& x,
3609  IntPropLevel ipl=IPL_DEF);
3625  GECODE_INT_EXPORT void
3626  circuit(Home home, int offset, const IntVarArgs& x,
3627  IntPropLevel ipl=IPL_DEF);
3649  GECODE_INT_EXPORT void
3650  circuit(Home home,
3651  const IntArgs& c,
3652  const IntVarArgs& x, const IntVarArgs& y, IntVar z,
3653  IntPropLevel ipl=IPL_DEF);
3676  GECODE_INT_EXPORT void
3677  circuit(Home home,
3678  const IntArgs& c, int offset,
3679  const IntVarArgs& x, const IntVarArgs& y, IntVar z,
3680  IntPropLevel ipl=IPL_DEF);
3699  GECODE_INT_EXPORT void
3700  circuit(Home home,
3701  const IntArgs& c,
3702  const IntVarArgs& x, IntVar z,
3703  IntPropLevel ipl=IPL_DEF);
3724  GECODE_INT_EXPORT void
3725  circuit(Home home,
3726  const IntArgs& c, int offset,
3727  const IntVarArgs& x, IntVar z,
3728  IntPropLevel ipl=IPL_DEF);
3744  GECODE_INT_EXPORT void
3745  path(Home home, const IntVarArgs& x, IntVar s, IntVar e,
3746  IntPropLevel ipl=IPL_DEF);
3764  GECODE_INT_EXPORT void
3765  path(Home home, int offset, const IntVarArgs& x, IntVar s, IntVar e,
3766  IntPropLevel ipl=IPL_DEF);
3789  GECODE_INT_EXPORT void
3790  path(Home home,
3791  const IntArgs& c,
3792  const IntVarArgs& x, IntVar s, IntVar e, const IntVarArgs& y, IntVar z,
3793  IntPropLevel ipl=IPL_DEF);
3818  GECODE_INT_EXPORT void
3819  path(Home home,
3820  const IntArgs& c, int offset,
3821  const IntVarArgs& x, IntVar s, IntVar e, const IntVarArgs& y, IntVar z,
3822  IntPropLevel ipl=IPL_DEF);
3843  GECODE_INT_EXPORT void
3844  path(Home home,
3845  const IntArgs& c,
3846  const IntVarArgs& x, IntVar s, IntVar e, IntVar z,
3847  IntPropLevel ipl=IPL_DEF);
3870  GECODE_INT_EXPORT void
3871  path(Home home,
3872  const IntArgs& c, int offset,
3873  const IntVarArgs& x, IntVar s, IntVar e, IntVar z,
3874  IntPropLevel ipl=IPL_DEF);
3876 
3877 
3878 
3887  GECODE_INT_EXPORT void
3889  wait(Home home, IntVar x, std::function<void(Space& home)> c,
3890  IntPropLevel ipl=IPL_DEF);
3892  GECODE_INT_EXPORT void
3893  wait(Home home, BoolVar x, std::function<void(Space& home)> c,
3894  IntPropLevel ipl=IPL_DEF);
3896  GECODE_INT_EXPORT void
3897  wait(Home home, const IntVarArgs& x, std::function<void(Space& home)> c,
3898  IntPropLevel ipl=IPL_DEF);
3900  GECODE_INT_EXPORT void
3901  wait(Home home, const BoolVarArgs& x,
3902  std::function<void(Space& home)> c,
3903  IntPropLevel ipl=IPL_DEF);
3905  GECODE_INT_EXPORT void
3906  when(Home home, BoolVar x,
3907  std::function<void(Space& home)> t,
3908  std::function<void(Space& home)> e,
3909  IntPropLevel ipl=IPL_DEF);
3911  GECODE_INT_EXPORT void
3912  when(Home home, BoolVar x,
3913  std::function<void(Space& home)> t,
3914  IntPropLevel ipl=IPL_DEF);
3916 
3917 
3942  GECODE_INT_EXPORT void
3943  unshare(Home home, IntVarArgs& x,
3944  IntPropLevel ipl=IPL_DEF);
3946  GECODE_INT_EXPORT void
3947  unshare(Home home, BoolVarArgs& x,
3948  IntPropLevel ipl=IPL_DEF);
3950 
3951 }
3952 
3953 namespace Gecode {
3954 
3968  typedef std::function<bool(const Space& home, IntVar x, int i)>
3978  typedef std::function<bool(const Space& home, BoolVar x, int i)>
3980 
3990  typedef std::function<double(const Space& home, IntVar x, int i)>
4001  typedef std::function<double(const Space& home, BoolVar x, int i)>
4003 
4014  typedef std::function<int(const Space& home, IntVar x, int i)>
4026  typedef std::function<int(const Space& home, BoolVar x, int i)>
4028 
4040  typedef std::function<void(Space& home, unsigned int a,
4041  IntVar x, int i, int n)>
4054  typedef std::function<void(Space& home, unsigned int a,
4055  BoolVar x, int i, int n)>
4057 
4058 }
4059 
4061 
4062 namespace Gecode {
4063 
4069  class IntAFC : public AFC {
4070  public:
4078  IntAFC(void);
4080  IntAFC(const IntAFC& a);
4082  IntAFC& operator =(const IntAFC& a);
4090  IntAFC(Home home, const IntVarArgs& x, double d=1.0, bool share=true);
4101  void init(Home home, const IntVarArgs& x, double d=1.0, bool share=true);
4102  };
4103 
4109  class BoolAFC : public AFC {
4110  public:
4118  BoolAFC(void);
4120  BoolAFC(const BoolAFC& a);
4122  BoolAFC& operator =(const BoolAFC& a);
4130  BoolAFC(Home home, const BoolVarArgs& x, double d=1.0, bool share=true);
4141  void init(Home home, const BoolVarArgs& x, double d=1.0, bool share=true);
4142  };
4143 
4144 }
4145 
4146 #include <gecode/int/branch/afc.hpp>
4147 
4148 namespace Gecode {
4149 
4155  class IntAction : public Action {
4156  public:
4164  IntAction(void);
4166  IntAction(const IntAction& a);
4168  IntAction& operator =(const IntAction& a);
4177  IntAction(Home home, const IntVarArgs& x, double d=1.0,
4178  IntBranchMerit bm=nullptr);
4190  GECODE_INT_EXPORT void
4191  init(Home home, const IntVarArgs& x, double d=1.0,
4192  IntBranchMerit bm=nullptr);
4193  };
4194 
4200  class BoolAction : public Action {
4201  public:
4209  BoolAction(void);
4211  BoolAction(const BoolAction& a);
4213  BoolAction& operator =(const BoolAction& a);
4222  BoolAction(Home home, const BoolVarArgs& x, double d=1.0,
4223  BoolBranchMerit bm=nullptr);
4235  GECODE_INT_EXPORT void
4236  init(Home home, const BoolVarArgs& x, double d=1.0,
4237  BoolBranchMerit bm=nullptr);
4238  };
4239 
4240 }
4241 
4243 
4244 namespace Gecode {
4245 
4251  class IntCHB : public CHB {
4252  public:
4260  IntCHB(void);
4262  IntCHB(const IntCHB& chb);
4264  IntCHB& operator =(const IntCHB& chb);
4274  IntCHB(Home home, const IntVarArgs& x, IntBranchMerit bm=nullptr);
4286  GECODE_INT_EXPORT void
4287  init(Home home, const IntVarArgs& x, IntBranchMerit bm=nullptr);
4288  };
4289 
4295  class BoolCHB : public CHB {
4296  public:
4304  BoolCHB(void);
4306  BoolCHB(const BoolCHB& chb);
4308  BoolCHB& operator =(const BoolCHB& chb);
4318  BoolCHB(Home home, const BoolVarArgs& x, BoolBranchMerit bm=nullptr);
4330  GECODE_INT_EXPORT void
4331  init(Home home, const BoolVarArgs& x, BoolBranchMerit bm=nullptr);
4332  };
4333 
4334 }
4335 
4336 #include <gecode/int/branch/chb.hpp>
4337 
4338 namespace Gecode {
4339 
4341  typedef std::function<void(const Space &home, const Brancher& b,
4342  unsigned int a,
4343  IntVar x, int i, const int& n,
4344  std::ostream& o)>
4346 
4348  typedef std::function<void(const Space &home, const Brancher& b,
4349  unsigned int a,
4350  BoolVar x, int i, const int& n,
4351  std::ostream& o)>
4353 
4354 }
4355 
4356 namespace Gecode {
4357 
4363  class IntVarBranch : public VarBranch<IntVar> {
4364  public:
4366  enum Select {
4367  SEL_NONE = 0,
4393 
4416  SEL_REGRET_MAX_MAX
4417  };
4418  protected:
4421  public:
4423  IntVarBranch(void);
4425  IntVarBranch(Rnd r);
4429  IntVarBranch(Select s, double d, BranchTbl t);
4439  Select select(void) const;
4441  void expand(Home home, const IntVarArgs& x);
4442  };
4443 
4449  class BoolVarBranch : public VarBranch<BoolVar> {
4450  public:
4452  enum Select {
4453  SEL_NONE = 0,
4464  SEL_CHB_MAX
4465  };
4466  protected:
4469  public:
4471  BoolVarBranch(void);
4473  BoolVarBranch(Rnd r);
4477  BoolVarBranch(Select s, double d, BranchTbl t);
4487  Select select(void) const;
4489  void expand(Home home, const BoolVarArgs& x);
4490  };
4491 
4497  IntVarBranch INT_VAR_NONE(void);
4510  IntVarBranch INT_VAR_AFC_MIN(double d=1.0, BranchTbl tbl=nullptr);
4514  IntVarBranch INT_VAR_AFC_MAX(double d=1.0, BranchTbl tbl=nullptr);
4518  IntVarBranch INT_VAR_ACTION_MIN(double d=1.0, BranchTbl tbl=nullptr);
4522  IntVarBranch INT_VAR_ACTION_MAX(double d=1.0, BranchTbl tbl=nullptr);
4550  IntVarBranch INT_VAR_AFC_SIZE_MIN(double d=1.0, BranchTbl tbl=nullptr);
4554  IntVarBranch INT_VAR_AFC_SIZE_MAX(double d=1.0, BranchTbl tbl=nullptr);
4558  IntVarBranch INT_VAR_ACTION_SIZE_MIN(double d=1.0, BranchTbl tbl=nullptr);
4562  IntVarBranch INT_VAR_ACTION_SIZE_MAX(double d=1.0, BranchTbl tbl=nullptr);
4597 
4611  BoolVarBranch BOOL_VAR_AFC_MIN(double d=1.0, BranchTbl tbl=nullptr);
4615  BoolVarBranch BOOL_VAR_AFC_MAX(double d=1.0, BranchTbl tbl=nullptr);
4619  BoolVarBranch BOOL_VAR_ACTION_MIN(double d=1.0, BranchTbl tbl=nullptr);
4623  BoolVarBranch BOOL_VAR_ACTION_MAX(double d=1.0, BranchTbl tbl=nullptr);
4635 
4636 }
4637 
4638 #include <gecode/int/branch/var.hpp>
4639 
4640 namespace Gecode {
4641 
4647  class IntValBranch : public ValBranch<IntVar> {
4648  public:
4650  enum Select {
4661  SEL_VALUES_MAX
4662  };
4663  protected:
4666  public:
4668  IntValBranch(Select s = SEL_MIN);
4670  IntValBranch(Rnd r);
4674  Select select(void) const;
4675  };
4676 
4682  class BoolValBranch : public ValBranch<BoolVar> {
4683  public:
4685  enum Select {
4689  SEL_VAL_COMMIT
4690  };
4691  protected:
4694  public:
4696  BoolValBranch(Select s = SEL_MIN);
4698  BoolValBranch(Rnd r);
4702  Select select(void) const;
4703  };
4704 
4710  IntValBranch INT_VAL_MIN(void);
4713  IntValBranch INT_VAL_MED(void);
4715  IntValBranch INT_VAL_MAX(void);
4737 
4752 
4753 }
4754 
4755 #include <gecode/int/branch/val.hpp>
4756 
4757 namespace Gecode {
4758 
4764  class IntAssign : public ValBranch<IntVar> {
4765  public:
4767  enum Select {
4772  SEL_VAL_COMMIT
4773  };
4774  protected:
4777  public:
4779  IntAssign(Select s = SEL_MIN);
4781  IntAssign(Rnd r);
4785  Select select(void) const;
4786  };
4787 
4793  class BoolAssign : public ValBranch<BoolVar> {
4794  public:
4796  enum Select {
4800  SEL_VAL_COMMIT
4801  };
4802  protected:
4805  public:
4807  BoolAssign(Select s = SEL_MIN);
4809  BoolAssign(Rnd r);
4813  Select select(void) const;
4814  };
4815 
4821  IntAssign INT_ASSIGN_MIN(void);
4824  IntAssign INT_ASSIGN_MED(void);
4826  IntAssign INT_ASSIGN_MAX(void);
4836 
4851 
4852 }
4853 
4855 
4856 namespace Gecode {
4862  GECODE_INT_EXPORT void
4863  branch(Home home, const IntVarArgs& x,
4864  IntVarBranch vars, IntValBranch vals,
4865  IntBranchFilter bf=nullptr,
4866  IntVarValPrint vvp=nullptr);
4872  GECODE_INT_EXPORT void
4873  branch(Home home, const IntVarArgs& x,
4875  IntBranchFilter bf=nullptr,
4876  IntVarValPrint vvp=nullptr);
4882  GECODE_INT_EXPORT void
4883  branch(Home home, IntVar x, IntValBranch vals,
4884  IntVarValPrint vvp=nullptr);
4890  GECODE_INT_EXPORT void
4891  branch(Home home, const BoolVarArgs& x,
4892  BoolVarBranch vars, BoolValBranch vals,
4893  BoolBranchFilter bf=nullptr,
4894  BoolVarValPrint vvp=nullptr);
4900  GECODE_INT_EXPORT void
4901  branch(Home home, const BoolVarArgs& x,
4903  BoolBranchFilter bf=nullptr,
4904  BoolVarValPrint vvp=nullptr);
4910  GECODE_INT_EXPORT void
4911  branch(Home home, BoolVar x, BoolValBranch vals,
4912  BoolVarValPrint vvp=nullptr);
4913 
4919  GECODE_INT_EXPORT void
4920  assign(Home home, const IntVarArgs& x, IntAssign vals,
4921  IntBranchFilter bf=nullptr,
4922  IntVarValPrint vvp=nullptr);
4928  GECODE_INT_EXPORT void
4929  assign(Home home, IntVar x, IntAssign vals,
4930  IntVarValPrint vvp=nullptr);
4936  GECODE_INT_EXPORT void
4937  assign(Home home, const BoolVarArgs& x, BoolAssign vals,
4938  BoolBranchFilter bf=nullptr,
4939  BoolVarValPrint vvp=nullptr);
4945  GECODE_INT_EXPORT void
4946  assign(Home home, BoolVar x, BoolAssign vals,
4947  BoolVarValPrint vvp=nullptr);
4948 
4949 }
4950 
4951 namespace Gecode {
4952 
4956  template<class Char, class Traits>
4957  std::basic_ostream<Char,Traits>&
4958  operator <<(std::basic_ostream<Char,Traits>& os, const DFA& d);
4959 
4963  template<class Char, class Traits>
4964  std::basic_ostream<Char,Traits>&
4965  operator <<(std::basic_ostream<Char,Traits>& os, const TupleSet& ts);
4966 
4967 }
4968 
4969 // LDSB-related declarations.
4970 namespace Gecode {
4971 
4972  namespace Int { namespace LDSB {
4973  class SymmetryObject;
4974  }}
4975 
4982  public:
4986  void increment(void);
4988  void decrement(void);
4989  public:
4991  SymmetryHandle(void);
4995  SymmetryHandle(const SymmetryHandle& h);
4997  const SymmetryHandle& operator=(const SymmetryHandle& h);
4999  ~SymmetryHandle(void);
5000  };
5001  class Symmetries;
5003  template<>
5005  public:
5009  };
5010 
5017  class Symmetries : public ArgArray<SymmetryHandle> {};
5019  // If this is instead a typedef, strange things happen with the
5020  // overloading of the "branch" function.
5021 
5028  const IntArgs& indices);
5055  SymmetryHandle ValueSequenceSymmetry(const IntArgs& v, int ss);
5056 
5058  GECODE_INT_EXPORT SymmetryHandle values_reflect(int lower, int upper);
5062 
5074  GECODE_INT_EXPORT void
5075  branch(Home home, const IntVarArgs& x,
5076  IntVarBranch vars, IntValBranch vals,
5077  const Symmetries& syms,
5078  IntBranchFilter bf=nullptr,
5079  IntVarValPrint vvp=nullptr);
5091  GECODE_INT_EXPORT void
5092  branch(Home home, const IntVarArgs& x,
5094  const Symmetries& syms,
5095  IntBranchFilter bf=nullptr,
5096  IntVarValPrint vvp=nullptr);
5108  GECODE_INT_EXPORT void
5109  branch(Home home, const BoolVarArgs& x,
5110  BoolVarBranch vars, BoolValBranch vals,
5111  const Symmetries& syms,
5112  BoolBranchFilter bf=nullptr,
5113  BoolVarValPrint vvp=nullptr);
5125  GECODE_INT_EXPORT void
5126  branch(Home home, const BoolVarArgs& x,
5128  const Symmetries& syms,
5129  BoolBranchFilter bf=nullptr,
5130  BoolVarValPrint vvp=nullptr);
5131 }
5132 
5133 namespace Gecode {
5134 
5135  /*
5136  * \brief Relaxed assignment of variables in \a x from values in \a sx
5137  *
5138  * The variables in \a x are assigned values from the assigned variables
5139  * in the solution \a sx with a relaxation probability \a p. That is,
5140  * if \$fp=0.1\f$ approximately 10% of the variables in \a x will be
5141  * assigned a value from \a sx.
5142  *
5143  * The random numbers are generated from the generator \a r. At least
5144  * one variable will not be assigned: in case the relaxation attempt
5145  * would suggest that all variables should be assigned, a single
5146  * variable will be selected randomly to remain unassigned.
5147  *
5148  * Throws an exception of type Int::ArgumentSizeMismatch, if \a x and
5149  * \a sx are of different size.
5150  *
5151  * Throws an exception of type Int::OutOfLimits, if \a p is not between
5152  * \a 0.0 and \a 1.0.
5153  *
5154  * \ingroup TaskModelInt
5155  */
5156  GECODE_INT_EXPORT void
5157  relax(Home home, const IntVarArgs& x, const IntVarArgs& sx,
5158  Rnd r, double p);
5159 
5160  /*
5161  * \brief Relaxed assignment of variables in \a x from values in \a sx
5162  *
5163  * The variables in \a x are assigned values from the assigned variables
5164  * in the solution \a sx with a relaxation probability \a p. That is,
5165  * if \$fp=0.1\f$ approximately 10% of the variables in \a x will be
5166  * assigned a value from \a sx.
5167  *
5168  * The random numbers are generated from the generator \a r. At least
5169  * one variable will not be assigned: in case the relaxation attempt
5170  * would suggest that all variables should be assigned, a single
5171  * variable will be selected randomly to remain unassigned.
5172  *
5173  * Throws an exception of type Int::ArgumentSizeMismatch, if \a x and
5174  * \a sx are of different size.
5175  *
5176  * Throws an exception of type Int::OutOfLimits, if \a p is not between
5177  * \a 0.0 and \a 1.0.
5178  *
5179  * \ingroup TaskModelInt
5180  */
5181  GECODE_INT_EXPORT void
5182  relax(Home home, const BoolVarArgs& x, const BoolVarArgs& sx,
5183  Rnd r, double p);
5184 
5185 }
5186 
5187 
5190 
5191 namespace Gecode {
5192 
5203  : public Iter::Ranges::Diff<Iter::Ranges::RangeList,
5204  Int::ViewRanges<Int::IntView> > {
5205  protected:
5210  public:
5212 
5216  };
5217 
5223  protected:
5225  int delta;
5226  public:
5228 
5232 
5234  bool operator ()(void) const;
5237  void operator ++(void);
5239 
5241 
5242  int min(void) const;
5245  int max(void) const;
5247  unsigned int width(void) const;
5249  };
5250 
5251 }
5252 
5255 
5256 #include <gecode/int/trace/traits.hpp>
5257 
5258 namespace Gecode {
5259 
5270 
5275  class GECODE_INT_EXPORT StdIntTracer : public IntTracer {
5276  protected:
5278  std::ostream& os;
5279  public:
5281  StdIntTracer(std::ostream& os0 = std::cerr);
5283  virtual void init(const Space& home, const IntTraceRecorder& t);
5285  virtual void prune(const Space& home, const IntTraceRecorder& t,
5286  const ViewTraceInfo& vti, int i, IntTraceDelta& d);
5288  virtual void fix(const Space& home, const IntTraceRecorder& t);
5290  virtual void fail(const Space& home, const IntTraceRecorder& t);
5292  virtual void done(const Space& home, const IntTraceRecorder& t);
5295  };
5296 
5297 
5308 
5313  class GECODE_INT_EXPORT StdBoolTracer : public BoolTracer {
5314  protected:
5316  std::ostream& os;
5317  public:
5319  StdBoolTracer(std::ostream& os0 = std::cerr);
5321  virtual void init(const Space& home, const BoolTraceRecorder& t);
5323  virtual void prune(const Space& home, const BoolTraceRecorder& t,
5324  const ViewTraceInfo& vti, int i, BoolTraceDelta& d);
5326  virtual void fix(const Space& home, const BoolTraceRecorder& t);
5328  virtual void fail(const Space& home, const BoolTraceRecorder& t);
5330  virtual void done(const Space& home, const BoolTraceRecorder& t);
5333  };
5334 
5339  GECODE_INT_EXPORT void
5340  trace(Home home, const IntVarArgs& x,
5341  TraceFilter tf,
5342  int te = (TE_INIT | TE_PRUNE | TE_FIX | TE_FAIL | TE_DONE),
5343  IntTracer& t = StdIntTracer::def);
5348  void
5349  trace(Home home, const IntVarArgs& x,
5350  int te = (TE_INIT | TE_PRUNE | TE_FIX | TE_FAIL | TE_DONE),
5351  IntTracer& t = StdIntTracer::def);
5352 
5357  GECODE_INT_EXPORT void
5358  trace(Home home, const BoolVarArgs& x,
5359  TraceFilter tf,
5360  int te = (TE_INIT | TE_PRUNE | TE_FIX | TE_FAIL | TE_DONE),
5361  BoolTracer& t = StdBoolTracer::def);
5366  void
5367  trace(Home home, const BoolVarArgs& x,
5368  int te = (TE_INIT | TE_PRUNE | TE_FIX | TE_FAIL | TE_DONE),
5369  BoolTracer& t = StdBoolTracer::def);
5370 
5371 }
5372 
5373 #include <gecode/int/trace.hpp>
5374 
5375 #endif
5376 
5377 // IFDEF: GECODE_HAS_INT_VARS
5378 // STATISTICS: int-post
5379 
Value iterator for integer variables.
Definition: int.hh:466
BoolValBranch BOOL_VAL_RND(Rnd r)
Select random value.
Definition: val.hpp:140
const Range * c
Current range.
Definition: int.hh:2314
std::function< void(Space &home, unsigned int a, IntVar x, int i, int n)> IntBranchCommit
Branch commit function type for integer variables.
Definition: int.hh:4042
Bounds propagation.
Definition: int.hh:953
std::function< double(const Space &home, BoolVar x, int i)> BoolBranchMerit
Branch merit function type for Boolean variables.
Definition: int.hh:4002
With smallest accumulated failure count.
Definition: int.hh:4373
void mod(Home home, IntVar x0, IntVar x1, IntVar x2, IntPropLevel ipl)
Post propagator for .
Definition: arithmetic.cpp:263
IntVarBranch INT_VAR_DEGREE_SIZE_MAX(BranchTbl tbl)
Select variable with largest degree divided by domain size.
Definition: var.hpp:221
Int::ViewRanges< Int::IntView > rn
Iterator over the new values.
Definition: int.hh:5207
IntValBranch INT_VAL_RANGE_MIN(void)
Select the smallest range of the variable domain if it has several ranges, otherwise select values no...
Definition: val.hpp:85
IntVarArgs(const VarArray< IntVar > &a)
Initialize from variable array a (copy elements)
Definition: int.hh:644
Duplicate of a Boolean view.
IntPropLevel vbd(IntPropLevel ipl)
Extract value, bounds, or domain propagation from propagation level.
Definition: ipl.hpp:37
int symbol
symbol
Definition: int.hh:2035
Variables as interfaces to variable implementations.
Definition: var.hpp:47
NodeType t
Type of node.
Definition: bool-expr.cpp:230
Tracer that process view trace information.
Definition: tracer.hpp:51
IntVarBranch INT_VAR_CHB_SIZE_MAX(IntCHB c, BranchTbl tbl)
Select variable with largest CHB Q-score divided by domain size.
Definition: var.hpp:276
IntVarBranch INT_VAR_NONE(void)
Select first unassigned variable.
Definition: var.hpp:96
Combine variable selection criteria for tie-breaking.
Definition: tiebreak.hpp:38
int arity
Arity.
Definition: int.hh:2184
Select s
Which variable to select.
Definition: int.hh:4420
void mult(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition: arithmetic.cpp:88
BoolVarBranch BOOL_VAR_NONE(void)
Select first unassigned variable.
Definition: var.hpp:364
The shared handle.
int * td
Tuple data.
Definition: int.hh:2198
NNF * l
Left subtree.
Definition: bool-expr.cpp:240
TaskType
Type of task for scheduling constraints.
Definition: int.hh:978
Inverse implication for reification.
Definition: int.hh:844
void sorted(Home home, const IntVarArgs &x, const IntVarArgs &y, const IntVarArgs &z, IntPropLevel)
Post propagator that y is x sorted in increasing order.
Definition: sorted.cpp:39
int n_free
Number of free tuple entries of arity.
Definition: int.hh:2190
BoolVarBranch BOOL_VAR_AFC_MIN(double d, BranchTbl tbl)
Select variable with smallest accumulated failure count with decay factor d.
Definition: var.hpp:394
With largest min-regret.
Definition: int.hh:4404
Select s
Which value to select.
Definition: int.hh:4804
View trace information.
Definition: core.hpp:905
Range iterator for integer sets.
Definition: int.hh:268
BoolAssign BOOL_ASSIGN_MIN(void)
Select smallest value.
Definition: assign.hpp:100
BoolVarArgs(const VarArray< BoolVar > &a)
Initialize from variable array a (copy elements)
Definition: int.hh:698
void sequence(Home home, const IntVarArgs &x, const IntSet &s, int q, int l, int u, IntPropLevel)
Post propagator for .
Definition: sequence.cpp:47
Iterator for DFA symbols.
Definition: int.hh:2066
Select random value.
Definition: int.hh:4688
void branch(Home home, const FloatVarArgs &x, FloatVarBranch vars, FloatValBranch vals, FloatBranchFilter bf, FloatVarValPrint vvp)
Branch over x with variable selection vars and value selection vals.
Definition: branch.cpp:39
Which values to select for branching first.
Definition: int.hh:4682
void channel(Home home, FloatVar x0, IntVar x1)
Post propagator for channeling a float and an integer variable .
Definition: channel.cpp:41
Iter::Ranges::RangeList ro
Iterator over the old values.
Definition: int.hh:5209
void count(Home home, const IntVarArgs &x, int n, IntRelType irt, int m, IntPropLevel)
Post propagator for .
Definition: count.cpp:40
bool one(const Gecode::FloatValArgs &a)
Check whether has only one coefficients.
Definition: linear.cpp:46
Standard Boolean variable tracer.
Definition: int.hh:5313
Select
Which value selection.
Definition: int.hh:4767
Select smallest value.
Definition: int.hh:4686
Argument array for primtive types.
Definition: array.hpp:624
BoolOpType
Operation types for Booleans.
Definition: int.hh:925
With smallest accumulated failure count.
Definition: int.hh:4459
Which values to select for branching first.
Definition: int.hh:4647
With smallest degree.
Definition: int.hh:4371
BoolVarArgs(const BoolVarArgs &a)
Initialize from variable argument array a (copy elements)
Definition: int.hh:696
IntVarBranch INT_VAR_SIZE_MAX(BranchTbl tbl)
Select variable with largest domain size.
Definition: var.hpp:211
Select smallest value.
Definition: int.hh:4651
Which integer variable to select for branching.
Definition: int.hh:4363
With largest accumulated failure count.
Definition: int.hh:4374
void abs(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition: arithmetic.cpp:41
IntAssign INT_ASSIGN_MED(void)
Select greatest value not greater than the median.
Definition: assign.hpp:60
Select s
Which value to select.
Definition: int.hh:4693
Less or equal ( )
Definition: int.hh:903
void nroot(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for $n 0$.
Definition: arithmetic.cpp:118
void pow(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for $n 0$.
Definition: arithmetic.cpp:109
IntVarBranch INT_VAR_REGRET_MIN_MIN(BranchTbl tbl)
Select variable with smallest min-regret.
Definition: var.hpp:286
IntVarBranch INT_VAR_DEGREE_MAX(BranchTbl tbl)
Select variable with largest degree.
Definition: var.hpp:121
BoolVarBranch BOOL_VAR_ACTION_MIN(double d, BranchTbl tbl)
Select variable with lowest action with decay factor d.
Definition: var.hpp:414
bool normalize(Term< View > *t, int &n, Term< View > *&t_p, int &n_p, Term< View > *&t_n, int &n_n, int &g)
Normalize linear integer constraints.
Definition: post.hpp:115
Conjunction.
Definition: int.hh:926
Range iterator for range lists
With largest accumulated failure count divided by domain size.
Definition: int.hh:4388
IntVarBranch INT_VAR_AFC_MIN(double d, BranchTbl tbl)
Select variable with smallest accumulated failure count with decay factor d.
Definition: var.hpp:126
int * Tuple
Type of a tuple.
Definition: int.hh:2146
void member(Home home, const IntVarArgs &x, IntVar y, IntPropLevel)
Post domain consistent propagator for .
Definition: member.cpp:39
BoolVarArgs(const std::vector< BoolVar > &a)
Initialize from vector a.
Definition: int.hh:701
void path(Home home, int offset, const IntVarArgs &x, IntVar s, IntVar e, IntPropLevel ipl)
Post propagator such that x forms a Hamiltonian path.
Definition: circuit.cpp:124
void dom(Home home, FloatVar x, FloatVal n)
Propagates .
Definition: dom.cpp:40
Collection of symmetries.
Definition: int.hh:5018
Which values to select for assignment.
Definition: int.hh:4793
bool equal(I &i, J &j)
Check whether range iterators i and j are equal.
void linear(Home home, const FloatVarArgs &x, FloatRelType frt, FloatVal c)
Post propagator for .
Definition: linear.cpp:41
With highest action.
Definition: int.hh:4462
Implementation of a symmetry at the modelling level.
Definition: ldsb.hh:106
IntValBranch INT_VAL_RANGE_MAX(void)
Select the largest range of the variable domain if it has several ranges, otherwise select values gre...
Definition: val.hpp:90
IntVarBranch INT_VAR_CHB_SIZE_MIN(IntCHB c, BranchTbl tbl)
Select variable with smallest CHB Q-score divided by domain size.
Definition: var.hpp:266
void nonnegative(int n, const char *l)
Check whether n is in range and nonnegative, otherwise throw out of limits with information l...
Definition: limits.hpp:68
IntVarArgs(InputIterator first, InputIterator last)
Initialize from InputIterator first and last.
Definition: int.hh:649
Implication.
Definition: int.hh:928
Integer variable array.
Definition: int.hh:738
IntVarBranch INT_VAR_MERIT_MAX(IntBranchMerit bm, BranchTbl tbl)
Select variable with highest merit according to branch merit function bm.
Definition: var.hpp:111
Select the smallest range of the variable domain if it has several ranges, otherwise select values no...
Definition: int.hh:4657
void circuit(Home home, int offset, const IntVarArgs &x, IntPropLevel ipl)
Post propagator such that x forms a circuit.
Definition: circuit.cpp:41
void argmin(Home home, const IntVarArgs &x, IntVar y, bool tiebreak, IntPropLevel)
Post propagator for .
Definition: arithmetic.cpp:163
BoolVarBranch BOOL_VAR_MERIT_MIN(BoolBranchMerit bm, BranchTbl tbl)
Select variable with least merit according to branch merit function bm.
Definition: var.hpp:374
IntVarArgs(const std::vector< IntVar > &a)
Initialize from vector a.
Definition: int.hh:646
BoolAssign BOOL_ASSIGN_MAX(void)
Select largest value.
Definition: assign.hpp:105
BitSetData * support
Pointer to all support data.
Definition: int.hh:2204
Select s
Which value to select.
Definition: int.hh:4665
IntVarBranch INT_VAR_REGRET_MIN_MAX(BranchTbl tbl)
Select variable with largest min-regret.
Definition: var.hpp:291
Greater ( )
Definition: int.hh:906
void binpacking(Home home, const IntVarArgs &l, const IntVarArgs &b, const IntArgs &s, IntPropLevel)
Post propagator for bin packing.
Definition: bin-packing.cpp:41
Select largest value.
Definition: int.hh:4798
ArgArray< IntSet > IntSetArgs
Passing set arguments.
Definition: int.hh:595
Trace init events.
Definition: recorder.hpp:43
const int max
Largest allowed integer value.
Definition: int.hh:112
With largest accumulated failure count.
Definition: int.hh:4460
With lowest action.
Definition: int.hh:4461
Computation spaces.
Definition: core.hpp:1701
ExecStatus prune(Space &home, ViewArray< VX > &x, ConstIntView)
Definition: rel.hpp:264
Greater or equal ( )
Definition: int.hh:905
Standard integer variable tracer.
Definition: int.hh:5275
Select s
Which value to select.
Definition: int.hh:4776
ViewTracer< Int::IntView > IntTracer
Tracer for integer variables.
Definition: int.hh:5264
With smallest min.
Definition: int.hh:4379
int min
Smallest value.
Definition: int.hh:2192
int i_state
input state
Definition: int.hh:2034
Exclusive or.
Definition: int.hh:930
const int min
Smallest allowed integer value.
Definition: int.hh:114
Select smallest value.
Definition: int.hh:4768
IntVarArgs(int n)
Allocate array with n elements.
Definition: int.hh:640
Iterator over ranges.
Definition: int.hh:2311
ViewTraceRecorder< Int::IntView > IntTraceRecorder
Trace recorder for integer variables.
Definition: int.hh:5269
Range iterator for integer variables
Definition: int.hh:449
IntAssign INT_ASSIGN_MIN(void)
Select smallest value.
Definition: assign.hpp:55
IntValBranch INT_VAL_RND(Rnd r)
Select random value.
Definition: val.hpp:70
With lowest action.
Definition: int.hh:4375
Random (uniform, for tie breaking)
Definition: int.hh:4454
Gecode::IntSet d(v, 7)
bool overflow_mul(int n, int m)
Check whether multiplying n and m would overflow.
Definition: limits.hpp:107
IntVarBranch INT_VAR_MAX_MAX(BranchTbl tbl)
Select variable with largest max.
Definition: var.hpp:201
Select s
Which variable to select.
Definition: int.hh:4468
Range * r
Ranges.
Definition: int.hh:2170
ValueData * vd
Value data.
Definition: int.hh:2200
std::string expand(Gecode::IntRelType irt)
Expand relation to abbreviation.
Definition: mm-count.cpp:44
Reify imp(BoolVar x)
Use implication for reification.
Definition: reify.hpp:73
Gecode::FloatVal c(-8, 8)
Trace prune events.
Definition: recorder.hpp:44
SymmetryHandle VariableSymmetry(const IntVarArgs &vars)
Variables in x are interchangeable.
Definition: ldsb.cpp:62
Deterministic finite automaton (DFA)
Definition: int.hh:2023
int p
Number of positive literals for node type.
Definition: bool-expr.cpp:232
IntVarBranch INT_VAR_ACTION_MAX(double d, BranchTbl tbl)
Select variable with highest action with decay factor d.
Definition: var.hpp:156
With smallest max-regret.
Definition: int.hh:4410
BoolValBranch BOOL_VAL_MIN(void)
Select smallest value.
Definition: val.hpp:130
IntVarBranch INT_VAR_AFC_SIZE_MAX(double d, BranchTbl tbl)
Select variable with largest accumulated failure count divided by domain size with decay factor d...
Definition: var.hpp:236
IntAssign INT_ASSIGN(IntBranchVal v, IntBranchCommit c)
Select value as defined by the value function v and commit function c.
Definition: assign.hpp:75
Gecode::IntArgs i(4, 1, 2, 3, 4)
Base-class for branchers.
Definition: core.hpp:1401
Class for AFC (accumulated failure count) management.
Definition: afc.hpp:40
IntRelType neg(IntRelType irt)
Return negated relation type of irt.
Definition: irt.hpp:52
BoolValBranch BOOL_VAL_MAX(void)
Select largest value.
Definition: val.hpp:135
int n
Number of negative literals for node type.
Definition: bool-expr.cpp:234
Equality ( )
Definition: int.hh:901
void unshare(Home home, IntVarArgs &x, IntPropLevel ipl)
Replace multiple variable occurences in x by fresh variables.
Definition: unshare.cpp:136
std::size_t key
Hash key.
Definition: int.hh:2196
const long long int llmin
Smallest allowed long long integer value.
Definition: int.hh:120
Select random value.
Definition: int.hh:4771
With smallest degree.
Definition: int.hh:4457
With smallest min-regret.
Definition: int.hh:4398
A reference-counted pointer to a SymmetryObject.
Definition: int.hh:4981
void divmod(Home home, IntVar x0, IntVar x1, IntVar x2, IntVar x3, IntPropLevel)
Post propagator for .
Definition: arithmetic.cpp:230
std::function< int(const Space &home, IntVar x, int i)> IntBranchVal
Branch value function type for integer variables.
Definition: int.hh:4015
void nvalues(Home home, const IntVarArgs &x, IntRelType irt, int y, IntPropLevel)
Post propagator for .
Definition: nvalues.cpp:40
IntAssign INT_ASSIGN_RND(Rnd r)
Select random value.
Definition: assign.hpp:70
With largest action divided by domain size.
Definition: int.hh:4390
unsigned int n_words
Number of words for support.
Definition: int.hh:2186
Select
Which value selection.
Definition: int.hh:4796
IntRelType
Relation types for integers.
Definition: int.hh:900
IntVarBranch INT_VAR_MIN_MIN(BranchTbl tbl)
Select variable with smallest min.
Definition: var.hpp:186
SymmetryHandle ValueSequenceSymmetry(const IntArgs &vs, int ss)
Value sequences in v of size ss are interchangeable.
Definition: ldsb.cpp:102
Select greatest value not greater than the median.
Definition: int.hh:4652
BoolVarBranch BOOL_VAR_DEGREE_MIN(BranchTbl tbl)
Select variable with smallest degree.
Definition: var.hpp:384
void sqr(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition: arithmetic.cpp:95
Range * range
Pointer to all ranges.
Definition: int.hh:2202
IntAssign INT_ASSIGN_MAX(void)
Select largest value.
Definition: assign.hpp:65
bool operator!=(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:317
Simple propagation levels.
Definition: int.hh:951
IntVarBranch INT_VAR_MERIT_MIN(IntBranchMerit bm, BranchTbl tbl)
Select variable with least merit according to branch merit function bm.
Definition: var.hpp:106
void extensional(Home home, const IntVarArgs &x, DFA dfa, IntPropLevel)
Post domain consistent propagator for extensional constraint described by a DFA.
Definition: extensional.cpp:43
Select random value.
Definition: int.hh:4799
Recording AFC information for integer variables.
Definition: int.hh:4069
BoolVarBranch BOOL_VAR_CHB_MAX(BoolCHB c, BranchTbl tbl)
Select variable with largest CHB Q-score.
Definition: var.hpp:444
IntValBranch INT_VAL_MIN(void)
Select smallest value.
Definition: val.hpp:55
Specification of a DFA transition.
Definition: int.hh:2032
void sqrt(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition: arithmetic.cpp:102
Use basic propagation algorithm.
Definition: int.hh:956
std::function< double(const Space &home, double w, double b)> BranchTbl
Tie-break limit function.
Definition: var.hpp:48
Value iterator from range iterator.
void wait(Home home, FloatVar x, std::function< void(Space &home)> c)
Execute c when x becomes assigned.
Definition: exec.cpp:39
Class for CHB management.
Definition: chb.hpp:46
With largest max.
Definition: int.hh:4382
unsigned int size(I &i)
Size of all ranges of range iterator i.
Reification specification.
Definition: int.hh:851
Value propagation.
Definition: int.hh:952
SymmetryHandle ValueSymmetry(const IntArgs &vs)
Values in v are interchangeable.
Definition: ldsb.cpp:81
IntValBranch INT_VAL_SPLIT_MAX(void)
Select values greater than mean of smallest and largest value.
Definition: val.hpp:80
void range(Home home, const IntVarArgs &x, SetVar y, SetVar z)
Post constraint .
Definition: minimodel.hh:2026
Range iterator for ranges of integer variable implementation.
Definition: var-imp.hpp:392
IntVarBranch INT_VAR_RND(Rnd r)
Select random variable (uniform distribution, for tie breaking)
Definition: var.hpp:101
void distinct(Home home, const IntVarArgs &x, IntPropLevel ipl)
Post propagator for for all .
Definition: distinct.cpp:46
With largest domain size.
Definition: int.hh:4384
Duplicate of an integer view.
int max
Maximum value.
Definition: int.hh:2155
Recording AFC information for Boolean variables.
Definition: int.hh:4109
bool overflow_add(int n, int m)
Check whether adding n and m would overflow.
Definition: limits.hpp:79
void argmax(Home home, const IntVarArgs &x, IntVar y, bool tiebreak, IntPropLevel)
Post propagator for .
Definition: arithmetic.cpp:110
Recording actions for Boolean variables.
Definition: int.hh:4200
Trace filters.
Definition: filter.hpp:133
BoolAssign BOOL_ASSIGN_RND(Rnd r)
Select random value.
Definition: assign.hpp:110
Integer set initialization.
Definition: int-set-1.hpp:53
BoolAssign BOOL_ASSIGN(BoolBranchVal v, BoolBranchCommit c)
Select value as defined by the value function v and commit function c.
Definition: assign.hpp:115
IntValBranch INT_VAL(IntBranchVal v, IntBranchCommit c)
Select value as defined by the value function v and commit function c Uses a commit function as defau...
Definition: val.hpp:95
Which Boolean variable to select for branching.
Definition: int.hh:4449
Select smallest value.
Definition: int.hh:4797
union Gecode::@585::NNF::@62 u
Union depending on nodetype t.
Less ( )
Definition: int.hh:904
Integer sets.
Definition: int.hh:170
int o_state
output state Default constructor
Definition: int.hh:2036
Post propagator for SetVar SetOpType SetVar SetRelType SetVar z
Definition: set.hh:765
IntVarBranch INT_VAR_AFC_MAX(double d, BranchTbl tbl)
Select variable with largest accumulated failure count with decay factor d.
Definition: var.hpp:136
std::function< bool(const Space &home, IntVar x, int i)> IntBranchFilter
Branch filter function type for integer variables.
Definition: int.hh:3969
Use advanced propagation algorithm.
Definition: int.hh:957
std::ostream & os
Output stream to use.
Definition: int.hh:5316
BitSetData * s
Begin of supports.
Definition: int.hh:2157
With largest CHB Q-score divided by domain size.
Definition: int.hh:4392
static StdIntTracer def
Default tracer (printing to std::cerr)
Definition: int.hh:5294
Recording CHB for integer variables.
Definition: int.hh:4251
Reify eqv(BoolVar x)
Use equivalence for reification.
Definition: reify.hpp:69
Disjunction.
Definition: int.hh:927
With largest degree divided by domain size.
Definition: int.hh:4386
IntVarArgs(const IntVarArgs &a)
Initialize from variable argument array a (copy elements)
Definition: int.hh:642
Passing integer variables.
Definition: int.hh:633
SharedArray< int > IntSharedArray
Arrays of integers that can be shared among several element constraints.
Definition: int.hh:1451
ViewTracer< Int::BoolView > BoolTracer
Tracer for Boolean variables.
Definition: int.hh:5302
Passing integer arguments.
Definition: int.hh:604
BoolVarArgs(InputIterator first, InputIterator last)
Initialize from InputIterator first and last.
Definition: int.hh:704
Passing Boolean variables.
Definition: int.hh:687
Select values greater than mean of smallest and largest value.
Definition: int.hh:4656
With highest action.
Definition: int.hh:4376
With smallest CHB Q-score divided by domain size.
Definition: int.hh:4391
With largest degree.
Definition: int.hh:4372
std::function< int(const Space &home, BoolVar x, int i)> BoolBranchVal
Branch value function type for Boolean variables.
Definition: int.hh:4027
void nooverlap(Home home, const IntVarArgs &x, const IntArgs &w, const IntVarArgs &y, const IntArgs &h, IntPropLevel)
Post propagator for rectangle packing.
Definition: no-overlap.cpp:51
Boolean variable array.
Definition: int.hh:783
Boolean integer variables.
Definition: int.hh:488
std::function< void(const Space &home, const Brancher &b, unsigned int a, IntVar x, int i, const int &n, std::ostream &o)> IntVarValPrint
Function type for printing branching alternatives for integer variables.
Definition: int.hh:4345
Post propagator for SetVar SetOpType SetVar SetRelType r
Definition: set.hh:765
const int v[7]
Definition: distinct.cpp:259
Propagator for recording view trace information.
Definition: recorder.hpp:59
Class represeting a set of tuples.
Definition: int.hh:2140
IntVarBranch INT_VAR_DEGREE_MIN(BranchTbl tbl)
Select variable with smallest degree.
Definition: var.hpp:116
TieBreak< VarBranch > tiebreak(VarBranch a, VarBranch b)
Combine variable selection criteria a and b for tie-breaking.
Definition: tiebreak.hpp:80
With smallest degree divided by domain size.
Definition: int.hh:4385
With smallest max.
Definition: int.hh:4381
IntValBranch INT_VAL_MAX(void)
Select largest value.
Definition: val.hpp:65
IntVarBranch INT_VAR_CHB_MIN(IntCHB c, BranchTbl tbl)
Select variable with lowest CHB Q-score.
Definition: var.hpp:166
IntPropLevel
Propagation levels for integer propagators.
Definition: int.hh:949
IntPropLevel ba(IntPropLevel ipl)
Extract basic or advanced from propagation level.
Definition: ipl.hpp:43
struct Gecode::@585::NNF::@62::@63 b
For binary nodes (and, or, eqv)
IntVarBranch INT_VAR_SIZE_MIN(BranchTbl tbl)
Select variable with smallest domain size.
Definition: var.hpp:206
Post propagator for f(x \diamond_{\mathit{op}} y) \sim_r z \f$ void rel(Home home
Integer view for integer variables.
Definition: view.hpp:129
const int infinity
Infinity for integers.
Definition: int.hh:116
Select the largest range of the variable domain if it has several ranges, otherwise select values gre...
Definition: int.hh:4658
Post propagator for SetVar SetOpType SetVar y
Definition: set.hh:765
BoolVarArgs(int n)
Allocate array with n elements.
Definition: int.hh:694
Value branching information.
Definition: val.hpp:41
Trace done events.
Definition: recorder.hpp:47
BoolVarBranch BOOL_VAR_AFC_MAX(double d, BranchTbl tbl)
Select variable with largest accumulated failure count with decay factor d.
Definition: var.hpp:404
void div(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition: arithmetic.cpp:127
void relax(Home home, const FloatVarArgs &x, const FloatVarArgs &sx, Rnd r, double p)
Definition: relax.cpp:57
IntValBranch INT_VALUES_MIN(void)
Try all values starting from smallest.
Definition: val.hpp:100
Variable branching information.
Definition: var.hpp:55
std::function< bool(const Space &home, BoolVar x, int i)> BoolBranchFilter
Branch filter function type for Boolean variables.
Definition: int.hh:3979
bool overflow_sub(int n, int m)
Check whether subtracting m from n would overflow.
Definition: limits.hpp:93
Select values not greater than mean of smallest and largest value.
Definition: int.hh:4655
BoolVarBranch BOOL_VAR_DEGREE_MAX(BranchTbl tbl)
Select variable with largest degree.
Definition: var.hpp:389
Generic domain change information to be supplied to advisors.
Definition: core.hpp:203
struct Gecode::@585::NNF::@62::@64 a
For atomic nodes.
With highest CHB Q-score.
Definition: int.hh:4378
IntVarBranch INT_VAR_MIN_MAX(BranchTbl tbl)
Select variable with largest min.
Definition: var.hpp:191
IntValBranch INT_VALUES_MAX(void)
Try all values starting from largest.
Definition: val.hpp:105
Select
Which value selection.
Definition: int.hh:4685
void precede(Home home, const IntVarArgs &x, int s, int t, IntPropLevel)
Post propagator that s precedes t in x.
Definition: precede.cpp:43
Integer variables.
Definition: int.hh:347
With lowest CHB Q-score.
Definition: int.hh:4377
IntVarBranch INT_VAR_ACTION_MIN(double d, BranchTbl tbl)
Select variable with lowest action with decay factor d.
Definition: var.hpp:146
Select random value.
Definition: int.hh:4654
BoolVarBranch BOOL_VAR_ACTION_MAX(double d, BranchTbl tbl)
Select variable with highest action with decay factor d.
Definition: var.hpp:424
IntVarBranch INT_VAR_AFC_SIZE_MIN(double d, BranchTbl tbl)
Select variable with smallest accumulated failure count divided by domain size with decay factor d...
Definition: var.hpp:226
Which values to select for assignment.
Definition: int.hh:4764
int n_tuples
Number of Tuples.
Definition: int.hh:2188
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
Definition: rel.cpp:43
Trace delta information for integer variables.
Definition: int.hh:5202
SymmetryHandle values_reflect(int lower, int upper)
The values from lower to upper (inclusive) can be reflected.
Definition: ldsb.cpp:106
IntVarBranch INT_VAR_REGRET_MAX_MIN(BranchTbl tbl)
Select variable with smallest max-regret.
Definition: var.hpp:296
Sort ranges according to increasing minimum.
Definition: int-set.cpp:71
Domain propagation Options: basic versus advanced propagation.
Definition: int.hh:954
Date item for bitsets.
Definition: bitset-base.hpp:65
Select
Which variable selection.
Definition: int.hh:4366
bool valid(int n)
Return whether n is in range.
Definition: limits.hpp:37
Value iterator for integer sets.
Definition: int.hh:309
Equivalence.
Definition: int.hh:929
IntValBranch INT_VAL_MED(void)
Select greatest value not greater than the median.
Definition: val.hpp:60
With smallest action divided by domain size.
Definition: int.hh:4389
IntVarBranch INT_VAR_ACTION_SIZE_MIN(double d, BranchTbl tbl)
Select variable with smallest action divided by domain size with decay factor d.
Definition: var.hpp:246
Data stored for a DFA.
Definition: dfa.hpp:42
IntVarBranch INT_VAR_MAX_MIN(BranchTbl tbl)
Select variable with smallest max.
Definition: var.hpp:196
Iterator for DFA transitions (sorted by symbols)
Definition: int.hh:2043
Int::LDSB::SymmetryObject * ref
Symmetry object that this handle refers to.
Definition: int.hh:4984
PrimArgArray< TaskType > TaskTypeArgs
Argument arrays for passing task type arguments.
Definition: int.hh:989
IntVarBranch INT_VAR_REGRET_MAX_MAX(BranchTbl tbl)
Select variable with largest max-regret.
Definition: var.hpp:301
Random (uniform, for tie breaking)
Definition: int.hh:4368
Select
Which variable selection.
Definition: int.hh:4452
With largest degree.
Definition: int.hh:4458
Trace fail events.
Definition: recorder.hpp:46
With smallest domain size.
Definition: int.hh:4383
Post propagator for SetVar x
Definition: set.hh:765
Trace fixpoint events.
Definition: recorder.hpp:45
std::ostream & os
Output stream to use.
Definition: int.hh:5278
Select
Which value selection.
Definition: int.hh:4650
BoolVarBranch BOOL_VAR_RND(Rnd r)
Select random variable (uniform distribution, for tie breaking)
Definition: var.hpp:369
std::function< void(const Space &home, const Brancher &b, unsigned int a, BoolVar x, int i, const int &n, std::ostream &o)> BoolVarValPrint
Function type for printing branching alternatives for Boolean variables.
Definition: int.hh:4352
IntVarBranch INT_VAR_CHB_MAX(IntCHB c, BranchTbl tbl)
Select variable with largest CHB Q-score.
Definition: var.hpp:176
Recording CHB for Boolean variables.
Definition: int.hh:4295
Select greatest value not greater than the median.
Definition: int.hh:4769
static StdBoolTracer def
Default tracer (printing to std::cerr)
Definition: int.hh:5332
void trace(Home home, const FloatVarArgs &x, TraceFilter tf, int te, FloatTracer &t)
Create a tracer for float variables.
Definition: trace.cpp:39
ViewTraceRecorder< Int::BoolView > BoolTraceRecorder
Trace recorder for Boolean variables.
Definition: int.hh:5307
SymmetryHandle VariableSequenceSymmetry(const IntVarArgs &vars, int ss)
Variable sequences in x of size ss are interchangeable.
Definition: ldsb.cpp:90
const long long int llmax
Largest allowed long long integer value.
Definition: int.hh:118
With highest merit.
Definition: int.hh:4370
bool operator==(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:294
Traits of arrays in Gecode.
Definition: array.hpp:64
Gecode::Support::BitSetData BitSetData
Import bit set data type.
Definition: int.hh:2148
IntValBranch INT_VAL_SPLIT_MIN(void)
Select values not greater than mean of smallest and largest value.
Definition: val.hpp:75
With largest min.
Definition: int.hh:4380
BoolValBranch BOOL_VAL(BoolBranchVal v, BoolBranchCommit c)
Select value as defined by the value function v and commit function c Uses a commit function as defau...
Definition: val.hpp:145
Gecode toplevel namespace
Argument array for variables.
Definition: array.hpp:49
const Range * l
Last range.
Definition: int.hh:2316
With highest merit.
Definition: int.hh:4456
Implication for reification.
Definition: int.hh:837
Class for action management.
Definition: action.hpp:42
BoolVarBranch BOOL_VAR_CHB_MIN(BoolCHB c, BranchTbl tbl)
Select variable with lowest CHB Q-score.
Definition: var.hpp:434
#define GECODE_VTABLE_EXPORT
Definition: support.hh:72
Range iterator for computing set difference.
Definition: ranges-diff.hpp:43
Disequality ( )
Definition: int.hh:902
BoolVar x
The Boolean control variable.
Definition: int.hh:854
int min
Minimum value.
Definition: int.hh:2153
BoolVarBranch BOOL_VAR_MERIT_MAX(BoolBranchMerit bm, BranchTbl tbl)
Select variable with highest merit according to branch merit function bm.
Definition: var.hpp:379
Random number generator.
Definition: rnd.hpp:42
Select largest value.
Definition: int.hh:4653
IntVarBranch INT_VAR_DEGREE_SIZE_MIN(BranchTbl tbl)
Select variable with smallest degree divided by domain size.
Definition: var.hpp:216
Data about values in the table.
Definition: int.hh:2165
unsigned int n
Number of ranges.
Definition: int.hh:2168
#define GECODE_INT_EXPORT
Definition: int.hh:77
const long long int llinfinity
Infinity for long long integers.
Definition: int.hh:122
void cumulative(Home home, int c, const TaskTypeArgs &t, const IntVarArgs &s, const IntArgs &p, const IntArgs &u, IntPropLevel ipl)
Post propagators for scheduling tasks on cumulative resources.
Definition: cumulative.cpp:353
void assign(Home home, const FloatVarArgs &x, FloatAssign fa, FloatBranchFilter bf, FloatVarValPrint vvp)
Assign all x with value selection vals.
Definition: branch.cpp:111
void check(int n, const char *l)
Check whether n is in range, otherwise throw out of limits with information l.
Definition: limits.hpp:46
Home class for posting propagators
Definition: core.hpp:853
double tbl(const Gecode::Space &, double w, double b)
Test function for tie-break limit function.
Definition: branch.cpp:61
Data stored for a Table.
Definition: int.hh:2178
std::function< double(const Space &home, IntVar x, int i)> IntBranchMerit
Branch merit function type for integer variables.
Definition: int.hh:3991
ReifyMode
Mode for reification.
Definition: int.hh:823
Select value according to user-defined functions.
Definition: int.hh:4659
int max
Largest value.
Definition: int.hh:2194
ReifyMode rm
The reification mode.
Definition: int.hh:856
void positive(int n, const char *l)
Check whether n is in range and strictly positive, otherwise throw out of limits with information l...
Definition: limits.hpp:57
Trace delta information for Boolean variables.
Definition: int.hh:5222
void unary(Home home, const IntVarArgs &s, const IntArgs &p, IntPropLevel ipl)
Post propagators for scheduling tasks on unary resources.
Definition: unary.cpp:44
void ite(Home home, BoolVar b, FloatVar x, FloatVar y, FloatVar z)
Post propagator for if-then-else constraint.
Definition: bool.cpp:39
Recording actions for integer variables.
Definition: int.hh:4155
Select largest value.
Definition: int.hh:4687
Range information.
Definition: int.hh:2150
Select largest value.
Definition: int.hh:4770
int delta
Delta information.
Definition: int.hh:5225
void element(Home home, IntSharedArray c, IntVar x0, IntVar x1, IntPropLevel)
Post domain consistent propagator for .
Definition: element.cpp:39
void when(Home home, BoolVar x, std::function< void(Space &home)> t, std::function< void(Space &home)> e, IntPropLevel)
Execute t (then) when x is assigned one, and e (else) otherwise.
Definition: exec.cpp:70
std::function< void(Space &home, unsigned int a, BoolVar x, int i, int n)> BoolBranchCommit
Branch commit function type for Boolean variables.
Definition: int.hh:4056
IntVarBranch INT_VAR_ACTION_SIZE_MAX(double d, BranchTbl tbl)
Select variable with largest action divided by domain size with decay factor d.
Definition: var.hpp:256
Select all values starting from smallest.
Definition: int.hh:4660
With smallest accumulated failure count divided by domain size.
Definition: int.hh:4387
void clause(Home home, BoolOpType o, const BoolVarArgs &x, const BoolVarArgs &y, int n, IntPropLevel)
Post domain consistent propagator for Boolean clause with positive variables x and negative variables...
Definition: bool.cpp:906
Equivalence for reification (default)
Definition: int.hh:830
IntRelType swap(IntRelType irt)
Return swapped relation type of irt.
Definition: irt.hpp:37
Reify pmi(BoolVar x)
Use reverse implication for reification.
Definition: reify.hpp:77
Boolean view for Boolean variables.
Definition: view.hpp:1349
void cumulatives(Home home, const IntVarArgs &m, const IntVarArgs &s, const IntVarArgs &p, const IntVarArgs &e, const IntVarArgs &u, const IntArgs &c, bool at_most, IntPropLevel cl)
Post propagators for the cumulatives constraint.