Generated on Thu Apr 5 2018 19:44:19 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  * Last modified:
20  * $Date$ by $Author$
21  * $Revision$
22  *
23  * This file is part of Gecode, the generic constraint
24  * development environment:
25  * http://www.gecode.org
26  *
27  * Permission is hereby granted, free of charge, to any person obtaining
28  * a copy of this software and associated documentation files (the
29  * "Software"), to deal in the Software without restriction, including
30  * without limitation the rights to use, copy, modify, merge, publish,
31  * distribute, sublicense, and/or sell copies of the Software, and to
32  * permit persons to whom the Software is furnished to do so, subject to
33  * the following conditions:
34  *
35  * The above copyright notice and this permission notice shall be
36  * included in all copies or substantial portions of the Software.
37  *
38  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
39  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
40  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
41  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
42  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
43  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
44  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
45  *
46  */
47 
48 #ifndef __GECODE_INT_HH__
49 #define __GECODE_INT_HH__
50 
51 #include <climits>
52 #include <cfloat>
53 #include <iostream>
54 
55 #include <vector>
56 
57 #include <functional>
58 
59 #include <gecode/kernel.hh>
60 #include <gecode/search.hh>
61 #include <gecode/iter.hh>
62 
63 /*
64  * Configure linking
65  *
66  */
67 #if !defined(GECODE_STATIC_LIBS) && \
68  (defined(__CYGWIN__) || defined(__MINGW32__) || defined(_MSC_VER))
69 
70 #ifdef GECODE_BUILD_INT
71 #define GECODE_INT_EXPORT __declspec( dllexport )
72 #else
73 #define GECODE_INT_EXPORT __declspec( dllimport )
74 #endif
75 
76 #else
77 
78 #ifdef GECODE_GCC_HAS_CLASS_VISIBILITY
79 #define GECODE_INT_EXPORT __attribute__ ((visibility("default")))
80 #else
81 #define GECODE_INT_EXPORT
82 #endif
83 
84 #endif
85 
86 // Configure auto-linking
87 #ifndef GECODE_BUILD_INT
88 #define GECODE_LIBRARY_NAME "Int"
90 #endif
91 
103 #include <gecode/int/exception.hpp>
104 
105 namespace Gecode { namespace Int {
106 
114  namespace Limits {
116  const int max = INT_MAX - 1;
118  const int min = -max;
120  const int infinity = max + 1;
122  const long long int llmax = LLONG_MAX - 1;
124  const long long int llmin = -llmax;
126  const long long int llinfinity = llmax + 1;
128  bool valid(int n);
130  bool valid(long long int n);
132  void check(int n, const char* l);
134  void check(long long int n, const char* l);
136  void positive(int n, const char* l);
138  void positive(long long int n, const char* l);
140  void nonnegative(int n, const char* l);
142  void nonnegative(long long int n, const char* l);
144  bool overflow_add(int n, int m);
146  bool overflow_add(long long int n, long long int m);
148  bool overflow_sub(int n, int m);
150  bool overflow_sub(long long int n, long long int m);
152  bool overflow_mul(int n, int m);
154  bool overflow_mul(long long int n, long long int m);
155  }
156 
157 }}
158 
159 #include <gecode/int/limits.hpp>
160 
161 namespace Gecode {
162 
163  class IntSetRanges;
164 
165  template<class I> class IntSetInit;
166 
174  class IntSet : public SharedHandle {
175  friend class IntSetRanges;
176  template<class I> friend class IntSetInit;
177  private:
179  class Range {
180  public:
181  int min, max;
182  };
183  class IntSetObject : public SharedHandle::Object {
184  public:
186  unsigned int size;
188  int n;
190  Range* r;
192  GECODE_INT_EXPORT static IntSetObject* allocate(int m);
194  GECODE_INT_EXPORT bool in(int n) const;
196  GECODE_INT_EXPORT virtual ~IntSetObject(void);
197  };
199  class MinInc;
201  GECODE_INT_EXPORT void normalize(Range* r, int n);
203  GECODE_INT_EXPORT void init(int n, int m);
205  GECODE_INT_EXPORT void init(const int r[], int n);
207  GECODE_INT_EXPORT void init(const int r[][2], int n);
208  public:
210 
211  IntSet(void);
217  IntSet(int n, int m);
219  IntSet(const int r[], int n);
225  IntSet(const int r[][2], int n);
227  template<class I>
228  explicit IntSet(I& i);
230  template<class I>
231  explicit IntSet(const I& i);
233 
235 
236  int ranges(void) const;
239  int min(int i) const;
241  int max(int i) const;
243  unsigned int width(int i) const;
245 
247 
248  bool in(int n) const;
251  unsigned int size(void) const;
253  unsigned int width(void) const;
255  int min(void) const;
257  int max(void) const;
259 
261 
262  GECODE_INT_EXPORT static const IntSet empty;
265  };
266 
272  class IntSetRanges {
273  private:
275  const IntSet::Range* i;
277  const IntSet::Range* e;
278  public:
280 
281  IntSetRanges(void);
284  IntSetRanges(const IntSet& s);
286  void init(const IntSet& s);
288 
290 
291  bool operator ()(void) const;
294  void operator ++(void);
296 
298 
299  int min(void) const;
302  int max(void) const;
304  unsigned int width(void) const;
306  };
307 
313  class IntSetValues : public Iter::Ranges::ToValues<IntSetRanges> {
314  public:
316 
317  IntSetValues(void);
320  IntSetValues(const IntSet& s);
322  void init(const IntSet& s);
324  };
325 
330  template<class Char, class Traits>
331  std::basic_ostream<Char,Traits>&
332  operator <<(std::basic_ostream<Char,Traits>& os, const IntSet& s);
333 
334 }
335 
336 #include <gecode/int/int-set-1.hpp>
337 
338 #include <gecode/int/var-imp.hpp>
339 
340 namespace Gecode {
341 
342  namespace Int {
343  class IntView;
344  }
345 
351  class IntVar : public VarImpVar<Int::IntVarImp> {
352  friend class IntVarArray;
353  friend class IntVarArgs;
354  private:
362  void _init(Space& home, int min, int max);
369  void _init(Space& home, const IntSet& d);
370  public:
372 
373  IntVar(void);
376  IntVar(const IntVar& y);
378  IntVar(const Int::IntView& y);
390  GECODE_INT_EXPORT IntVar(Space& home, int min, int max);
402  GECODE_INT_EXPORT IntVar(Space& home, const IntSet& d);
404 
406 
407  int min(void) const;
410  int max(void) const;
412  int med(void) const;
420  int val(void) const;
421 
423  unsigned int size(void) const;
425  unsigned int width(void) const;
427  unsigned int regret_min(void) const;
429  unsigned int regret_max(void) const;
431 
433 
434  bool range(void) const;
437  bool in(int n) const;
439  };
440 
445  template<class Char, class Traits>
446  std::basic_ostream<Char,Traits>&
447  operator <<(std::basic_ostream<Char,Traits>& os, const IntVar& x);
448 
454  public:
456 
457  IntVarRanges(void);
460  IntVarRanges(const IntVar& x);
462  void init(const IntVar& x);
464  };
465 
470  class IntVarValues : public Iter::Ranges::ToValues<IntVarRanges> {
471  public:
473 
474  IntVarValues(void);
477  IntVarValues(const IntVar& x);
479  void init(const IntVar& x);
481  };
482 
483  namespace Int {
484  class BoolView;
485  }
486 
492  class BoolVar : public VarImpVar<Int::BoolVarImp> {
493  friend class BoolVarArray;
494  friend class BoolVarArgs;
495  private:
503  void _init(Space& home, int min, int max);
504  public:
506 
507  BoolVar(void);
510  BoolVar(const BoolVar& y);
512  BoolVar(const Int::BoolView& y);
524  GECODE_INT_EXPORT BoolVar(Space& home, int min, int max);
526 
528 
529  int min(void) const;
532  int max(void) const;
534  int med(void) const;
542  int val(void) const;
543 
545  unsigned int size(void) const;
547  unsigned int width(void) const;
549  unsigned int regret_min(void) const;
551  unsigned int regret_max(void) const;
553 
555 
556  bool range(void) const;
559  bool in(int n) const;
561 
563 
564  bool zero(void) const;
567  bool one(void) const;
569  bool none(void) const;
571  };
572 
577  template<class Char, class Traits>
578  std::basic_ostream<Char,Traits>&
579  operator <<(std::basic_ostream<Char,Traits>& os, const BoolVar& x);
580 
581 }
582 
583 
584 #include <gecode/int/view.hpp>
585 #include <gecode/int/propagator.hpp>
586 
587 namespace Gecode {
588 
600 
601 }
602 
604 
605 namespace Gecode {
606 
608  class IntArgs : public PrimArgArray<int> {
609  public:
611 
612  IntArgs(void);
615  explicit IntArgs(int n);
617  IntArgs(const SharedArray<int>& x);
619  IntArgs(const std::vector<int>& x);
621  template<class InputIterator>
622  IntArgs(InputIterator first, InputIterator last);
625  IntArgs(int n, int e0, ...);
627  IntArgs(int n, const int* e);
629  IntArgs(const PrimArgArray<int>& a);
630 
632  static IntArgs create(int n, int start, int inc=1);
634  };
635 
637  class IntVarArgs : public VarArgArray<IntVar> {
638  public:
640 
641  IntVarArgs(void) {}
644  explicit IntVarArgs(int n) : VarArgArray<IntVar>(n) {}
650  IntVarArgs(const std::vector<IntVar>& a) : VarArgArray<IntVar>(a) {}
652  template<class InputIterator>
653  IntVarArgs(InputIterator first, InputIterator last)
654  : VarArgArray<IntVar>(first,last) {}
667  IntVarArgs(Space& home, int n, int min, int max);
680  IntVarArgs(Space& home, int n, const IntSet& s);
682  };
691  class BoolVarArgs : public VarArgArray<BoolVar> {
692  public:
694 
695  BoolVarArgs(void) {}
698  explicit BoolVarArgs(int n) : VarArgArray<BoolVar>(n) {}
703  : VarArgArray<BoolVar>(a) {}
705  BoolVarArgs(const std::vector<BoolVar>& a) : VarArgArray<BoolVar>(a) {}
707  template<class InputIterator>
708  BoolVarArgs(InputIterator first, InputIterator last)
709  : VarArgArray<BoolVar>(first,last) {}
722  BoolVarArgs(Space& home, int n, int min, int max);
724  };
726 
742  class IntVarArray : public VarArray<IntVar> {
743  public:
745 
746  IntVarArray(void);
749  IntVarArray(Space& home, int n);
751  IntVarArray(const IntVarArray& a);
753  IntVarArray(Space& home, const IntVarArgs& a);
766  IntVarArray(Space& home, int n, int min, int max);
779  IntVarArray(Space& home, int n, const IntSet& s);
781  };
782 
787  class BoolVarArray : public VarArray<BoolVar> {
788  public:
790 
791  BoolVarArray(void);
794  BoolVarArray(Space& home, int n);
796  BoolVarArray(const BoolVarArray& a);
798  BoolVarArray(Space& home, const BoolVarArgs& a);
811  BoolVarArray(Space& home, int n, int min, int max);
813  };
814 
815 }
816 
817 #include <gecode/int/int-set-2.hpp>
818 
819 #include <gecode/int/array.hpp>
820 
821 namespace Gecode {
822 
827  enum ReifyMode {
849  };
850 
855  class Reify {
856  protected:
861  public:
863  Reify(void);
865  Reify(BoolVar x, ReifyMode rm=RM_EQV);
867  BoolVar var(void) const;
869  ReifyMode mode(void) const;
871  void var(BoolVar x);
873  void mode(ReifyMode rm);
874  };
875 
880  Reify eqv(BoolVar x);
881 
886  Reify imp(BoolVar x);
887 
892  Reify pmi(BoolVar x);
893 
894 }
895 
896 #include <gecode/int/reify.hpp>
897 
898 namespace Gecode {
899 
904  enum IntRelType {
911  };
912 
915 
918 
919 }
920 
921 #include <gecode/int/irt.hpp>
922 
923 namespace Gecode {
924 
929  enum BoolOpType {
935  };
936 
955  IPL_DEF = 0,
956  IPL_VAL = 1,
957  IPL_BND = 2,
958  IPL_DOM = 3,
959  IPL_BASIC = 4,
963  };
964 
967 
970 
971 }
972 
973 #include <gecode/int/ipl.hpp>
974 
975 namespace Gecode {
976 
982  enum TaskType {
983  TT_FIXP, //< Task with fixed processing time
984  TT_FIXS, //< Task with fixed start time
985  TT_FIXE //< Task with fixed end time
986  };
987 
994 
996  template<>
998  public:
999  typedef TaskTypeArgs StorageType;
1001  typedef TaskTypeArgs ArgsType;
1002  };
1003 
1004 
1012  GECODE_INT_EXPORT void
1014  dom(Home home, IntVar x, int n,
1015  IntPropLevel ipl=IPL_DEF);
1017  GECODE_INT_EXPORT void
1018  dom(Home home, const IntVarArgs& x, int n,
1019  IntPropLevel ipl=IPL_DEF);
1020 
1022  GECODE_INT_EXPORT void
1023  dom(Home home, IntVar x, int l, int m,
1024  IntPropLevel ipl=IPL_DEF);
1026  GECODE_INT_EXPORT void
1027  dom(Home home, const IntVarArgs& x, int l, int m,
1028  IntPropLevel ipl=IPL_DEF);
1029 
1031  GECODE_INT_EXPORT void
1032  dom(Home home, IntVar x, const IntSet& s,
1033  IntPropLevel ipl=IPL_DEF);
1035  GECODE_INT_EXPORT void
1036  dom(Home home, const IntVarArgs& x, const IntSet& s,
1037  IntPropLevel ipl=IPL_DEF);
1038 
1040  GECODE_INT_EXPORT void
1041  dom(Home home, IntVar x, int n, Reify r,
1042  IntPropLevel ipl=IPL_DEF);
1044  GECODE_INT_EXPORT void
1045  dom(Home home, IntVar x, int l, int m, Reify r,
1046  IntPropLevel ipl=IPL_DEF);
1048  GECODE_INT_EXPORT void
1049  dom(Home home, IntVar x, const IntSet& s, Reify r,
1050  IntPropLevel ipl=IPL_DEF);
1051 
1053  GECODE_INT_EXPORT void
1054  dom(Home home, IntVar x, IntVar d,
1055  IntPropLevel ipl=IPL_DEF);
1057  GECODE_INT_EXPORT void
1058  dom(Home home, BoolVar x, BoolVar d,
1059  IntPropLevel ipl=IPL_DEF);
1061  GECODE_INT_EXPORT void
1062  dom(Home home, const IntVarArgs& x, const IntVarArgs& d,
1063  IntPropLevel ipl=IPL_DEF);
1065  GECODE_INT_EXPORT void
1066  dom(Home home, const BoolVarArgs& x, const BoolVarArgs& d,
1067  IntPropLevel ipl=IPL_DEF);
1069 
1070 
1081  GECODE_INT_EXPORT void
1082  rel(Home home, IntVar x0, IntRelType irt, IntVar x1,
1083  IntPropLevel ipl=IPL_DEF);
1090  GECODE_INT_EXPORT void
1091  rel(Home home, const IntVarArgs& x, IntRelType irt, IntVar y,
1092  IntPropLevel ipl=IPL_DEF);
1096  GECODE_INT_EXPORT void
1097  rel(Home home, IntVar x, IntRelType irt, int c,
1098  IntPropLevel ipl=IPL_DEF);
1102  GECODE_INT_EXPORT void
1103  rel(Home home, const IntVarArgs& x, IntRelType irt, int c,
1104  IntPropLevel ipl=IPL_DEF);
1111  GECODE_INT_EXPORT void
1112  rel(Home home, IntVar x0, IntRelType irt, IntVar x1, Reify r,
1113  IntPropLevel ipl=IPL_DEF);
1120  GECODE_INT_EXPORT void
1121  rel(Home home, IntVar x, IntRelType irt, int c, Reify r,
1122  IntPropLevel ipl=IPL_DEF);
1137  GECODE_INT_EXPORT void
1138  rel(Home home, const IntVarArgs& x, IntRelType irt,
1139  IntPropLevel ipl=IPL_DEF);
1154  GECODE_INT_EXPORT void
1155  rel(Home home, const IntVarArgs& x, IntRelType irt, const IntVarArgs& y,
1156  IntPropLevel ipl=IPL_DEF);
1170  GECODE_INT_EXPORT void
1171  rel(Home home, const IntVarArgs& x, IntRelType irt, const IntArgs& y,
1172  IntPropLevel ipl=IPL_DEF);
1186  GECODE_INT_EXPORT void
1187  rel(Home home, const IntArgs& x, IntRelType irt, const IntVarArgs& y,
1188  IntPropLevel ipl=IPL_DEF);
1189 
1197  GECODE_INT_EXPORT void
1198  rel(Home home, BoolVar x0, IntRelType irt, BoolVar x1,
1199  IntPropLevel ipl=IPL_DEF);
1203  GECODE_INT_EXPORT void
1204  rel(Home home, BoolVar x0, IntRelType irt, BoolVar x1, Reify r,
1205  IntPropLevel ipl=IPL_DEF);
1209  GECODE_INT_EXPORT void
1210  rel(Home home, const BoolVarArgs& x, IntRelType irt, BoolVar y,
1211  IntPropLevel ipl=IPL_DEF);
1219  GECODE_INT_EXPORT void
1220  rel(Home home, BoolVar x, IntRelType irt, int n,
1221  IntPropLevel ipl=IPL_DEF);
1229  GECODE_INT_EXPORT void
1230  rel(Home home, BoolVar x, IntRelType irt, int n, Reify r,
1231  IntPropLevel ipl=IPL_DEF);
1239  GECODE_INT_EXPORT void
1240  rel(Home home, const BoolVarArgs& x, IntRelType irt, int n,
1241  IntPropLevel ipl=IPL_DEF);
1254  GECODE_INT_EXPORT void
1255  rel(Home home, const BoolVarArgs& x, IntRelType irt, const BoolVarArgs& y,
1256  IntPropLevel ipl=IPL_DEF);
1269  GECODE_INT_EXPORT void
1270  rel(Home home, const BoolVarArgs& x, IntRelType irt, const IntArgs& y,
1271  IntPropLevel ipl=IPL_DEF);
1284  GECODE_INT_EXPORT void
1285  rel(Home home, const IntArgs& x, IntRelType irt, const BoolVarArgs& y,
1286  IntPropLevel ipl=IPL_DEF);
1297  GECODE_INT_EXPORT void
1298  rel(Home home, const BoolVarArgs& x, IntRelType irt,
1299  IntPropLevel ipl=IPL_DEF);
1305  GECODE_INT_EXPORT void
1306  rel(Home home, BoolVar x0, BoolOpType o, BoolVar x1, BoolVar x2,
1307  IntPropLevel ipl=IPL_DEF);
1316  GECODE_INT_EXPORT void
1317  rel(Home home, BoolVar x0, BoolOpType o, BoolVar x1, int n,
1318  IntPropLevel ipl=IPL_DEF);
1328  GECODE_INT_EXPORT void
1329  rel(Home home, BoolOpType o, const BoolVarArgs& x, BoolVar y,
1330  IntPropLevel ipl=IPL_DEF);
1343  GECODE_INT_EXPORT void
1344  rel(Home home, BoolOpType o, const BoolVarArgs& x, int n,
1345  IntPropLevel ipl=IPL_DEF);
1356  GECODE_INT_EXPORT void
1357  clause(Home home, BoolOpType o, const BoolVarArgs& x, const BoolVarArgs& y,
1358  BoolVar z, IntPropLevel ipl=IPL_DEF);
1372  GECODE_INT_EXPORT void
1373  clause(Home home, BoolOpType o, const BoolVarArgs& x, const BoolVarArgs& y,
1374  int n, IntPropLevel ipl=IPL_DEF);
1384  GECODE_INT_EXPORT void
1385  ite(Home home, BoolVar b, IntVar x, IntVar y, IntVar z,
1386  IntPropLevel ipl=IPL_DEF);
1393  GECODE_INT_EXPORT void
1394  ite(Home home, BoolVar b, BoolVar x, BoolVar y, BoolVar z,
1395  IntPropLevel ipl=IPL_DEF);
1396 
1397 
1409  GECODE_INT_EXPORT void
1410  precede(Home home, const IntVarArgs& x, int s, int t,
1419  GECODE_INT_EXPORT void
1420  precede(Home home, const IntVarArgs& x, const IntArgs& c,
1422 
1423 
1429  GECODE_INT_EXPORT void
1431  member(Home home, const IntVarArgs& x, IntVar y,
1432  IntPropLevel ipl=IPL_DEF);
1434  GECODE_INT_EXPORT void
1435  member(Home home, const BoolVarArgs& x, BoolVar y,
1436  IntPropLevel ipl=IPL_DEF);
1438  GECODE_INT_EXPORT void
1439  member(Home home, const IntVarArgs& x, IntVar y, Reify r,
1440  IntPropLevel ipl=IPL_DEF);
1442  GECODE_INT_EXPORT void
1443  member(Home home, const BoolVarArgs& x, BoolVar y, Reify r,
1444  IntPropLevel ipl=IPL_DEF);
1446 
1447 
1461  GECODE_INT_EXPORT void
1462  element(Home home, IntSharedArray n, IntVar x0, IntVar x1,
1463  IntPropLevel ipl=IPL_DEF);
1469  GECODE_INT_EXPORT void
1470  element(Home home, IntSharedArray n, IntVar x0, BoolVar x1,
1471  IntPropLevel ipl=IPL_DEF);
1477  GECODE_INT_EXPORT void
1478  element(Home home, IntSharedArray n, IntVar x0, int x1,
1479  IntPropLevel ipl=IPL_DEF);
1485  GECODE_INT_EXPORT void
1486  element(Home home, const IntVarArgs& x, IntVar y0, IntVar y1,
1487  IntPropLevel ipl=IPL_DEF);
1493  GECODE_INT_EXPORT void
1494  element(Home home, const IntVarArgs& x, IntVar y0, int y1,
1495  IntPropLevel ipl=IPL_DEF);
1497  GECODE_INT_EXPORT void
1498  element(Home home, const BoolVarArgs& x, IntVar y0, BoolVar y1,
1499  IntPropLevel ipl=IPL_DEF);
1501  GECODE_INT_EXPORT void
1502  element(Home home, const BoolVarArgs& x, IntVar y0, int y1,
1503  IntPropLevel ipl=IPL_DEF);
1504 
1517  GECODE_INT_EXPORT void
1518  element(Home home, IntSharedArray a,
1519  IntVar x, int w, IntVar y, int h, IntVar z,
1520  IntPropLevel ipl=IPL_DEF);
1533  GECODE_INT_EXPORT void
1534  element(Home home, IntSharedArray a,
1535  IntVar x, int w, IntVar y, int h, BoolVar z,
1536  IntPropLevel ipl=IPL_DEF);
1552  GECODE_INT_EXPORT void
1553  element(Home home, const IntVarArgs& a,
1554  IntVar x, int w, IntVar y, int h, IntVar z,
1555  IntPropLevel ipl=IPL_DEF);
1568  GECODE_INT_EXPORT void
1569  element(Home home, const BoolVarArgs& a,
1570  IntVar x, int w, IntVar y, int h, BoolVar z,
1571  IntPropLevel ipl=IPL_DEF);
1573 
1574 
1589  GECODE_INT_EXPORT void
1590  distinct(Home home, const IntVarArgs& x,
1591  IntPropLevel ipl=IPL_DEF);
1604  GECODE_INT_EXPORT void
1605  distinct(Home home, const IntArgs& n, const IntVarArgs& x,
1606  IntPropLevel ipl=IPL_DEF);
1621  GECODE_INT_EXPORT void
1622  distinct(Home home, const BoolVarArgs& b, const IntVarArgs& x,
1623  IntPropLevel ipl=IPL_DEF);
1636  GECODE_INT_EXPORT void
1637  distinct(Home home, const IntVarArgs& x, int c,
1638  IntPropLevel ipl=IPL_DEF);
1640 
1641 
1659  GECODE_INT_EXPORT void
1660  channel(Home home, const IntVarArgs& x, const IntVarArgs& y,
1661  IntPropLevel ipl=IPL_DEF);
1662 
1676  GECODE_INT_EXPORT void
1677  channel(Home home, const IntVarArgs& x, int xoff,
1678  const IntVarArgs& y, int yoff,
1679  IntPropLevel ipl=IPL_DEF);
1680 
1682  GECODE_INT_EXPORT void
1683  channel(Home home, BoolVar x0, IntVar x1,
1684  IntPropLevel ipl=IPL_DEF);
1686  void
1687  channel(Home home, IntVar x0, BoolVar x1,
1688  IntPropLevel ipl=IPL_DEF);
1694  GECODE_INT_EXPORT void
1695  channel(Home home, const BoolVarArgs& x, IntVar y, int o=0,
1696  IntPropLevel ipl=IPL_DEF);
1698 
1699 }
1700 
1701 #include <gecode/int/channel.hpp>
1702 
1703 namespace Gecode {
1704 
1721  GECODE_INT_EXPORT void
1722  sorted(Home home, const IntVarArgs& x, const IntVarArgs& y,
1723  IntPropLevel ipl=IPL_DEF);
1724 
1736  GECODE_INT_EXPORT void
1737  sorted(Home home, const IntVarArgs& x, const IntVarArgs& y,
1738  const IntVarArgs& z,
1739  IntPropLevel ipl=IPL_DEF);
1741 
1742 
1761  GECODE_INT_EXPORT void
1762  count(Home home, const IntVarArgs& x, int n, IntRelType irt, int m,
1763  IntPropLevel ipl=IPL_DEF);
1768  GECODE_INT_EXPORT void
1769  count(Home home, const IntVarArgs& x, const IntSet& y, IntRelType irt, int m,
1770  IntPropLevel ipl=IPL_DEF);
1778  GECODE_INT_EXPORT void
1779  count(Home home, const IntVarArgs& x, IntVar y, IntRelType irt, int m,
1780  IntPropLevel ipl=IPL_DEF);
1788  GECODE_INT_EXPORT void
1789  count(Home home, const IntVarArgs& x, const IntArgs& y, IntRelType irt, int m,
1790  IntPropLevel ipl=IPL_DEF);
1795  GECODE_INT_EXPORT void
1796  count(Home home, const IntVarArgs& x, int n, IntRelType irt, IntVar z,
1797  IntPropLevel ipl=IPL_DEF);
1802  GECODE_INT_EXPORT void
1803  count(Home home, const IntVarArgs& x, const IntSet& y, IntRelType irt, IntVar z,
1804  IntPropLevel ipl=IPL_DEF);
1812  GECODE_INT_EXPORT void
1813  count(Home home, const IntVarArgs& x, IntVar y, IntRelType irt, IntVar z,
1814  IntPropLevel ipl=IPL_DEF);
1822  GECODE_INT_EXPORT void
1823  count(Home home, const IntVarArgs& x, const IntArgs& y, IntRelType irt, IntVar z,
1824  IntPropLevel ipl=IPL_DEF);
1825 
1839  GECODE_INT_EXPORT void
1840  count(Home home, const IntVarArgs& x, const IntVarArgs& c,
1841  IntPropLevel ipl=IPL_DEF);
1842 
1856  GECODE_INT_EXPORT void
1857  count(Home home, const IntVarArgs& x, const IntSetArgs& c,
1858  IntPropLevel ipl=IPL_DEF);
1859 
1876  GECODE_INT_EXPORT void
1877  count(Home home, const IntVarArgs& x,
1878  const IntVarArgs& c, const IntArgs& v,
1879  IntPropLevel ipl=IPL_DEF);
1880 
1897  GECODE_INT_EXPORT void
1898  count(Home home, const IntVarArgs& x,
1899  const IntSetArgs& c, const IntArgs& v,
1900  IntPropLevel ipl=IPL_DEF);
1901 
1918  GECODE_INT_EXPORT void
1919  count(Home home, const IntVarArgs& x,
1920  const IntSet& c, const IntArgs& v,
1921  IntPropLevel ipl=IPL_DEF);
1922 
1924 
1939  GECODE_INT_EXPORT void
1940  nvalues(Home home, const IntVarArgs& x, IntRelType irt, int y,
1941  IntPropLevel ipl=IPL_DEF);
1945  GECODE_INT_EXPORT void
1946  nvalues(Home home, const IntVarArgs& x, IntRelType irt, IntVar y,
1947  IntPropLevel ipl=IPL_DEF);
1951  GECODE_INT_EXPORT void
1952  nvalues(Home home, const BoolVarArgs& x, IntRelType irt, int y,
1953  IntPropLevel ipl=IPL_DEF);
1957  GECODE_INT_EXPORT void
1958  nvalues(Home home, const BoolVarArgs& x, IntRelType irt, IntVar y,
1959  IntPropLevel ipl=IPL_DEF);
1961 
1982  GECODE_INT_EXPORT void
1983  sequence(Home home, const IntVarArgs& x, const IntSet& s,
1984  int q, int l, int u, IntPropLevel ipl=IPL_DEF);
1985 
2000  GECODE_INT_EXPORT void
2001  sequence(Home home, const BoolVarArgs& x, const IntSet& s,
2002  int q, int l, int u, IntPropLevel ipl=IPL_DEF);
2003 
2005 
2027  class DFA : public SharedHandle {
2028  private:
2030  class DFAI;
2033  bool equal(const DFA& d) const;
2034  public:
2036  class Transition {
2037  public:
2038  int i_state;
2039  int symbol;
2040  int o_state;
2041  Transition(void);
2044  Transition(int i_state0, int symbol0, int o_state0);
2045  };
2047  class Transitions {
2048  private:
2050  const Transition* c_trans;
2052  const Transition* e_trans;
2053  public:
2055  Transitions(const DFA& d);
2057  Transitions(const DFA& d, int n);
2059  bool operator ()(void) const;
2061  void operator ++(void);
2063  int i_state(void) const;
2065  int symbol(void) const;
2067  int o_state(void) const;
2068  };
2070  class Symbols {
2071  private:
2073  const Transition* c_trans;
2075  const Transition* e_trans;
2076  public:
2078  Symbols(const DFA& d);
2080  bool operator ()(void) const;
2082  void operator ++(void);
2084  int val(void) const;
2085  };
2086  public:
2087  friend class Transitions;
2089  DFA(void);
2102  DFA(int s, Transition t[], int f[], bool minimize=true);
2104  DFA(const DFA& d);
2107  bool operator ==(const DFA& d) const;
2109  bool operator !=(const DFA& d) const;
2111  int n_states(void) const;
2113  int n_transitions(void) const;
2115  unsigned int n_symbols(void) const;
2117  unsigned int max_degree(void) const;
2119  int final_fst(void) const;
2121  int final_lst(void) const;
2123  int symbol_min(void) const;
2125  int symbol_max(void) const;
2127  std::size_t hash(void) const;
2128  };
2129 
2130 }
2131 
2133 
2134 namespace Gecode {
2135 
2144  class TupleSet : public SharedHandle {
2145  public:
2150  typedef int* Tuple;
2154  class Range {
2155  public:
2157  int min;
2159  int max;
2161  BitSetData* s;
2163  unsigned int width(void) const;
2165  const BitSetData* supports(unsigned int n_words, int n) const;
2166  };
2167  protected:
2169  class ValueData {
2170  public:
2172  unsigned int n;
2176  unsigned int start(int n) const;
2177  };
2183  protected:
2185  static const int n_initial_free = 1024;
2186  public:
2188  int arity;
2190  unsigned int n_words;
2194  int n_free;
2196  int min;
2198  int max;
2200  std::size_t key;
2202  int* td;
2208  BitSetData* support;
2209 
2211  Tuple add(void);
2213  Tuple get(int i) const;
2215  static void set(BitSetData* d, unsigned int n);
2217  static bool get(const BitSetData* d, unsigned int n);
2219  unsigned int tuple2idx(Tuple t) const;
2221  const Range* fst(int i) const;
2223  const Range* lst(int i) const;
2226  void finalize(void);
2229  void resize(void);
2231  bool finalized(void) const;
2233  Data(int a);
2236  virtual ~Data(void);
2237  };
2238 
2240  Data& data(void) const;
2242  Data& raw(void) const;
2245  void _add(const IntArgs& t);
2248  bool equal(const TupleSet& t) const;
2249  public:
2251 
2252  TupleSet(void);
2256  TupleSet(int a);
2259  void init(int a);
2262  TupleSet(const TupleSet& t);
2265  TupleSet& operator =(const TupleSet& t);
2268  TupleSet(int a, const DFA& dfa);
2270  operator bool(void) const;
2272  bool operator ==(const TupleSet& t) const;
2274  bool operator !=(const TupleSet& t) const;
2276 
2278 
2279  TupleSet& add(const IntArgs& t);
2283  TupleSet& add(int n, ...);
2285  bool finalized(void) const;
2287  void finalize(void);
2289 
2291 
2292  int arity(void) const;
2295  int tuples(void) const;
2297  unsigned int words(void) const;
2299  Tuple operator [](int i) const;
2301  int min(void) const;
2303  int max(void) const;
2305  std::size_t hash(void) const;
2307 
2309 
2310  const Range* fst(int i) const;
2313  const Range* lst(int i) const;
2315  class Ranges {
2316  protected:
2318  const Range* c;
2320  const Range* l;
2321  public:
2323 
2324  Ranges(const TupleSet& ts, int i);
2327 
2329 
2330  bool operator ()(void) const;
2333  void operator ++(void);
2335 
2337 
2338  int min(void) const;
2341  int max(void) const;
2343  unsigned int width(void) const;
2345  };
2347  };
2348 
2349 }
2350 
2352 
2353 namespace Gecode {
2354 
2367  GECODE_INT_EXPORT void
2368  extensional(Home home, const IntVarArgs& x, DFA d,
2369  IntPropLevel ipl=IPL_DEF);
2370 
2383  GECODE_INT_EXPORT void
2384  extensional(Home home, const BoolVarArgs& x, DFA d,
2385  IntPropLevel ipl=IPL_DEF);
2386 
2397  GECODE_INT_EXPORT void
2398  extensional(Home home, const IntVarArgs& x, const TupleSet& t,
2399  IntPropLevel ipl=IPL_DEF);
2400 
2411  GECODE_INT_EXPORT void
2412  extensional(Home home, const BoolVarArgs& x, const TupleSet& t,
2413  IntPropLevel ipl=IPL_DEF);
2414 }
2415 
2416 namespace Gecode {
2417 
2429  GECODE_INT_EXPORT void
2430  min(Home home, IntVar x0, IntVar x1, IntVar x2,
2431  IntPropLevel ipl=IPL_DEF);
2439  GECODE_INT_EXPORT void
2440  min(Home home, const IntVarArgs& x, IntVar y,
2441  IntPropLevel ipl=IPL_DEF);
2447  GECODE_INT_EXPORT void
2448  max(Home home, IntVar x0, IntVar x1, IntVar x2,
2449  IntPropLevel ipl=IPL_DEF);
2457  GECODE_INT_EXPORT void
2458  max(Home home, const IntVarArgs& x, IntVar y,
2459  IntPropLevel ipl=IPL_DEF);
2460 
2470  GECODE_INT_EXPORT void
2471  argmin(Home home, const IntVarArgs& x, IntVar y, bool tiebreak=true,
2472  IntPropLevel ipl=IPL_DEF);
2482  GECODE_INT_EXPORT void
2483  argmin(Home home, const IntVarArgs& x, int o, IntVar y, bool tiebreak=true,
2484  IntPropLevel ipl=IPL_DEF);
2494  GECODE_INT_EXPORT void
2495  argmax(Home home, const IntVarArgs& x, IntVar y, bool tiebreak=true,
2496  IntPropLevel ipl=IPL_DEF);
2506  GECODE_INT_EXPORT void
2507  argmax(Home home, const IntVarArgs& x, int o, IntVar y, bool tiebreak=true,
2508  IntPropLevel ipl=IPL_DEF);
2509 
2515  GECODE_INT_EXPORT void
2516  abs(Home home, IntVar x0, IntVar x1,
2517  IntPropLevel ipl=IPL_DEF);
2518 
2524  GECODE_INT_EXPORT void
2525  mult(Home home, IntVar x0, IntVar x1, IntVar x2,
2526  IntPropLevel ipl=IPL_DEF);
2527 
2532  GECODE_INT_EXPORT void
2533  divmod(Home home, IntVar x0, IntVar x1, IntVar x2, IntVar x3,
2534  IntPropLevel ipl=IPL_DEF);
2535 
2540  GECODE_INT_EXPORT void
2541  div(Home home, IntVar x0, IntVar x1, IntVar x2,
2542  IntPropLevel ipl=IPL_DEF);
2543 
2548  GECODE_INT_EXPORT void
2549  mod(Home home, IntVar x0, IntVar x1, IntVar x2,
2550  IntPropLevel ipl=IPL_DEF);
2551 
2557  GECODE_INT_EXPORT void
2558  sqr(Home home, IntVar x0, IntVar x1,
2559  IntPropLevel ipl=IPL_DEF);
2560 
2566  GECODE_INT_EXPORT void
2567  sqrt(Home home, IntVar x0, IntVar x1,
2568  IntPropLevel ipl=IPL_DEF);
2569 
2578  GECODE_INT_EXPORT void
2579  pow(Home home, IntVar x0, int n, IntVar x1,
2580  IntPropLevel ipl=IPL_DEF);
2581 
2590  GECODE_INT_EXPORT void
2591  nroot(Home home, IntVar x0, int n, IntVar x1,
2592  IntPropLevel ipl=IPL_DEF);
2593 
2595 
2631  GECODE_INT_EXPORT void
2632  linear(Home home, const IntVarArgs& x,
2633  IntRelType irt, int c,
2634  IntPropLevel ipl=IPL_DEF);
2638  GECODE_INT_EXPORT void
2639  linear(Home home, const IntVarArgs& x,
2640  IntRelType irt, IntVar y,
2641  IntPropLevel ipl=IPL_DEF);
2645  GECODE_INT_EXPORT void
2646  linear(Home home, const IntVarArgs& x,
2647  IntRelType irt, int c, Reify r,
2648  IntPropLevel ipl=IPL_DEF);
2652  GECODE_INT_EXPORT void
2653  linear(Home home, const IntVarArgs& x,
2654  IntRelType irt, IntVar y, Reify r,
2655  IntPropLevel ipl=IPL_DEF);
2662  GECODE_INT_EXPORT void
2663  linear(Home home, const IntArgs& a, const IntVarArgs& x,
2664  IntRelType irt, int c,
2665  IntPropLevel ipl=IPL_DEF);
2672  GECODE_INT_EXPORT void
2673  linear(Home home, const IntArgs& a, const IntVarArgs& x,
2674  IntRelType irt, IntVar y,
2675  IntPropLevel ipl=IPL_DEF);
2682  GECODE_INT_EXPORT void
2683  linear(Home home, const IntArgs& a, const IntVarArgs& x,
2684  IntRelType irt, int c, Reify r,
2685  IntPropLevel ipl=IPL_DEF);
2692  GECODE_INT_EXPORT void
2693  linear(Home home, const IntArgs& a, const IntVarArgs& x,
2694  IntRelType irt, IntVar y, Reify r,
2695  IntPropLevel ipl=IPL_DEF);
2696 
2697 
2725  GECODE_INT_EXPORT void
2726  linear(Home home, const BoolVarArgs& x,
2727  IntRelType irt, int c,
2728  IntPropLevel ipl=IPL_DEF);
2732  GECODE_INT_EXPORT void
2733  linear(Home home, const BoolVarArgs& x,
2734  IntRelType irt, int c, Reify r,
2735  IntPropLevel ipl=IPL_DEF);
2739  GECODE_INT_EXPORT void
2740  linear(Home home, const BoolVarArgs& x,
2741  IntRelType irt, IntVar y,
2742  IntPropLevel ipl=IPL_DEF);
2746  GECODE_INT_EXPORT void
2747  linear(Home home, const BoolVarArgs& x,
2748  IntRelType irt, IntVar y, Reify r,
2749  IntPropLevel ipl=IPL_DEF);
2756  GECODE_INT_EXPORT void
2757  linear(Home home, const IntArgs& a, const BoolVarArgs& x,
2758  IntRelType irt, int c,
2759  IntPropLevel ipl=IPL_DEF);
2766  GECODE_INT_EXPORT void
2767  linear(Home home, const IntArgs& a, const BoolVarArgs& x,
2768  IntRelType irt, int c, Reify r,
2769  IntPropLevel ipl=IPL_DEF);
2776  GECODE_INT_EXPORT void
2777  linear(Home home, const IntArgs& a, const BoolVarArgs& x,
2778  IntRelType irt, IntVar y,
2779  IntPropLevel ipl=IPL_DEF);
2786  GECODE_INT_EXPORT void
2787  linear(Home home, const IntArgs& a, const BoolVarArgs& x,
2788  IntRelType irt, IntVar y, Reify r,
2789  IntPropLevel ipl=IPL_DEF);
2790 
2791 
2818  GECODE_INT_EXPORT void
2819  binpacking(Home home,
2820  const IntVarArgs& l,
2821  const IntVarArgs& b, const IntArgs& s,
2822  IntPropLevel ipl=IPL_DEF);
2823  /* \brief Post propagator for multi-dimensional bin packing
2824  *
2825  * In the following \a n refers to the number of items and \a m
2826  * refers to the number of bins.
2827  *
2828  * The multi-dimensional bin-packing constraint enforces that
2829  * all items are packed into bins
2830  * \f$b_i\in\{0,\ldots,m-1\}\f$ for \f$0\leq i<n\f$
2831  * and that the load of each bin corresponds to the items
2832  * packed into it for each dimension \f$l_{j\cdot
2833  * d + k} = \sum_{\{i\in\{0,\ldots,n-1\}|
2834  * b_{j\cdot d+k}=i}\}s_{i\cdot d+k}\f$
2835  * for \f$0\leq j<m\f$, \f$0\leq k<d\f$
2836  * Furthermore, the load variables must satisfy the capacity
2837  * constraints \f$l_{j\cdot d + k} \leq
2838  * c_k\f$ for \f$0\leq j<m\f$, \f$0\leq k<d\f$.
2839  *
2840  * The constraint is implemented by the decomposition
2841  * introduced in: Stefano Gualandi and Michele Lombardi. A
2842  * simple and effective decomposition for the multidimensional
2843  * binpacking constraint. CP 2013, pages 356--364.
2844  *
2845  * Posting the constraint returns a maximal set containing conflicting
2846  * items that require pairwise different bins.
2847  *
2848  * Note that posting the constraint has exponential complexity in the
2849  * number of items due to the Bron-Kerbosch algorithm used for finding
2850  * the maximal conflict item sets.
2851  *
2852  * Throws the following exceptions:
2853  * - Of type Int::ArgumentSizeMismatch if any of the following properties
2854  * is violated: \f$|b|=n\f$, \f$|l|=m\cdot d\f$, \f$|s|=n\cdot d\f$,
2855  * and \f$|c|=d\f$.
2856  * - Of type Int::ArgumentSame if \a l and \a b share unassigned variables.
2857  * - Of type Int::OutOfLimits if \a s or \a c contains a negative number.
2858  *
2859  * \ingroup TaskModelIntBinPacking
2860  */
2862  binpacking(Home home, int d,
2863  const IntVarArgs& l, const IntVarArgs& b,
2864  const IntArgs& s, const IntArgs& c,
2865  IntPropLevel ipl=IPL_DEF);
2866 
2867 
2886  GECODE_INT_EXPORT void
2887  nooverlap(Home home,
2888  const IntVarArgs& x, const IntArgs& w,
2889  const IntVarArgs& y, const IntArgs& h,
2890  IntPropLevel ipl=IPL_DEF);
2904  GECODE_INT_EXPORT void
2905  nooverlap(Home home,
2906  const IntVarArgs& x, const IntArgs& w,
2907  const IntVarArgs& y, const IntArgs& h,
2908  const BoolVarArgs& o,
2909  IntPropLevel ipl=IPL_DEF);
2926  GECODE_INT_EXPORT void
2927  nooverlap(Home home,
2928  const IntVarArgs& x0, const IntVarArgs& w, const IntVarArgs& x1,
2929  const IntVarArgs& y0, const IntVarArgs& h, const IntVarArgs& y1,
2930  IntPropLevel ipl=IPL_DEF);
2948  GECODE_INT_EXPORT void
2949  nooverlap(Home home,
2950  const IntVarArgs& x0, const IntVarArgs& w, const IntVarArgs& x1,
2951  const IntVarArgs& y0, const IntVarArgs& h, const IntVarArgs& y1,
2952  const BoolVarArgs& o,
2953  IntPropLevel ipl=IPL_DEF);
2954 
2955 
2961 
3004  GECODE_INT_EXPORT void
3005  cumulatives(Home home, const IntVarArgs& m,
3006  const IntVarArgs& s, const IntVarArgs& p,
3007  const IntVarArgs& e, const IntVarArgs& u,
3008  const IntArgs& c, bool at_most,
3009  IntPropLevel ipl=IPL_DEF);
3014  GECODE_INT_EXPORT void
3015  cumulatives(Home home, const IntArgs& m,
3016  const IntVarArgs& s, const IntVarArgs& p,
3017  const IntVarArgs& e, const IntVarArgs& u,
3018  const IntArgs& c, bool at_most,
3019  IntPropLevel ipl=IPL_DEF);
3024  GECODE_INT_EXPORT void
3025  cumulatives(Home home, const IntVarArgs& m,
3026  const IntVarArgs& s, const IntArgs& p,
3027  const IntVarArgs& e, const IntVarArgs& u,
3028  const IntArgs& c, bool at_most,
3029  IntPropLevel ipl=IPL_DEF);
3034  GECODE_INT_EXPORT void
3035  cumulatives(Home home, const IntArgs& m,
3036  const IntVarArgs& s, const IntArgs& p,
3037  const IntVarArgs& e, const IntVarArgs& u,
3038  const IntArgs& c, bool at_most,
3039  IntPropLevel ipl=IPL_DEF);
3044  GECODE_INT_EXPORT void
3045  cumulatives(Home home, const IntVarArgs& m,
3046  const IntVarArgs& s, const IntVarArgs& p,
3047  const IntVarArgs& e, const IntArgs& u,
3048  const IntArgs& c, bool at_most,
3049  IntPropLevel ipl=IPL_DEF);
3054  GECODE_INT_EXPORT void
3055  cumulatives(Home home, const IntArgs& m,
3056  const IntVarArgs& s, const IntVarArgs& p,
3057  const IntVarArgs& e, const IntArgs& u,
3058  const IntArgs& c, bool at_most,
3059  IntPropLevel ipl=IPL_DEF);
3064  GECODE_INT_EXPORT void
3065  cumulatives(Home home, const IntVarArgs& m,
3066  const IntVarArgs& s, const IntArgs& p,
3067  const IntVarArgs& e, const IntArgs& u,
3068  const IntArgs& c, bool at_most,
3069  IntPropLevel ipl=IPL_DEF);
3074  GECODE_INT_EXPORT void
3075  cumulatives(Home home, const IntArgs& m,
3076  const IntVarArgs& s, const IntArgs& p,
3077  const IntVarArgs& e, const IntArgs& u,
3078  const IntArgs& c, bool at_most,
3079  IntPropLevel ipl=IPL_DEF);
3080 
3107  GECODE_INT_EXPORT void
3108  unary(Home home, const IntVarArgs& s, const IntArgs& p,
3109  IntPropLevel ipl=IPL_DEF);
3110 
3139  GECODE_INT_EXPORT void
3140  unary(Home home, const IntVarArgs& s, const IntArgs& p,
3141  const BoolVarArgs& m, IntPropLevel ipl=IPL_DEF);
3142 
3179  GECODE_INT_EXPORT void
3180  unary(Home home, const TaskTypeArgs& t,
3181  const IntVarArgs& flex, const IntArgs& fix, IntPropLevel ipl=IPL_DEF);
3182 
3221  GECODE_INT_EXPORT void
3222  unary(Home home, const TaskTypeArgs& t,
3223  const IntVarArgs& flex, const IntArgs& fix,
3224  const BoolVarArgs& m, IntPropLevel ipl=IPL_DEF);
3225 
3252  GECODE_INT_EXPORT void
3253  unary(Home home, const IntVarArgs& s, const IntVarArgs& p,
3254  const IntVarArgs& e, IntPropLevel ipl=IPL_DEF);
3255 
3284  GECODE_INT_EXPORT void
3285  unary(Home home, const IntVarArgs& s, const IntVarArgs& p,
3286  const IntVarArgs& e, const BoolVarArgs& m, IntPropLevel ipl=IPL_DEF);
3287 
3288 
3289 
3332  GECODE_INT_EXPORT void
3333  cumulative(Home home, int c, const TaskTypeArgs& t,
3334  const IntVarArgs& flex, const IntArgs& fix, const IntArgs& u,
3335  IntPropLevel ipl=IPL_DEF);
3336 
3337 
3342  GECODE_INT_EXPORT void
3343  cumulative(Home home, IntVar c, const TaskTypeArgs& t,
3344  const IntVarArgs& flex, const IntArgs& fix, const IntArgs& u,
3345  IntPropLevel ipl=IPL_DEF);
3346 
3391  GECODE_INT_EXPORT void
3392  cumulative(Home home, int c, const TaskTypeArgs& t,
3393  const IntVarArgs& flex, const IntArgs& fix, const IntArgs& u,
3394  const BoolVarArgs& m, IntPropLevel ipl=IPL_DEF);
3395 
3399  GECODE_INT_EXPORT void
3400  cumulative(Home home, IntVar c, const TaskTypeArgs& t,
3401  const IntVarArgs& flex, const IntArgs& fix, const IntArgs& u,
3402  const BoolVarArgs& m, IntPropLevel ipl=IPL_DEF);
3403 
3436  GECODE_INT_EXPORT void
3437  cumulative(Home home, int c, const IntVarArgs& s, const IntArgs& p,
3438  const IntArgs& u, IntPropLevel ipl=IPL_DEF);
3439 
3443  GECODE_INT_EXPORT void
3444  cumulative(Home home, IntVar c, const IntVarArgs& s, const IntArgs& p,
3445  const IntArgs& u, IntPropLevel ipl=IPL_DEF);
3446 
3481  GECODE_INT_EXPORT void
3482  cumulative(Home home, int c, const IntVarArgs& s, const IntArgs& p,
3483  const IntArgs& u, const BoolVarArgs& m, IntPropLevel ipl=IPL_DEF);
3484 
3488  GECODE_INT_EXPORT void
3489  cumulative(Home home, IntVar c, const IntVarArgs& s, const IntArgs& p,
3490  const IntArgs& u, const BoolVarArgs& m, IntPropLevel ipl=IPL_DEF);
3491 
3528  GECODE_INT_EXPORT void
3529  cumulative(Home home, int c, const IntVarArgs& s, const IntVarArgs& p,
3530  const IntVarArgs& e, const IntArgs& u, IntPropLevel ipl=IPL_DEF);
3531 
3535  GECODE_INT_EXPORT void
3536  cumulative(Home home, IntVar c, const IntVarArgs& s, const IntVarArgs& p,
3537  const IntVarArgs& e, const IntArgs& u, IntPropLevel ipl=IPL_DEF);
3538 
3577  GECODE_INT_EXPORT void
3578  cumulative(Home home, int c, const IntVarArgs& s, const IntVarArgs& p,
3579  const IntVarArgs& e, const IntArgs& u, const BoolVarArgs& m,
3580  IntPropLevel ipl=IPL_DEF);
3581 
3585  GECODE_INT_EXPORT void
3586  cumulative(Home home, IntVar c, const IntVarArgs& s, const IntVarArgs& p,
3587  const IntVarArgs& e, const IntArgs& u, const BoolVarArgs& m,
3588  IntPropLevel ipl=IPL_DEF);
3590 
3591 
3611  GECODE_INT_EXPORT void
3612  circuit(Home home, const IntVarArgs& x,
3613  IntPropLevel ipl=IPL_DEF);
3629  GECODE_INT_EXPORT void
3630  circuit(Home home, int offset, const IntVarArgs& x,
3631  IntPropLevel ipl=IPL_DEF);
3653  GECODE_INT_EXPORT void
3654  circuit(Home home,
3655  const IntArgs& c,
3656  const IntVarArgs& x, const IntVarArgs& y, IntVar z,
3657  IntPropLevel ipl=IPL_DEF);
3680  GECODE_INT_EXPORT void
3681  circuit(Home home,
3682  const IntArgs& c, int offset,
3683  const IntVarArgs& x, const IntVarArgs& y, IntVar z,
3684  IntPropLevel ipl=IPL_DEF);
3703  GECODE_INT_EXPORT void
3704  circuit(Home home,
3705  const IntArgs& c,
3706  const IntVarArgs& x, IntVar z,
3707  IntPropLevel ipl=IPL_DEF);
3728  GECODE_INT_EXPORT void
3729  circuit(Home home,
3730  const IntArgs& c, int offset,
3731  const IntVarArgs& x, IntVar z,
3732  IntPropLevel ipl=IPL_DEF);
3748  GECODE_INT_EXPORT void
3749  path(Home home, const IntVarArgs& x, IntVar s, IntVar e,
3750  IntPropLevel ipl=IPL_DEF);
3768  GECODE_INT_EXPORT void
3769  path(Home home, int offset, const IntVarArgs& x, IntVar s, IntVar e,
3770  IntPropLevel ipl=IPL_DEF);
3793  GECODE_INT_EXPORT void
3794  path(Home home,
3795  const IntArgs& c,
3796  const IntVarArgs& x, IntVar s, IntVar e, const IntVarArgs& y, IntVar z,
3797  IntPropLevel ipl=IPL_DEF);
3822  GECODE_INT_EXPORT void
3823  path(Home home,
3824  const IntArgs& c, int offset,
3825  const IntVarArgs& x, IntVar s, IntVar e, const IntVarArgs& y, IntVar z,
3826  IntPropLevel ipl=IPL_DEF);
3847  GECODE_INT_EXPORT void
3848  path(Home home,
3849  const IntArgs& c,
3850  const IntVarArgs& x, IntVar s, IntVar e, IntVar z,
3851  IntPropLevel ipl=IPL_DEF);
3874  GECODE_INT_EXPORT void
3875  path(Home home,
3876  const IntArgs& c, int offset,
3877  const IntVarArgs& x, IntVar s, IntVar e, IntVar z,
3878  IntPropLevel ipl=IPL_DEF);
3880 
3881 
3882 
3891  GECODE_INT_EXPORT void
3893  wait(Home home, IntVar x, std::function<void(Space& home)> c,
3894  IntPropLevel ipl=IPL_DEF);
3896  GECODE_INT_EXPORT void
3897  wait(Home home, BoolVar x, std::function<void(Space& home)> c,
3898  IntPropLevel ipl=IPL_DEF);
3900  GECODE_INT_EXPORT void
3901  wait(Home home, const IntVarArgs& x, std::function<void(Space& home)> c,
3902  IntPropLevel ipl=IPL_DEF);
3904  GECODE_INT_EXPORT void
3905  wait(Home home, const BoolVarArgs& x,
3906  std::function<void(Space& home)> c,
3907  IntPropLevel ipl=IPL_DEF);
3909  GECODE_INT_EXPORT void
3910  when(Home home, BoolVar x,
3911  std::function<void(Space& home)> t,
3912  std::function<void(Space& home)> e,
3913  IntPropLevel ipl=IPL_DEF);
3915  GECODE_INT_EXPORT void
3916  when(Home home, BoolVar x,
3917  std::function<void(Space& home)> t,
3918  IntPropLevel ipl=IPL_DEF);
3920 
3921 
3946  GECODE_INT_EXPORT void
3947  unshare(Home home, IntVarArgs& x,
3948  IntPropLevel ipl=IPL_DEF);
3950  GECODE_INT_EXPORT void
3951  unshare(Home home, BoolVarArgs& x,
3952  IntPropLevel ipl=IPL_DEF);
3954 
3955 }
3956 
3957 namespace Gecode {
3958 
3972  typedef std::function<bool(const Space& home, IntVar x, int i)>
3982  typedef std::function<bool(const Space& home, BoolVar x, int i)>
3984 
3994  typedef std::function<double(const Space& home, IntVar x, int i)>
4005  typedef std::function<double(const Space& home, BoolVar x, int i)>
4007 
4018  typedef std::function<int(const Space& home, IntVar x, int i)>
4030  typedef std::function<int(const Space& home, BoolVar x, int i)>
4032 
4044  typedef std::function<void(Space& home, unsigned int a,
4045  IntVar x, int i, int n)>
4058  typedef std::function<void(Space& home, unsigned int a,
4059  BoolVar x, int i, int n)>
4061 
4062 }
4063 
4065 
4066 namespace Gecode {
4067 
4073  class IntAFC : public AFC {
4074  public:
4082  IntAFC(void);
4084  IntAFC(const IntAFC& a);
4086  IntAFC& operator =(const IntAFC& a);
4094  IntAFC(Home home, const IntVarArgs& x, double d=1.0, bool share=true);
4105  void init(Home home, const IntVarArgs& x, double d=1.0, bool share=true);
4106  };
4107 
4113  class BoolAFC : public AFC {
4114  public:
4122  BoolAFC(void);
4124  BoolAFC(const BoolAFC& a);
4126  BoolAFC& operator =(const BoolAFC& a);
4134  BoolAFC(Home home, const BoolVarArgs& x, double d=1.0, bool share=true);
4145  void init(Home home, const BoolVarArgs& x, double d=1.0, bool share=true);
4146  };
4147 
4148 }
4149 
4150 #include <gecode/int/branch/afc.hpp>
4151 
4152 namespace Gecode {
4153 
4159  class IntAction : public Action {
4160  public:
4168  IntAction(void);
4170  IntAction(const IntAction& a);
4172  IntAction& operator =(const IntAction& a);
4181  IntAction(Home home, const IntVarArgs& x, double d=1.0,
4182  IntBranchMerit bm=nullptr);
4194  GECODE_INT_EXPORT void
4195  init(Home home, const IntVarArgs& x, double d=1.0,
4196  IntBranchMerit bm=nullptr);
4197  };
4198 
4204  class BoolAction : public Action {
4205  public:
4213  BoolAction(void);
4215  BoolAction(const BoolAction& a);
4217  BoolAction& operator =(const BoolAction& a);
4226  BoolAction(Home home, const BoolVarArgs& x, double d=1.0,
4227  BoolBranchMerit bm=nullptr);
4239  GECODE_INT_EXPORT void
4240  init(Home home, const BoolVarArgs& x, double d=1.0,
4241  BoolBranchMerit bm=nullptr);
4242  };
4243 
4244 }
4245 
4247 
4248 namespace Gecode {
4249 
4255  class IntCHB : public CHB {
4256  public:
4264  IntCHB(void);
4266  IntCHB(const IntCHB& chb);
4268  IntCHB& operator =(const IntCHB& chb);
4278  IntCHB(Home home, const IntVarArgs& x, IntBranchMerit bm=nullptr);
4290  GECODE_INT_EXPORT void
4291  init(Home home, const IntVarArgs& x, IntBranchMerit bm=nullptr);
4292  };
4293 
4299  class BoolCHB : public CHB {
4300  public:
4308  BoolCHB(void);
4310  BoolCHB(const BoolCHB& chb);
4312  BoolCHB& operator =(const BoolCHB& chb);
4322  BoolCHB(Home home, const BoolVarArgs& x, BoolBranchMerit bm=nullptr);
4334  GECODE_INT_EXPORT void
4335  init(Home home, const BoolVarArgs& x, BoolBranchMerit bm=nullptr);
4336  };
4337 
4338 }
4339 
4340 #include <gecode/int/branch/chb.hpp>
4341 
4342 namespace Gecode {
4343 
4345  typedef std::function<void(const Space &home, const Brancher& b,
4346  unsigned int a,
4347  IntVar x, int i, const int& n,
4348  std::ostream& o)>
4350 
4352  typedef std::function<void(const Space &home, const Brancher& b,
4353  unsigned int a,
4354  BoolVar x, int i, const int& n,
4355  std::ostream& o)>
4357 
4358 }
4359 
4360 namespace Gecode {
4361 
4367  class IntVarBranch : public VarBranch<IntVar> {
4368  public:
4370  enum Select {
4371  SEL_NONE = 0,
4397 
4420  SEL_REGRET_MAX_MAX
4421  };
4422  protected:
4425  public:
4427  IntVarBranch(void);
4429  IntVarBranch(Rnd r);
4433  IntVarBranch(Select s, double d, BranchTbl t);
4443  Select select(void) const;
4445  void expand(Home home, const IntVarArgs& x);
4446  };
4447 
4453  class BoolVarBranch : public VarBranch<BoolVar> {
4454  public:
4456  enum Select {
4457  SEL_NONE = 0,
4468  SEL_CHB_MAX
4469  };
4470  protected:
4473  public:
4475  BoolVarBranch(void);
4477  BoolVarBranch(Rnd r);
4481  BoolVarBranch(Select s, double d, BranchTbl t);
4491  Select select(void) const;
4493  void expand(Home home, const BoolVarArgs& x);
4494  };
4495 
4501  IntVarBranch INT_VAR_NONE(void);
4514  IntVarBranch INT_VAR_AFC_MIN(double d=1.0, BranchTbl tbl=nullptr);
4518  IntVarBranch INT_VAR_AFC_MAX(double d=1.0, BranchTbl tbl=nullptr);
4522  IntVarBranch INT_VAR_ACTION_MIN(double d=1.0, BranchTbl tbl=nullptr);
4526  IntVarBranch INT_VAR_ACTION_MAX(double d=1.0, BranchTbl tbl=nullptr);
4554  IntVarBranch INT_VAR_AFC_SIZE_MIN(double d=1.0, BranchTbl tbl=nullptr);
4558  IntVarBranch INT_VAR_AFC_SIZE_MAX(double d=1.0, BranchTbl tbl=nullptr);
4562  IntVarBranch INT_VAR_ACTION_SIZE_MIN(double d=1.0, BranchTbl tbl=nullptr);
4566  IntVarBranch INT_VAR_ACTION_SIZE_MAX(double d=1.0, BranchTbl tbl=nullptr);
4601 
4615  BoolVarBranch BOOL_VAR_AFC_MIN(double d=1.0, BranchTbl tbl=nullptr);
4619  BoolVarBranch BOOL_VAR_AFC_MAX(double d=1.0, BranchTbl tbl=nullptr);
4623  BoolVarBranch BOOL_VAR_ACTION_MIN(double d=1.0, BranchTbl tbl=nullptr);
4627  BoolVarBranch BOOL_VAR_ACTION_MAX(double d=1.0, BranchTbl tbl=nullptr);
4639 
4640 }
4641 
4642 #include <gecode/int/branch/var.hpp>
4643 
4644 namespace Gecode {
4645 
4651  class IntValBranch : public ValBranch<IntVar> {
4652  public:
4654  enum Select {
4665  SEL_VALUES_MAX
4666  };
4667  protected:
4670  public:
4672  IntValBranch(Select s = SEL_MIN);
4674  IntValBranch(Rnd r);
4678  Select select(void) const;
4679  };
4680 
4686  class BoolValBranch : public ValBranch<BoolVar> {
4687  public:
4689  enum Select {
4693  SEL_VAL_COMMIT
4694  };
4695  protected:
4698  public:
4700  BoolValBranch(Select s = SEL_MIN);
4702  BoolValBranch(Rnd r);
4706  Select select(void) const;
4707  };
4708 
4714  IntValBranch INT_VAL_MIN(void);
4717  IntValBranch INT_VAL_MED(void);
4719  IntValBranch INT_VAL_MAX(void);
4741 
4756 
4757 }
4758 
4759 #include <gecode/int/branch/val.hpp>
4760 
4761 namespace Gecode {
4762 
4768  class IntAssign : public ValBranch<IntVar> {
4769  public:
4771  enum Select {
4776  SEL_VAL_COMMIT
4777  };
4778  protected:
4781  public:
4783  IntAssign(Select s = SEL_MIN);
4785  IntAssign(Rnd r);
4789  Select select(void) const;
4790  };
4791 
4797  class BoolAssign : public ValBranch<BoolVar> {
4798  public:
4800  enum Select {
4804  SEL_VAL_COMMIT
4805  };
4806  protected:
4809  public:
4811  BoolAssign(Select s = SEL_MIN);
4813  BoolAssign(Rnd r);
4817  Select select(void) const;
4818  };
4819 
4825  IntAssign INT_ASSIGN_MIN(void);
4828  IntAssign INT_ASSIGN_MED(void);
4830  IntAssign INT_ASSIGN_MAX(void);
4840 
4855 
4856 }
4857 
4859 
4860 namespace Gecode {
4866  GECODE_INT_EXPORT void
4867  branch(Home home, const IntVarArgs& x,
4868  IntVarBranch vars, IntValBranch vals,
4869  IntBranchFilter bf=nullptr,
4870  IntVarValPrint vvp=nullptr);
4876  GECODE_INT_EXPORT void
4877  branch(Home home, const IntVarArgs& x,
4879  IntBranchFilter bf=nullptr,
4880  IntVarValPrint vvp=nullptr);
4886  GECODE_INT_EXPORT void
4887  branch(Home home, IntVar x, IntValBranch vals,
4888  IntVarValPrint vvp=nullptr);
4894  GECODE_INT_EXPORT void
4895  branch(Home home, const BoolVarArgs& x,
4896  BoolVarBranch vars, BoolValBranch vals,
4897  BoolBranchFilter bf=nullptr,
4898  BoolVarValPrint vvp=nullptr);
4904  GECODE_INT_EXPORT void
4905  branch(Home home, const BoolVarArgs& x,
4907  BoolBranchFilter bf=nullptr,
4908  BoolVarValPrint vvp=nullptr);
4914  GECODE_INT_EXPORT void
4915  branch(Home home, BoolVar x, BoolValBranch vals,
4916  BoolVarValPrint vvp=nullptr);
4917 
4923  GECODE_INT_EXPORT void
4924  assign(Home home, const IntVarArgs& x, IntAssign vals,
4925  IntBranchFilter bf=nullptr,
4926  IntVarValPrint vvp=nullptr);
4932  GECODE_INT_EXPORT void
4933  assign(Home home, IntVar x, IntAssign vals,
4934  IntVarValPrint vvp=nullptr);
4940  GECODE_INT_EXPORT void
4941  assign(Home home, const BoolVarArgs& x, BoolAssign vals,
4942  BoolBranchFilter bf=nullptr,
4943  BoolVarValPrint vvp=nullptr);
4949  GECODE_INT_EXPORT void
4950  assign(Home home, BoolVar x, BoolAssign vals,
4951  BoolVarValPrint vvp=nullptr);
4952 
4953 }
4954 
4955 namespace Gecode {
4956 
4960  template<class Char, class Traits>
4961  std::basic_ostream<Char,Traits>&
4962  operator <<(std::basic_ostream<Char,Traits>& os, const DFA& d);
4963 
4967  template<class Char, class Traits>
4968  std::basic_ostream<Char,Traits>&
4969  operator <<(std::basic_ostream<Char,Traits>& os, const TupleSet& ts);
4970 
4971 }
4972 
4973 // LDSB-related declarations.
4974 namespace Gecode {
4975 
4976  namespace Int { namespace LDSB {
4977  class SymmetryObject;
4978  }}
4979 
4986  public:
4990  void increment(void);
4992  void decrement(void);
4993  public:
4995  SymmetryHandle(void);
4999  SymmetryHandle(const SymmetryHandle& h);
5001  const SymmetryHandle& operator=(const SymmetryHandle& h);
5003  ~SymmetryHandle(void);
5004  };
5005  class Symmetries;
5007  template<>
5009  public:
5013  };
5014 
5021  class Symmetries : public ArgArray<SymmetryHandle> {};
5023  // If this is instead a typedef, strange things happen with the
5024  // overloading of the "branch" function.
5025 
5032  const IntArgs& indices);
5059  SymmetryHandle ValueSequenceSymmetry(const IntArgs& v, int ss);
5060 
5062  GECODE_INT_EXPORT SymmetryHandle values_reflect(int lower, int upper);
5066 
5078  GECODE_INT_EXPORT void
5079  branch(Home home, const IntVarArgs& x,
5080  IntVarBranch vars, IntValBranch vals,
5081  const Symmetries& syms,
5082  IntBranchFilter bf=nullptr,
5083  IntVarValPrint vvp=nullptr);
5095  GECODE_INT_EXPORT void
5096  branch(Home home, const IntVarArgs& x,
5098  const Symmetries& syms,
5099  IntBranchFilter bf=nullptr,
5100  IntVarValPrint vvp=nullptr);
5112  GECODE_INT_EXPORT void
5113  branch(Home home, const BoolVarArgs& x,
5114  BoolVarBranch vars, BoolValBranch vals,
5115  const Symmetries& syms,
5116  BoolBranchFilter bf=nullptr,
5117  BoolVarValPrint vvp=nullptr);
5129  GECODE_INT_EXPORT void
5130  branch(Home home, const BoolVarArgs& x,
5132  const Symmetries& syms,
5133  BoolBranchFilter bf=nullptr,
5134  BoolVarValPrint vvp=nullptr);
5135 }
5136 
5137 namespace Gecode {
5138 
5139  /*
5140  * \brief Relaxed assignment of variables in \a x from values in \a sx
5141  *
5142  * The variables in \a x are assigned values from the assigned variables
5143  * in the solution \a sx with a relaxation probability \a p. That is,
5144  * if \$fp=0.1\f$ approximately 10% of the variables in \a x will be
5145  * assigned a value from \a sx.
5146  *
5147  * The random numbers are generated from the generator \a r. At least
5148  * one variable will not be assigned: in case the relaxation attempt
5149  * would suggest that all variables should be assigned, a single
5150  * variable will be selected randomly to remain unassigned.
5151  *
5152  * Throws an exception of type Int::ArgumentSizeMismatch, if \a x and
5153  * \a sx are of different size.
5154  *
5155  * Throws an exception of type Int::OutOfLimits, if \a p is not between
5156  * \a 0.0 and \a 1.0.
5157  *
5158  * \ingroup TaskModelInt
5159  */
5160  GECODE_INT_EXPORT void
5161  relax(Home home, const IntVarArgs& x, const IntVarArgs& sx,
5162  Rnd r, double p);
5163 
5164  /*
5165  * \brief Relaxed assignment of variables in \a x from values in \a sx
5166  *
5167  * The variables in \a x are assigned values from the assigned variables
5168  * in the solution \a sx with a relaxation probability \a p. That is,
5169  * if \$fp=0.1\f$ approximately 10% of the variables in \a x will be
5170  * assigned a value from \a sx.
5171  *
5172  * The random numbers are generated from the generator \a r. At least
5173  * one variable will not be assigned: in case the relaxation attempt
5174  * would suggest that all variables should be assigned, a single
5175  * variable will be selected randomly to remain unassigned.
5176  *
5177  * Throws an exception of type Int::ArgumentSizeMismatch, if \a x and
5178  * \a sx are of different size.
5179  *
5180  * Throws an exception of type Int::OutOfLimits, if \a p is not between
5181  * \a 0.0 and \a 1.0.
5182  *
5183  * \ingroup TaskModelInt
5184  */
5185  GECODE_INT_EXPORT void
5186  relax(Home home, const BoolVarArgs& x, const BoolVarArgs& sx,
5187  Rnd r, double p);
5188 
5189 }
5190 
5191 
5194 
5195 namespace Gecode {
5196 
5207  : public Iter::Ranges::Diff<Iter::Ranges::RangeList,
5208  Int::ViewRanges<Int::IntView> > {
5209  protected:
5214  public:
5216 
5220  };
5221 
5227  protected:
5229  int delta;
5230  public:
5232 
5236 
5238  bool operator ()(void) const;
5241  void operator ++(void);
5243 
5245 
5246  int min(void) const;
5249  int max(void) const;
5251  unsigned int width(void) const;
5253  };
5254 
5255 }
5256 
5259 
5260 #include <gecode/int/trace/traits.hpp>
5261 
5262 namespace Gecode {
5263 
5274 
5279  class GECODE_INT_EXPORT StdIntTracer : public IntTracer {
5280  protected:
5282  std::ostream& os;
5283  public:
5285  StdIntTracer(std::ostream& os0 = std::cerr);
5287  virtual void init(const Space& home, const IntTraceRecorder& t);
5289  virtual void prune(const Space& home, const IntTraceRecorder& t,
5290  const ViewTraceInfo& vti, int i, IntTraceDelta& d);
5292  virtual void fix(const Space& home, const IntTraceRecorder& t);
5294  virtual void fail(const Space& home, const IntTraceRecorder& t);
5296  virtual void done(const Space& home, const IntTraceRecorder& t);
5299  };
5300 
5301 
5312 
5317  class GECODE_INT_EXPORT StdBoolTracer : public BoolTracer {
5318  protected:
5320  std::ostream& os;
5321  public:
5323  StdBoolTracer(std::ostream& os0 = std::cerr);
5325  virtual void init(const Space& home, const BoolTraceRecorder& t);
5327  virtual void prune(const Space& home, const BoolTraceRecorder& t,
5328  const ViewTraceInfo& vti, int i, BoolTraceDelta& d);
5330  virtual void fix(const Space& home, const BoolTraceRecorder& t);
5332  virtual void fail(const Space& home, const BoolTraceRecorder& t);
5334  virtual void done(const Space& home, const BoolTraceRecorder& t);
5337  };
5338 
5343  GECODE_INT_EXPORT void
5344  trace(Home home, const IntVarArgs& x,
5345  TraceFilter tf,
5346  int te = (TE_INIT | TE_PRUNE | TE_FIX | TE_FAIL | TE_DONE),
5347  IntTracer& t = StdIntTracer::def);
5352  void
5353  trace(Home home, const IntVarArgs& x,
5354  int te = (TE_INIT | TE_PRUNE | TE_FIX | TE_FAIL | TE_DONE),
5355  IntTracer& t = StdIntTracer::def);
5356 
5361  GECODE_INT_EXPORT void
5362  trace(Home home, const BoolVarArgs& x,
5363  TraceFilter tf,
5364  int te = (TE_INIT | TE_PRUNE | TE_FIX | TE_FAIL | TE_DONE),
5365  BoolTracer& t = StdBoolTracer::def);
5370  void
5371  trace(Home home, const BoolVarArgs& x,
5372  int te = (TE_INIT | TE_PRUNE | TE_FIX | TE_FAIL | TE_DONE),
5373  BoolTracer& t = StdBoolTracer::def);
5374 
5375 }
5376 
5377 #include <gecode/int/trace.hpp>
5378 
5379 #endif
5380 
5381 // IFDEF: GECODE_HAS_INT_VARS
5382 // STATISTICS: int-post
5383 
Value iterator for integer variables.
Definition: int.hh:470
BoolValBranch BOOL_VAL_RND(Rnd r)
Select random value.
Definition: val.hpp:144
const Range * c
Current range.
Definition: int.hh:2318
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:4046
Bounds propagation.
Definition: int.hh:957
std::function< double(const Space &home, BoolVar x, int i)> BoolBranchMerit
Branch merit function type for Boolean variables.
Definition: int.hh:4006
With smallest accumulated failure count.
Definition: int.hh:4377
void mod(Home home, IntVar x0, IntVar x1, IntVar x2, IntPropLevel ipl)
Post propagator for .
Definition: arithmetic.cpp:267
IntVarBranch INT_VAR_DEGREE_SIZE_MAX(BranchTbl tbl)
Select variable with largest degree divided by domain size.
Definition: var.hpp:225
Int::ViewRanges< Int::IntView > rn
Iterator over the new values.
Definition: int.hh:5211
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:89
IntVarArgs(const VarArray< IntVar > &a)
Initialize from variable array a (copy elements)
Definition: int.hh:648
Duplicate of a Boolean view.
IntPropLevel vbd(IntPropLevel ipl)
Extract value, bounds, or domain propagation from propagation level.
Definition: ipl.hpp:41
int symbol
symbol
Definition: int.hh:2039
Variables as interfaces to variable implementations.
Definition: var.hpp:51
NodeType t
Type of node.
Definition: bool-expr.cpp:234
Tracer that process view trace information.
Definition: tracer.hpp:55
IntVarBranch INT_VAR_CHB_SIZE_MAX(IntCHB c, BranchTbl tbl)
Select variable with largest CHB Q-score divided by domain size.
Definition: var.hpp:280
IntVarBranch INT_VAR_NONE(void)
Select first unassigned variable.
Definition: var.hpp:100
Combine variable selection criteria for tie-breaking.
Definition: tiebreak.hpp:42
int arity
Arity.
Definition: int.hh:2188
Select s
Which variable to select.
Definition: int.hh:4424
void mult(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition: arithmetic.cpp:92
BoolVarBranch BOOL_VAR_NONE(void)
Select first unassigned variable.
Definition: var.hpp:368
The shared handle.
int * td
Tuple data.
Definition: int.hh:2202
NNF * l
Left subtree.
Definition: bool-expr.cpp:244
TaskType
Type of task for scheduling constraints.
Definition: int.hh:982
Inverse implication for reification.
Definition: int.hh:848
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:43
int n_free
Number of free tuple entries of arity.
Definition: int.hh:2194
BoolVarBranch BOOL_VAR_AFC_MIN(double d, BranchTbl tbl)
Select variable with smallest accumulated failure count with decay factor d.
Definition: var.hpp:398
With largest min-regret.
Definition: int.hh:4408
Select s
Which value to select.
Definition: int.hh:4808
View trace information.
Definition: core.hpp:898
Range iterator for integer sets.
Definition: int.hh:272
BoolAssign BOOL_ASSIGN_MIN(void)
Select smallest value.
Definition: assign.hpp:104
BoolVarArgs(const VarArray< BoolVar > &a)
Initialize from variable array a (copy elements)
Definition: int.hh:702
void sequence(Home home, const IntVarArgs &x, const IntSet &s, int q, int l, int u, IntPropLevel)
Post propagator for .
Definition: sequence.cpp:51
Iterator for DFA symbols.
Definition: int.hh:2070
Select random value.
Definition: int.hh:4692
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:43
Which values to select for branching first.
Definition: int.hh:4686
void channel(Home home, FloatVar x0, IntVar x1)
Post propagator for channeling a float and an integer variable .
Definition: channel.cpp:45
Iter::Ranges::RangeList ro
Iterator over the old values.
Definition: int.hh:5213
void count(Home home, const IntVarArgs &x, int n, IntRelType irt, int m, IntPropLevel)
Post propagator for .
Definition: count.cpp:44
bool one(const Gecode::FloatValArgs &a)
Check whether has only one coefficients.
Definition: linear.cpp:50
Standard Boolean variable tracer.
Definition: int.hh:5317
Select
Which value selection.
Definition: int.hh:4771
Select smallest value.
Definition: int.hh:4690
Argument array for primtive types.
Definition: array.hpp:628
BoolOpType
Operation types for Booleans.
Definition: int.hh:929
With smallest accumulated failure count.
Definition: int.hh:4463
Which values to select for branching first.
Definition: int.hh:4651
With smallest degree.
Definition: int.hh:4375
BoolVarArgs(const BoolVarArgs &a)
Initialize from variable argument array a (copy elements)
Definition: int.hh:700
IntVarBranch INT_VAR_SIZE_MAX(BranchTbl tbl)
Select variable with largest domain size.
Definition: var.hpp:215
Select smallest value.
Definition: int.hh:4655
Which integer variable to select for branching.
Definition: int.hh:4367
With largest accumulated failure count.
Definition: int.hh:4378
void abs(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition: arithmetic.cpp:45
IntAssign INT_ASSIGN_MED(void)
Select greatest value not greater than the median.
Definition: assign.hpp:64
Select s
Which value to select.
Definition: int.hh:4697
Less or equal ( )
Definition: int.hh:907
void nroot(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for $n 0$.
Definition: arithmetic.cpp:122
void pow(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for $n 0$.
Definition: arithmetic.cpp:113
IntVarBranch INT_VAR_REGRET_MIN_MIN(BranchTbl tbl)
Select variable with smallest min-regret.
Definition: var.hpp:290
IntVarBranch INT_VAR_DEGREE_MAX(BranchTbl tbl)
Select variable with largest degree.
Definition: var.hpp:125
BoolVarBranch BOOL_VAR_ACTION_MIN(double d, BranchTbl tbl)
Select variable with lowest action with decay factor d.
Definition: var.hpp:418
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:119
Conjunction.
Definition: int.hh:930
Range iterator for range lists
With largest accumulated failure count divided by domain size.
Definition: int.hh:4392
IntVarBranch INT_VAR_AFC_MIN(double d, BranchTbl tbl)
Select variable with smallest accumulated failure count with decay factor d.
Definition: var.hpp:130
int * Tuple
Type of a tuple.
Definition: int.hh:2150
void member(Home home, const IntVarArgs &x, IntVar y, IntPropLevel)
Post domain consistent propagator for .
Definition: member.cpp:43
BoolVarArgs(const std::vector< BoolVar > &a)
Initialize from vector a.
Definition: int.hh:705
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:128
void dom(Home home, FloatVar x, FloatVal n)
Propagates .
Definition: dom.cpp:44
Collection of symmetries.
Definition: int.hh:5022
Which values to select for assignment.
Definition: int.hh:4797
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:45
With highest action.
Definition: int.hh:4466
Implementation of a symmetry at the modelling level.
Definition: ldsb.hh:110
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:94
IntVarBranch INT_VAR_CHB_SIZE_MIN(IntCHB c, BranchTbl tbl)
Select variable with smallest CHB Q-score divided by domain size.
Definition: var.hpp:270
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:72
IntVarArgs(InputIterator first, InputIterator last)
Initialize from InputIterator first and last.
Definition: int.hh:653
Implication.
Definition: int.hh:932
Integer variable array.
Definition: int.hh:742
IntVarBranch INT_VAR_MERIT_MAX(IntBranchMerit bm, BranchTbl tbl)
Select variable with highest merit according to branch merit function bm.
Definition: var.hpp:115
Select the smallest range of the variable domain if it has several ranges, otherwise select values no...
Definition: int.hh:4661
void circuit(Home home, int offset, const IntVarArgs &x, IntPropLevel ipl)
Post propagator such that x forms a circuit.
Definition: circuit.cpp:45
void argmin(Home home, const IntVarArgs &x, IntVar y, bool tiebreak, IntPropLevel)
Post propagator for .
Definition: arithmetic.cpp:167
BoolVarBranch BOOL_VAR_MERIT_MIN(BoolBranchMerit bm, BranchTbl tbl)
Select variable with least merit according to branch merit function bm.
Definition: var.hpp:378
IntVarArgs(const std::vector< IntVar > &a)
Initialize from vector a.
Definition: int.hh:650
BoolAssign BOOL_ASSIGN_MAX(void)
Select largest value.
Definition: assign.hpp:109
BitSetData * support
Pointer to all support data.
Definition: int.hh:2208
Select s
Which value to select.
Definition: int.hh:4669
IntVarBranch INT_VAR_REGRET_MIN_MAX(BranchTbl tbl)
Select variable with largest min-regret.
Definition: var.hpp:295
Greater ( )
Definition: int.hh:910
void binpacking(Home home, const IntVarArgs &l, const IntVarArgs &b, const IntArgs &s, IntPropLevel)
Post propagator for bin packing.
Definition: bin-packing.cpp:45
Select largest value.
Definition: int.hh:4802
ArgArray< IntSet > IntSetArgs
Passing set arguments.
Definition: int.hh:599
Trace init events.
Definition: recorder.hpp:47
const int max
Largest allowed integer value.
Definition: int.hh:116
With largest accumulated failure count.
Definition: int.hh:4464
With lowest action.
Definition: int.hh:4465
Computation spaces.
Definition: core.hpp:1668
ExecStatus prune(Space &home, ViewArray< VX > &x, ConstIntView)
Definition: rel.hpp:268
Greater or equal ( )
Definition: int.hh:909
Standard integer variable tracer.
Definition: int.hh:5279
Select s
Which value to select.
Definition: int.hh:4780
ViewTracer< Int::IntView > IntTracer
Tracer for integer variables.
Definition: int.hh:5268
With smallest min.
Definition: int.hh:4383
int min
Smallest value.
Definition: int.hh:2196
int i_state
input state
Definition: int.hh:2038
Exclusive or.
Definition: int.hh:934
const int min
Smallest allowed integer value.
Definition: int.hh:118
Select smallest value.
Definition: int.hh:4772
IntVarArgs(int n)
Allocate array with n elements.
Definition: int.hh:644
Iterator over ranges.
Definition: int.hh:2315
ViewTraceRecorder< Int::IntView > IntTraceRecorder
Trace recorder for integer variables.
Definition: int.hh:5273
Range iterator for integer variables
Definition: int.hh:453
IntAssign INT_ASSIGN_MIN(void)
Select smallest value.
Definition: assign.hpp:59
IntValBranch INT_VAL_RND(Rnd r)
Select random value.
Definition: val.hpp:74
With lowest action.
Definition: int.hh:4379
Random (uniform, for tie breaking)
Definition: int.hh:4458
Gecode::IntSet d(v, 7)
bool overflow_mul(int n, int m)
Check whether multiplying n and m would overflow.
Definition: limits.hpp:111
IntVarBranch INT_VAR_MAX_MAX(BranchTbl tbl)
Select variable with largest max.
Definition: var.hpp:205
Select s
Which variable to select.
Definition: int.hh:4472
Range * r
Ranges.
Definition: int.hh:2174
ValueData * vd
Value data.
Definition: int.hh:2204
std::string expand(Gecode::IntRelType irt)
Expand relation to abbreviation.
Definition: mm-count.cpp:48
Reify imp(BoolVar x)
Use implication for reification.
Definition: reify.hpp:77
Gecode::FloatVal c(-8, 8)
Trace prune events.
Definition: recorder.hpp:48
SymmetryHandle VariableSymmetry(const IntVarArgs &vars)
Variables in x are interchangeable.
Definition: ldsb.cpp:66
Deterministic finite automaton (DFA)
Definition: int.hh:2027
int p
Number of positive literals for node type.
Definition: bool-expr.cpp:236
IntVarBranch INT_VAR_ACTION_MAX(double d, BranchTbl tbl)
Select variable with highest action with decay factor d.
Definition: var.hpp:160
With smallest max-regret.
Definition: int.hh:4414
BoolValBranch BOOL_VAL_MIN(void)
Select smallest value.
Definition: val.hpp:134
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:240
IntAssign INT_ASSIGN(IntBranchVal v, IntBranchCommit c)
Select value as defined by the value function v and commit function c.
Definition: assign.hpp:79
Gecode::IntArgs i(4, 1, 2, 3, 4)
Base-class for branchers.
Definition: core.hpp:1368
Class for AFC (accumulated failure count) management.
Definition: afc.hpp:44
IntRelType neg(IntRelType irt)
Return negated relation type of irt.
Definition: irt.hpp:56
BoolValBranch BOOL_VAL_MAX(void)
Select largest value.
Definition: val.hpp:139
int n
Number of negative literals for node type.
Definition: bool-expr.cpp:238
Equality ( )
Definition: int.hh:905
void unshare(Home home, IntVarArgs &x, IntPropLevel ipl)
Replace multiple variable occurences in x by fresh variables.
Definition: unshare.cpp:140
std::size_t key
Hash key.
Definition: int.hh:2200
const long long int llmin
Smallest allowed long long integer value.
Definition: int.hh:124
Select random value.
Definition: int.hh:4775
With smallest degree.
Definition: int.hh:4461
With smallest min-regret.
Definition: int.hh:4402
A reference-counted pointer to a SymmetryObject.
Definition: int.hh:4985
void divmod(Home home, IntVar x0, IntVar x1, IntVar x2, IntVar x3, IntPropLevel)
Post propagator for .
Definition: arithmetic.cpp:234
std::function< int(const Space &home, IntVar x, int i)> IntBranchVal
Branch value function type for integer variables.
Definition: int.hh:4019
void nvalues(Home home, const IntVarArgs &x, IntRelType irt, int y, IntPropLevel)
Post propagator for .
Definition: nvalues.cpp:44
IntAssign INT_ASSIGN_RND(Rnd r)
Select random value.
Definition: assign.hpp:74
With largest action divided by domain size.
Definition: int.hh:4394
unsigned int n_words
Number of words for support.
Definition: int.hh:2190
Select
Which value selection.
Definition: int.hh:4800
IntRelType
Relation types for integers.
Definition: int.hh:904
IntVarBranch INT_VAR_MIN_MIN(BranchTbl tbl)
Select variable with smallest min.
Definition: var.hpp:190
SymmetryHandle ValueSequenceSymmetry(const IntArgs &vs, int ss)
Value sequences in v of size ss are interchangeable.
Definition: ldsb.cpp:106
Select greatest value not greater than the median.
Definition: int.hh:4656
BoolVarBranch BOOL_VAR_DEGREE_MIN(BranchTbl tbl)
Select variable with smallest degree.
Definition: var.hpp:388
void sqr(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition: arithmetic.cpp:99
Range * range
Pointer to all ranges.
Definition: int.hh:2206
IntAssign INT_ASSIGN_MAX(void)
Select largest value.
Definition: assign.hpp:69
bool operator!=(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:321
Simple propagation levels.
Definition: int.hh:955
IntVarBranch INT_VAR_MERIT_MIN(IntBranchMerit bm, BranchTbl tbl)
Select variable with least merit according to branch merit function bm.
Definition: var.hpp:110
void extensional(Home home, const IntVarArgs &x, DFA dfa, IntPropLevel)
Post domain consistent propagator for extensional constraint described by a DFA.
Definition: extensional.cpp:47
Select random value.
Definition: int.hh:4803
Recording AFC information for integer variables.
Definition: int.hh:4073
BoolVarBranch BOOL_VAR_CHB_MAX(BoolCHB c, BranchTbl tbl)
Select variable with largest CHB Q-score.
Definition: var.hpp:448
IntValBranch INT_VAL_MIN(void)
Select smallest value.
Definition: val.hpp:59
Specification of a DFA transition.
Definition: int.hh:2036
void sqrt(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition: arithmetic.cpp:106
Use basic propagation algorithm.
Definition: int.hh:960
std::function< double(const Space &home, double w, double b)> BranchTbl
Tie-break limit function.
Definition: var.hpp:52
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:43
Class for CHB management.
Definition: chb.hpp:50
With largest max.
Definition: int.hh:4386
unsigned int size(I &i)
Size of all ranges of range iterator i.
Reification specification.
Definition: int.hh:855
Value propagation.
Definition: int.hh:956
SymmetryHandle ValueSymmetry(const IntArgs &vs)
Values in v are interchangeable.
Definition: ldsb.cpp:85
IntValBranch INT_VAL_SPLIT_MAX(void)
Select values greater than mean of smallest and largest value.
Definition: val.hpp:84
void range(Home home, const IntVarArgs &x, SetVar y, SetVar z)
Post constraint .
Definition: minimodel.hh:2030
Range iterator for ranges of integer variable implementation.
Definition: var-imp.hpp:396
IntVarBranch INT_VAR_RND(Rnd r)
Select random variable (uniform distribution, for tie breaking)
Definition: var.hpp:105
void distinct(Home home, const IntVarArgs &x, IntPropLevel ipl)
Post propagator for for all .
Definition: distinct.cpp:50
With largest domain size.
Definition: int.hh:4388
Duplicate of an integer view.
int max
Maximum value.
Definition: int.hh:2159
Recording AFC information for Boolean variables.
Definition: int.hh:4113
bool overflow_add(int n, int m)
Check whether adding n and m would overflow.
Definition: limits.hpp:83
void argmax(Home home, const IntVarArgs &x, IntVar y, bool tiebreak, IntPropLevel)
Post propagator for .
Definition: arithmetic.cpp:114
Recording actions for Boolean variables.
Definition: int.hh:4204
Trace filters.
Definition: filter.hpp:137
BoolAssign BOOL_ASSIGN_RND(Rnd r)
Select random value.
Definition: assign.hpp:114
Integer set initialization.
Definition: int-set-1.hpp:57
BoolAssign BOOL_ASSIGN(BoolBranchVal v, BoolBranchCommit c)
Select value as defined by the value function v and commit function c.
Definition: assign.hpp:119
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:99
Which Boolean variable to select for branching.
Definition: int.hh:4453
Select smallest value.
Definition: int.hh:4801
union Gecode::@585::NNF::@62 u
Union depending on nodetype t.
Less ( )
Definition: int.hh:908
Integer sets.
Definition: int.hh:174
int o_state
output state Default constructor
Definition: int.hh:2040
Post propagator for SetVar SetOpType SetVar SetRelType SetVar z
Definition: set.hh:769
IntVarBranch INT_VAR_AFC_MAX(double d, BranchTbl tbl)
Select variable with largest accumulated failure count with decay factor d.
Definition: var.hpp:140
std::function< bool(const Space &home, IntVar x, int i)> IntBranchFilter
Branch filter function type for integer variables.
Definition: int.hh:3973
Use advanced propagation algorithm.
Definition: int.hh:961
std::ostream & os
Output stream to use.
Definition: int.hh:5320
BitSetData * s
Begin of supports.
Definition: int.hh:2161
With largest CHB Q-score divided by domain size.
Definition: int.hh:4396
static StdIntTracer def
Default tracer (printing to std::cerr)
Definition: int.hh:5298
Recording CHB for integer variables.
Definition: int.hh:4255
Reify eqv(BoolVar x)
Use equivalence for reification.
Definition: reify.hpp:73
Disjunction.
Definition: int.hh:931
With largest degree divided by domain size.
Definition: int.hh:4390
IntVarArgs(const IntVarArgs &a)
Initialize from variable argument array a (copy elements)
Definition: int.hh:646
Passing integer variables.
Definition: int.hh:637
SharedArray< int > IntSharedArray
Arrays of integers that can be shared among several element constraints.
Definition: int.hh:1455
ViewTracer< Int::BoolView > BoolTracer
Tracer for Boolean variables.
Definition: int.hh:5306
Passing integer arguments.
Definition: int.hh:608
BoolVarArgs(InputIterator first, InputIterator last)
Initialize from InputIterator first and last.
Definition: int.hh:708
Passing Boolean variables.
Definition: int.hh:691
Select values greater than mean of smallest and largest value.
Definition: int.hh:4660
With highest action.
Definition: int.hh:4380
With smallest CHB Q-score divided by domain size.
Definition: int.hh:4395
With largest degree.
Definition: int.hh:4376
std::function< int(const Space &home, BoolVar x, int i)> BoolBranchVal
Branch value function type for Boolean variables.
Definition: int.hh:4031
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:55
Boolean variable array.
Definition: int.hh:787
Boolean integer variables.
Definition: int.hh:492
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:4349
Post propagator for SetVar SetOpType SetVar SetRelType r
Definition: set.hh:769
const int v[7]
Definition: distinct.cpp:263
Propagator for recording view trace information.
Definition: recorder.hpp:63
Class represeting a set of tuples.
Definition: int.hh:2144
IntVarBranch INT_VAR_DEGREE_MIN(BranchTbl tbl)
Select variable with smallest degree.
Definition: var.hpp:120
TieBreak< VarBranch > tiebreak(VarBranch a, VarBranch b)
Combine variable selection criteria a and b for tie-breaking.
Definition: tiebreak.hpp:84
With smallest degree divided by domain size.
Definition: int.hh:4389
With smallest max.
Definition: int.hh:4385
IntValBranch INT_VAL_MAX(void)
Select largest value.
Definition: val.hpp:69
IntVarBranch INT_VAR_CHB_MIN(IntCHB c, BranchTbl tbl)
Select variable with lowest CHB Q-score.
Definition: var.hpp:170
IntPropLevel
Propagation levels for integer propagators.
Definition: int.hh:953
IntPropLevel ba(IntPropLevel ipl)
Extract basic or advanced from propagation level.
Definition: ipl.hpp:47
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:210
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:120
Select the largest range of the variable domain if it has several ranges, otherwise select values gre...
Definition: int.hh:4662
Post propagator for SetVar SetOpType SetVar y
Definition: set.hh:769
BoolVarArgs(int n)
Allocate array with n elements.
Definition: int.hh:698
Value branching information.
Definition: val.hpp:45
Trace done events.
Definition: recorder.hpp:51
BoolVarBranch BOOL_VAR_AFC_MAX(double d, BranchTbl tbl)
Select variable with largest accumulated failure count with decay factor d.
Definition: var.hpp:408
void div(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition: arithmetic.cpp:131
void relax(Home home, const FloatVarArgs &x, const FloatVarArgs &sx, Rnd r, double p)
Definition: relax.cpp:61
IntValBranch INT_VALUES_MIN(void)
Try all values starting from smallest.
Definition: val.hpp:104
Variable branching information.
Definition: var.hpp:59
std::function< bool(const Space &home, BoolVar x, int i)> BoolBranchFilter
Branch filter function type for Boolean variables.
Definition: int.hh:3983
bool overflow_sub(int n, int m)
Check whether subtracting m from n would overflow.
Definition: limits.hpp:97
Select values not greater than mean of smallest and largest value.
Definition: int.hh:4659
BoolVarBranch BOOL_VAR_DEGREE_MAX(BranchTbl tbl)
Select variable with largest degree.
Definition: var.hpp:393
Generic domain change information to be supplied to advisors.
Definition: core.hpp:205
struct Gecode::@585::NNF::@62::@64 a
For atomic nodes.
With highest CHB Q-score.
Definition: int.hh:4382
IntVarBranch INT_VAR_MIN_MAX(BranchTbl tbl)
Select variable with largest min.
Definition: var.hpp:195
IntValBranch INT_VALUES_MAX(void)
Try all values starting from largest.
Definition: val.hpp:109
Select
Which value selection.
Definition: int.hh:4689
void precede(Home home, const IntVarArgs &x, int s, int t, IntPropLevel)
Post propagator that s precedes t in x.
Definition: precede.cpp:47
Integer variables.
Definition: int.hh:351
With lowest CHB Q-score.
Definition: int.hh:4381
IntVarBranch INT_VAR_ACTION_MIN(double d, BranchTbl tbl)
Select variable with lowest action with decay factor d.
Definition: var.hpp:150
Select random value.
Definition: int.hh:4658
BoolVarBranch BOOL_VAR_ACTION_MAX(double d, BranchTbl tbl)
Select variable with highest action with decay factor d.
Definition: var.hpp:428
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:230
Which values to select for assignment.
Definition: int.hh:4768
int n_tuples
Number of Tuples.
Definition: int.hh:2192
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
Definition: rel.cpp:47
Trace delta information for integer variables.
Definition: int.hh:5206
SymmetryHandle values_reflect(int lower, int upper)
The values from lower to upper (inclusive) can be reflected.
Definition: ldsb.cpp:110
IntVarBranch INT_VAR_REGRET_MAX_MIN(BranchTbl tbl)
Select variable with smallest max-regret.
Definition: var.hpp:300
Sort ranges according to increasing minimum.
Definition: int-set.cpp:75
Domain propagation Options: basic versus advanced propagation.
Definition: int.hh:958
Date item for bitsets.
Definition: bitset-base.hpp:69
Select
Which variable selection.
Definition: int.hh:4370
bool valid(int n)
Return whether n is in range.
Definition: limits.hpp:41
Value iterator for integer sets.
Definition: int.hh:313
Equivalence.
Definition: int.hh:933
IntValBranch INT_VAL_MED(void)
Select greatest value not greater than the median.
Definition: val.hpp:64
With smallest action divided by domain size.
Definition: int.hh:4393
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:250
Data stored for a DFA.
Definition: dfa.hpp:46
IntVarBranch INT_VAR_MAX_MIN(BranchTbl tbl)
Select variable with smallest max.
Definition: var.hpp:200
Iterator for DFA transitions (sorted by symbols)
Definition: int.hh:2047
Int::LDSB::SymmetryObject * ref
Symmetry object that this handle refers to.
Definition: int.hh:4988
PrimArgArray< TaskType > TaskTypeArgs
Argument arrays for passing task type arguments.
Definition: int.hh:993
IntVarBranch INT_VAR_REGRET_MAX_MAX(BranchTbl tbl)
Select variable with largest max-regret.
Definition: var.hpp:305
Random (uniform, for tie breaking)
Definition: int.hh:4372
Select
Which variable selection.
Definition: int.hh:4456
With largest degree.
Definition: int.hh:4462
Trace fail events.
Definition: recorder.hpp:50
With smallest domain size.
Definition: int.hh:4387
Post propagator for SetVar x
Definition: set.hh:769
Trace fixpoint events.
Definition: recorder.hpp:49
std::ostream & os
Output stream to use.
Definition: int.hh:5282
Select
Which value selection.
Definition: int.hh:4654
BoolVarBranch BOOL_VAR_RND(Rnd r)
Select random variable (uniform distribution, for tie breaking)
Definition: var.hpp:373
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:4356
IntVarBranch INT_VAR_CHB_MAX(IntCHB c, BranchTbl tbl)
Select variable with largest CHB Q-score.
Definition: var.hpp:180
Recording CHB for Boolean variables.
Definition: int.hh:4299
Select greatest value not greater than the median.
Definition: int.hh:4773
static StdBoolTracer def
Default tracer (printing to std::cerr)
Definition: int.hh:5336
void trace(Home home, const FloatVarArgs &x, TraceFilter tf, int te, FloatTracer &t)
Create a tracer for float variables.
Definition: trace.cpp:43
ViewTraceRecorder< Int::BoolView > BoolTraceRecorder
Trace recorder for Boolean variables.
Definition: int.hh:5311
SymmetryHandle VariableSequenceSymmetry(const IntVarArgs &vars, int ss)
Variable sequences in x of size ss are interchangeable.
Definition: ldsb.cpp:94
const long long int llmax
Largest allowed long long integer value.
Definition: int.hh:122
With highest merit.
Definition: int.hh:4374
bool operator==(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:298
Traits of arrays in Gecode.
Definition: array.hpp:68
Gecode::Support::BitSetData BitSetData
Import bit set data type.
Definition: int.hh:2152
IntValBranch INT_VAL_SPLIT_MIN(void)
Select values not greater than mean of smallest and largest value.
Definition: val.hpp:79
With largest min.
Definition: int.hh:4384
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:149
Gecode toplevel namespace
Argument array for variables.
Definition: array.hpp:53
const Range * l
Last range.
Definition: int.hh:2320
With highest merit.
Definition: int.hh:4460
Implication for reification.
Definition: int.hh:841
Class for action management.
Definition: action.hpp:46
BoolVarBranch BOOL_VAR_CHB_MIN(BoolCHB c, BranchTbl tbl)
Select variable with lowest CHB Q-score.
Definition: var.hpp:438
#define GECODE_VTABLE_EXPORT
Definition: support.hh:76
Range iterator for computing set difference.
Definition: ranges-diff.hpp:47
Disequality ( )
Definition: int.hh:906
BoolVar x
The Boolean control variable.
Definition: int.hh:858
int min
Minimum value.
Definition: int.hh:2157
BoolVarBranch BOOL_VAR_MERIT_MAX(BoolBranchMerit bm, BranchTbl tbl)
Select variable with highest merit according to branch merit function bm.
Definition: var.hpp:383
Random number generator.
Definition: rnd.hpp:46
Select largest value.
Definition: int.hh:4657
IntVarBranch INT_VAR_DEGREE_SIZE_MIN(BranchTbl tbl)
Select variable with smallest degree divided by domain size.
Definition: var.hpp:220
Data about values in the table.
Definition: int.hh:2169
unsigned int n
Number of ranges.
Definition: int.hh:2172
#define GECODE_INT_EXPORT
Definition: int.hh:81
const long long int llinfinity
Infinity for long long integers.
Definition: int.hh:126
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:357
void assign(Home home, const FloatVarArgs &x, FloatAssign fa, FloatBranchFilter bf, FloatVarValPrint vvp)
Assign all x with value selection vals.
Definition: branch.cpp:115
void check(int n, const char *l)
Check whether n is in range, otherwise throw out of limits with information l.
Definition: limits.hpp:50
Home class for posting propagators
Definition: core.hpp:846
double tbl(const Gecode::Space &, double w, double b)
Test function for tie-break limit function.
Definition: branch.cpp:65
Data stored for a Table.
Definition: int.hh:2182
std::function< double(const Space &home, IntVar x, int i)> IntBranchMerit
Branch merit function type for integer variables.
Definition: int.hh:3995
ReifyMode
Mode for reification.
Definition: int.hh:827
Select value according to user-defined functions.
Definition: int.hh:4663
int max
Largest value.
Definition: int.hh:2198
ReifyMode rm
The reification mode.
Definition: int.hh:860
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:61
Trace delta information for Boolean variables.
Definition: int.hh:5226
void unary(Home home, const IntVarArgs &s, const IntArgs &p, IntPropLevel ipl)
Post propagators for scheduling tasks on unary resources.
Definition: unary.cpp:48
void ite(Home home, BoolVar b, FloatVar x, FloatVar y, FloatVar z)
Post propagator for if-then-else constraint.
Definition: bool.cpp:43
Recording actions for integer variables.
Definition: int.hh:4159
Select largest value.
Definition: int.hh:4691
Range information.
Definition: int.hh:2154
Select largest value.
Definition: int.hh:4774
int delta
Delta information.
Definition: int.hh:5229
void element(Home home, IntSharedArray c, IntVar x0, IntVar x1, IntPropLevel)
Post domain consistent propagator for .
Definition: element.cpp:43
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:74
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:4060
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:260
Select all values starting from smallest.
Definition: int.hh:4664
With smallest accumulated failure count divided by domain size.
Definition: int.hh:4391
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:910
Equivalence for reification (default)
Definition: int.hh:834
IntRelType swap(IntRelType irt)
Return swapped relation type of irt.
Definition: irt.hpp:41
Reify pmi(BoolVar x)
Use reverse implication for reification.
Definition: reify.hpp:81
Boolean view for Boolean variables.
Definition: view.hpp:1329
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.