Generated on Fri Jan 28 2022 04:43:06 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  * Samuel Gagnon <samuel.gagnon92@gmail.com>
12  *
13  * Copyright:
14  * Stefano Gualandi, 2013
15  * Mikael Lagerkvist, 2006
16  * David Rijsman, 2009
17  * Christian Schulte, 2002
18  * Guido Tack, 2004
19  * Samuel Gagnon, 2018
20  *
21  * This file is part of Gecode, the generic constraint
22  * development environment:
23  * http://www.gecode.org
24  *
25  * Permission is hereby granted, free of charge, to any person obtaining
26  * a copy of this software and associated documentation files (the
27  * "Software"), to deal in the Software without restriction, including
28  * without limitation the rights to use, copy, modify, merge, publish,
29  * distribute, sublicense, and/or sell copies of the Software, and to
30  * permit persons to whom the Software is furnished to do so, subject to
31  * the following conditions:
32  *
33  * The above copyright notice and this permission notice shall be
34  * included in all copies or substantial portions of the Software.
35  *
36  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
37  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
38  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
39  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
40  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
41  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
42  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
43  *
44  */
45 
46 #ifndef __GECODE_INT_HH__
47 #define __GECODE_INT_HH__
48 
49 #include <climits>
50 #include <cfloat>
51 
52 #include <iostream>
53 #include <vector>
54 #include <unordered_map>
55 #include <functional>
56 #include <utility>
57 #include <initializer_list>
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 bool equal(const IntSetObject& so) const;
198  GECODE_INT_EXPORT virtual ~IntSetObject(void);
199  };
201  class MinInc;
203  GECODE_INT_EXPORT void normalize(Range* r, int n);
205  GECODE_INT_EXPORT void init(int n, int m);
207  GECODE_INT_EXPORT void init(const int r[], int n);
209  GECODE_INT_EXPORT void init(const int r[][2], int n);
210  public:
212 
213  IntSet(void);
219  IntSet(int n, int m);
221  IntSet(const int r[], int n);
227  IntSet(const int r[][2], int n);
229  template<class I>
230  explicit IntSet(I& i);
232  template<class I>
233  explicit IntSet(const I& i);
236  IntSet(std::initializer_list<int> r);
243  IntSet(std::initializer_list<std::pair<int,int>> r);
245 
247 
248  int ranges(void) const;
251  int min(int i) const;
253  int max(int i) const;
255  unsigned int width(int i) const;
257 
259 
260  bool in(int n) const;
263  unsigned int size(void) const;
265  unsigned int width(void) const;
267  int min(void) const;
269  int max(void) const;
271 
273 
274  bool operator ==(const IntSet& s) const;
277  bool operator !=(const IntSet& s) const;
279 
281 
282  GECODE_INT_EXPORT static const IntSet empty;
285  };
286 
292  class IntSetRanges {
293  private:
295  const IntSet::Range* i;
297  const IntSet::Range* e;
298  public:
300 
301  IntSetRanges(void);
304  IntSetRanges(const IntSet& s);
306  void init(const IntSet& s);
308 
310 
311  bool operator ()(void) const;
314  void operator ++(void);
316 
318 
319  int min(void) const;
322  int max(void) const;
324  unsigned int width(void) const;
326  };
327 
333  class IntSetValues : public Iter::Ranges::ToValues<IntSetRanges> {
334  public:
336 
337  IntSetValues(void);
340  IntSetValues(const IntSet& s);
342  void init(const IntSet& s);
344  };
345 
350  template<class Char, class Traits>
351  std::basic_ostream<Char,Traits>&
352  operator <<(std::basic_ostream<Char,Traits>& os, const IntSet& s);
353 
354 }
355 
356 #include <gecode/int/int-set-1.hpp>
357 
358 #include <gecode/int/var-imp.hpp>
359 
360 namespace Gecode {
361 
362  namespace Int {
363  class IntView;
364  }
365 
371  class IntVar : public VarImpVar<Int::IntVarImp> {
372  friend class IntVarArray;
373  friend class IntVarArgs;
374  private:
382  void _init(Space& home, int min, int max);
389  void _init(Space& home, const IntSet& d);
390  public:
392 
393  IntVar(void);
396  IntVar(const IntVar& y);
398  IntVar(const Int::IntView& y);
410  GECODE_INT_EXPORT IntVar(Space& home, int min, int max);
422  GECODE_INT_EXPORT IntVar(Space& home, const IntSet& d);
424 
426 
427  int min(void) const;
430  int max(void) const;
432  int med(void) const;
440  int val(void) const;
441 
443  unsigned int size(void) const;
445  unsigned int width(void) const;
447  unsigned int regret_min(void) const;
449  unsigned int regret_max(void) const;
451 
453 
454  bool range(void) const;
457  bool in(int n) const;
459  };
460 
465  template<class Char, class Traits>
466  std::basic_ostream<Char,Traits>&
467  operator <<(std::basic_ostream<Char,Traits>& os, const IntVar& x);
468 
474  public:
476 
477  IntVarRanges(void);
480  IntVarRanges(const IntVar& x);
482  void init(const IntVar& x);
484  };
485 
490  class IntVarValues : public Iter::Ranges::ToValues<IntVarRanges> {
491  public:
493 
494  IntVarValues(void);
497  IntVarValues(const IntVar& x);
499  void init(const IntVar& x);
501  };
502 
503  namespace Int {
504  class BoolView;
505  }
506 
512  class BoolVar : public VarImpVar<Int::BoolVarImp> {
513  friend class BoolVarArray;
514  friend class BoolVarArgs;
515  private:
523  void _init(Space& home, int min, int max);
524  public:
526 
527  BoolVar(void);
530  BoolVar(const BoolVar& y);
532  BoolVar(const Int::BoolView& y);
544  GECODE_INT_EXPORT BoolVar(Space& home, int min, int max);
546 
548 
549  int min(void) const;
552  int max(void) const;
554  int med(void) const;
562  int val(void) const;
563 
565  unsigned int size(void) const;
567  unsigned int width(void) const;
569  unsigned int regret_min(void) const;
571  unsigned int regret_max(void) const;
573 
575 
576  bool range(void) const;
579  bool in(int n) const;
581 
583 
584  bool zero(void) const;
587  bool one(void) const;
589  bool none(void) const;
591  };
592 
597  template<class Char, class Traits>
598  std::basic_ostream<Char,Traits>&
599  operator <<(std::basic_ostream<Char,Traits>& os, const BoolVar& x);
600 
601 }
602 
603 
604 #include <gecode/int/view.hpp>
605 #include <gecode/int/propagator.hpp>
606 
607 namespace Gecode {
608 
620 
621 }
622 
624 
625 namespace Gecode {
626 
628  class IntArgs : public ArgArray<int> {
629  public:
631 
632  IntArgs(void);
635  explicit IntArgs(int n);
637  IntArgs(const SharedArray<int>& x);
639  IntArgs(const std::vector<int>& x);
641  IntArgs(std::initializer_list<int> x);
643  template<class InputIterator>
644  IntArgs(InputIterator first, InputIterator last);
646  IntArgs(int n, const int* e);
648  IntArgs(const ArgArray<int>& a);
649 
651  static IntArgs create(int n, int start, int inc=1);
653  };
654 
656  class IntVarArgs : public VarArgArray<IntVar> {
657  public:
659 
660  IntVarArgs(void);
663  explicit IntVarArgs(int n);
665  IntVarArgs(const IntVarArgs& a);
667  IntVarArgs(const VarArray<IntVar>& a);
669  IntVarArgs(const std::vector<IntVar>& a);
671  IntVarArgs(std::initializer_list<IntVar> a);
673  template<class InputIterator>
674  IntVarArgs(InputIterator first, InputIterator last);
687  IntVarArgs(Space& home, int n, int min, int max);
700  IntVarArgs(Space& home, int n, const IntSet& s);
702  };
703 
712  class BoolVarArgs : public VarArgArray<BoolVar> {
713  public:
715 
716  BoolVarArgs(void);
719  explicit BoolVarArgs(int n);
721  BoolVarArgs(const BoolVarArgs& a);
723  BoolVarArgs(const VarArray<BoolVar>& a);
725  BoolVarArgs(const std::vector<BoolVar>& a);
727  BoolVarArgs(std::initializer_list<BoolVar> a);
729  template<class InputIterator>
730  BoolVarArgs(InputIterator first, InputIterator last);
743  BoolVarArgs(Space& home, int n, int min, int max);
745  };
747 
763  class IntVarArray : public VarArray<IntVar> {
764  public:
766 
767  IntVarArray(void);
770  IntVarArray(Space& home, int n);
772  IntVarArray(const IntVarArray& a);
774  IntVarArray(Space& home, const IntVarArgs& a);
787  IntVarArray(Space& home, int n, int min, int max);
800  IntVarArray(Space& home, int n, const IntSet& s);
802  };
803 
808  class BoolVarArray : public VarArray<BoolVar> {
809  public:
811 
812  BoolVarArray(void);
815  BoolVarArray(Space& home, int n);
817  BoolVarArray(const BoolVarArray& a);
819  BoolVarArray(Space& home, const BoolVarArgs& a);
832  BoolVarArray(Space& home, int n, int min, int max);
834  };
835 
836 }
837 
838 #include <gecode/int/int-set-2.hpp>
839 
840 #include <gecode/int/array.hpp>
841 
842 namespace Gecode {
843 
848  enum ReifyMode {
870  };
871 
876  class Reify {
877  protected:
882  public:
884  Reify(void);
886  Reify(BoolVar x, ReifyMode rm=RM_EQV);
888  BoolVar var(void) const;
890  ReifyMode mode(void) const;
892  void var(BoolVar x);
894  void mode(ReifyMode rm);
895  };
896 
901  Reify eqv(BoolVar x);
902 
907  Reify imp(BoolVar x);
908 
913  Reify pmi(BoolVar x);
914 
915 }
916 
917 #include <gecode/int/reify.hpp>
918 
919 namespace Gecode {
920 
925  enum IntRelType {
932  };
933 
936 
939 
940 }
941 
942 #include <gecode/int/irt.hpp>
943 
944 namespace Gecode {
945 
950  enum BoolOpType {
956  };
957 
976  IPL_DEF = 0,
977  IPL_VAL = 1,
978  IPL_BND = 2,
979  IPL_DOM = 3,
980  IPL_BASIC = 4,
984  };
985 
988 
991 
992 }
993 
994 #include <gecode/int/ipl.hpp>
995 
996 namespace Gecode {
997 
1003  enum TaskType {
1004  TT_FIXP, //< Task with fixed processing time
1005  TT_FIXS, //< Task with fixed start time
1006  TT_FIXE //< Task with fixed end time
1007  };
1008 
1015 
1017  template<>
1019  public:
1020  typedef TaskTypeArgs StorageType;
1022  typedef TaskTypeArgs ArgsType;
1023  };
1024 
1025 
1033  GECODE_INT_EXPORT void
1035  dom(Home home, IntVar x, int n,
1036  IntPropLevel ipl=IPL_DEF);
1038  GECODE_INT_EXPORT void
1039  dom(Home home, const IntVarArgs& x, int n,
1040  IntPropLevel ipl=IPL_DEF);
1041 
1043  GECODE_INT_EXPORT void
1044  dom(Home home, IntVar x, int l, int m,
1045  IntPropLevel ipl=IPL_DEF);
1047  GECODE_INT_EXPORT void
1048  dom(Home home, const IntVarArgs& x, int l, int m,
1049  IntPropLevel ipl=IPL_DEF);
1050 
1052  GECODE_INT_EXPORT void
1053  dom(Home home, IntVar x, const IntSet& s,
1054  IntPropLevel ipl=IPL_DEF);
1056  GECODE_INT_EXPORT void
1057  dom(Home home, const IntVarArgs& x, const IntSet& s,
1058  IntPropLevel ipl=IPL_DEF);
1059 
1061  GECODE_INT_EXPORT void
1062  dom(Home home, IntVar x, int n, Reify r,
1063  IntPropLevel ipl=IPL_DEF);
1065  GECODE_INT_EXPORT void
1066  dom(Home home, IntVar x, int l, int m, Reify r,
1067  IntPropLevel ipl=IPL_DEF);
1069  GECODE_INT_EXPORT void
1070  dom(Home home, IntVar x, const IntSet& s, Reify r,
1071  IntPropLevel ipl=IPL_DEF);
1072 
1074  GECODE_INT_EXPORT void
1075  dom(Home home, IntVar x, IntVar d,
1076  IntPropLevel ipl=IPL_DEF);
1078  GECODE_INT_EXPORT void
1079  dom(Home home, BoolVar x, BoolVar d,
1080  IntPropLevel ipl=IPL_DEF);
1082  GECODE_INT_EXPORT void
1083  dom(Home home, const IntVarArgs& x, const IntVarArgs& d,
1084  IntPropLevel ipl=IPL_DEF);
1086  GECODE_INT_EXPORT void
1087  dom(Home home, const BoolVarArgs& x, const BoolVarArgs& d,
1088  IntPropLevel ipl=IPL_DEF);
1090 
1091 
1102  GECODE_INT_EXPORT void
1103  rel(Home home, IntVar x0, IntRelType irt, IntVar x1,
1104  IntPropLevel ipl=IPL_DEF);
1111  GECODE_INT_EXPORT void
1112  rel(Home home, const IntVarArgs& x, IntRelType irt, IntVar y,
1113  IntPropLevel ipl=IPL_DEF);
1117  GECODE_INT_EXPORT void
1118  rel(Home home, IntVar x, IntRelType irt, int c,
1119  IntPropLevel ipl=IPL_DEF);
1123  GECODE_INT_EXPORT void
1124  rel(Home home, const IntVarArgs& x, IntRelType irt, int c,
1125  IntPropLevel ipl=IPL_DEF);
1132  GECODE_INT_EXPORT void
1133  rel(Home home, IntVar x0, IntRelType irt, IntVar x1, Reify r,
1134  IntPropLevel ipl=IPL_DEF);
1141  GECODE_INT_EXPORT void
1142  rel(Home home, IntVar x, IntRelType irt, int c, Reify r,
1143  IntPropLevel ipl=IPL_DEF);
1158  GECODE_INT_EXPORT void
1159  rel(Home home, const IntVarArgs& x, IntRelType irt,
1160  IntPropLevel ipl=IPL_DEF);
1175  GECODE_INT_EXPORT void
1176  rel(Home home, const IntVarArgs& x, IntRelType irt, const IntVarArgs& y,
1177  IntPropLevel ipl=IPL_DEF);
1191  GECODE_INT_EXPORT void
1192  rel(Home home, const IntVarArgs& x, IntRelType irt, const IntArgs& y,
1193  IntPropLevel ipl=IPL_DEF);
1207  GECODE_INT_EXPORT void
1208  rel(Home home, const IntArgs& x, IntRelType irt, const IntVarArgs& y,
1209  IntPropLevel ipl=IPL_DEF);
1210 
1218  GECODE_INT_EXPORT void
1219  rel(Home home, BoolVar x0, IntRelType irt, BoolVar x1,
1220  IntPropLevel ipl=IPL_DEF);
1224  GECODE_INT_EXPORT void
1225  rel(Home home, BoolVar x0, IntRelType irt, BoolVar x1, Reify r,
1226  IntPropLevel ipl=IPL_DEF);
1230  GECODE_INT_EXPORT void
1231  rel(Home home, const BoolVarArgs& x, IntRelType irt, BoolVar y,
1232  IntPropLevel ipl=IPL_DEF);
1240  GECODE_INT_EXPORT void
1241  rel(Home home, BoolVar x, IntRelType irt, int n,
1242  IntPropLevel ipl=IPL_DEF);
1250  GECODE_INT_EXPORT void
1251  rel(Home home, BoolVar x, IntRelType irt, int n, Reify r,
1252  IntPropLevel ipl=IPL_DEF);
1260  GECODE_INT_EXPORT void
1261  rel(Home home, const BoolVarArgs& x, IntRelType irt, int n,
1262  IntPropLevel ipl=IPL_DEF);
1275  GECODE_INT_EXPORT void
1276  rel(Home home, const BoolVarArgs& x, IntRelType irt, const BoolVarArgs& y,
1277  IntPropLevel ipl=IPL_DEF);
1290  GECODE_INT_EXPORT void
1291  rel(Home home, const BoolVarArgs& x, IntRelType irt, const IntArgs& y,
1292  IntPropLevel ipl=IPL_DEF);
1305  GECODE_INT_EXPORT void
1306  rel(Home home, const IntArgs& x, IntRelType irt, const BoolVarArgs& y,
1307  IntPropLevel ipl=IPL_DEF);
1318  GECODE_INT_EXPORT void
1319  rel(Home home, const BoolVarArgs& x, IntRelType irt,
1320  IntPropLevel ipl=IPL_DEF);
1326  GECODE_INT_EXPORT void
1327  rel(Home home, BoolVar x0, BoolOpType o, BoolVar x1, BoolVar x2,
1328  IntPropLevel ipl=IPL_DEF);
1337  GECODE_INT_EXPORT void
1338  rel(Home home, BoolVar x0, BoolOpType o, BoolVar x1, int n,
1339  IntPropLevel ipl=IPL_DEF);
1349  GECODE_INT_EXPORT void
1350  rel(Home home, BoolOpType o, const BoolVarArgs& x, BoolVar y,
1351  IntPropLevel ipl=IPL_DEF);
1364  GECODE_INT_EXPORT void
1365  rel(Home home, BoolOpType o, const BoolVarArgs& x, int n,
1366  IntPropLevel ipl=IPL_DEF);
1377  GECODE_INT_EXPORT void
1378  clause(Home home, BoolOpType o, const BoolVarArgs& x, const BoolVarArgs& y,
1379  BoolVar z, IntPropLevel ipl=IPL_DEF);
1393  GECODE_INT_EXPORT void
1394  clause(Home home, BoolOpType o, const BoolVarArgs& x, const BoolVarArgs& y,
1395  int n, IntPropLevel ipl=IPL_DEF);
1405  GECODE_INT_EXPORT void
1406  ite(Home home, BoolVar b, IntVar x, IntVar y, IntVar z,
1407  IntPropLevel ipl=IPL_DEF);
1414  GECODE_INT_EXPORT void
1415  ite(Home home, BoolVar b, BoolVar x, BoolVar y, BoolVar z,
1416  IntPropLevel ipl=IPL_DEF);
1417 
1418 
1430  GECODE_INT_EXPORT void
1431  precede(Home home, const IntVarArgs& x, int s, int t,
1440  GECODE_INT_EXPORT void
1441  precede(Home home, const IntVarArgs& x, const IntArgs& c,
1443 
1444 
1450  GECODE_INT_EXPORT void
1452  member(Home home, const IntVarArgs& x, IntVar y,
1453  IntPropLevel ipl=IPL_DEF);
1455  GECODE_INT_EXPORT void
1456  member(Home home, const BoolVarArgs& x, BoolVar y,
1457  IntPropLevel ipl=IPL_DEF);
1459  GECODE_INT_EXPORT void
1460  member(Home home, const IntVarArgs& x, IntVar y, Reify r,
1461  IntPropLevel ipl=IPL_DEF);
1463  GECODE_INT_EXPORT void
1464  member(Home home, const BoolVarArgs& x, BoolVar y, Reify r,
1465  IntPropLevel ipl=IPL_DEF);
1467 
1468 
1482  GECODE_INT_EXPORT void
1483  element(Home home, IntSharedArray n, IntVar x0, IntVar x1,
1484  IntPropLevel ipl=IPL_DEF);
1490  GECODE_INT_EXPORT void
1491  element(Home home, IntSharedArray n, IntVar x0, BoolVar x1,
1492  IntPropLevel ipl=IPL_DEF);
1498  GECODE_INT_EXPORT void
1499  element(Home home, IntSharedArray n, IntVar x0, int x1,
1500  IntPropLevel ipl=IPL_DEF);
1506  GECODE_INT_EXPORT void
1507  element(Home home, const IntVarArgs& x, IntVar y0, IntVar y1,
1508  IntPropLevel ipl=IPL_DEF);
1514  GECODE_INT_EXPORT void
1515  element(Home home, const IntVarArgs& x, IntVar y0, int y1,
1516  IntPropLevel ipl=IPL_DEF);
1518  GECODE_INT_EXPORT void
1519  element(Home home, const BoolVarArgs& x, IntVar y0, BoolVar y1,
1520  IntPropLevel ipl=IPL_DEF);
1522  GECODE_INT_EXPORT void
1523  element(Home home, const BoolVarArgs& x, IntVar y0, int y1,
1524  IntPropLevel ipl=IPL_DEF);
1525 
1538  GECODE_INT_EXPORT void
1539  element(Home home, IntSharedArray a,
1540  IntVar x, int w, IntVar y, int h, IntVar z,
1541  IntPropLevel ipl=IPL_DEF);
1554  GECODE_INT_EXPORT void
1555  element(Home home, IntSharedArray a,
1556  IntVar x, int w, IntVar y, int h, BoolVar z,
1557  IntPropLevel ipl=IPL_DEF);
1573  GECODE_INT_EXPORT void
1574  element(Home home, const IntVarArgs& a,
1575  IntVar x, int w, IntVar y, int h, IntVar z,
1576  IntPropLevel ipl=IPL_DEF);
1589  GECODE_INT_EXPORT void
1590  element(Home home, const BoolVarArgs& a,
1591  IntVar x, int w, IntVar y, int h, BoolVar z,
1592  IntPropLevel ipl=IPL_DEF);
1594 
1595 
1610  GECODE_INT_EXPORT void
1611  distinct(Home home, const IntVarArgs& x,
1612  IntPropLevel ipl=IPL_DEF);
1625  GECODE_INT_EXPORT void
1626  distinct(Home home, const IntArgs& n, const IntVarArgs& x,
1627  IntPropLevel ipl=IPL_DEF);
1642  GECODE_INT_EXPORT void
1643  distinct(Home home, const BoolVarArgs& b, const IntVarArgs& x,
1644  IntPropLevel ipl=IPL_DEF);
1657  GECODE_INT_EXPORT void
1658  distinct(Home home, const IntVarArgs& x, int c,
1659  IntPropLevel ipl=IPL_DEF);
1661 
1662 
1680  GECODE_INT_EXPORT void
1681  channel(Home home, const IntVarArgs& x, const IntVarArgs& y,
1682  IntPropLevel ipl=IPL_DEF);
1683 
1697  GECODE_INT_EXPORT void
1698  channel(Home home, const IntVarArgs& x, int xoff,
1699  const IntVarArgs& y, int yoff,
1700  IntPropLevel ipl=IPL_DEF);
1701 
1703  GECODE_INT_EXPORT void
1704  channel(Home home, BoolVar x0, IntVar x1,
1705  IntPropLevel ipl=IPL_DEF);
1707  void
1708  channel(Home home, IntVar x0, BoolVar x1,
1709  IntPropLevel ipl=IPL_DEF);
1715  GECODE_INT_EXPORT void
1716  channel(Home home, const BoolVarArgs& x, IntVar y, int o=0,
1717  IntPropLevel ipl=IPL_DEF);
1719 
1720 }
1721 
1722 #include <gecode/int/channel.hpp>
1723 
1724 namespace Gecode {
1725 
1742  GECODE_INT_EXPORT void
1743  sorted(Home home, const IntVarArgs& x, const IntVarArgs& y,
1744  IntPropLevel ipl=IPL_DEF);
1745 
1757  GECODE_INT_EXPORT void
1758  sorted(Home home, const IntVarArgs& x, const IntVarArgs& y,
1759  const IntVarArgs& z,
1760  IntPropLevel ipl=IPL_DEF);
1762 
1763 
1782  GECODE_INT_EXPORT void
1783  count(Home home, const IntVarArgs& x, int n, IntRelType irt, int m,
1784  IntPropLevel ipl=IPL_DEF);
1789  GECODE_INT_EXPORT void
1790  count(Home home, const IntVarArgs& x, const IntSet& y, IntRelType irt, int m,
1791  IntPropLevel ipl=IPL_DEF);
1799  GECODE_INT_EXPORT void
1800  count(Home home, const IntVarArgs& x, IntVar y, IntRelType irt, int m,
1801  IntPropLevel ipl=IPL_DEF);
1809  GECODE_INT_EXPORT void
1810  count(Home home, const IntVarArgs& x, const IntArgs& y, IntRelType irt, int m,
1811  IntPropLevel ipl=IPL_DEF);
1816  GECODE_INT_EXPORT void
1817  count(Home home, const IntVarArgs& x, int n, IntRelType irt, IntVar z,
1818  IntPropLevel ipl=IPL_DEF);
1823  GECODE_INT_EXPORT void
1824  count(Home home, const IntVarArgs& x, const IntSet& y, IntRelType irt, IntVar z,
1825  IntPropLevel ipl=IPL_DEF);
1833  GECODE_INT_EXPORT void
1834  count(Home home, const IntVarArgs& x, IntVar y, IntRelType irt, IntVar z,
1835  IntPropLevel ipl=IPL_DEF);
1843  GECODE_INT_EXPORT void
1844  count(Home home, const IntVarArgs& x, const IntArgs& y, IntRelType irt, IntVar z,
1845  IntPropLevel ipl=IPL_DEF);
1846 
1860  GECODE_INT_EXPORT void
1861  count(Home home, const IntVarArgs& x, const IntVarArgs& c,
1862  IntPropLevel ipl=IPL_DEF);
1863 
1877  GECODE_INT_EXPORT void
1878  count(Home home, const IntVarArgs& x, const IntSetArgs& c,
1879  IntPropLevel ipl=IPL_DEF);
1880 
1897  GECODE_INT_EXPORT void
1898  count(Home home, const IntVarArgs& x,
1899  const IntVarArgs& c, const IntArgs& v,
1900  IntPropLevel ipl=IPL_DEF);
1901 
1918  GECODE_INT_EXPORT void
1919  count(Home home, const IntVarArgs& x,
1920  const IntSetArgs& c, const IntArgs& v,
1921  IntPropLevel ipl=IPL_DEF);
1922 
1939  GECODE_INT_EXPORT void
1940  count(Home home, const IntVarArgs& x,
1941  const IntSet& c, const IntArgs& v,
1942  IntPropLevel ipl=IPL_DEF);
1943 
1945 
1960  GECODE_INT_EXPORT void
1961  nvalues(Home home, const IntVarArgs& x, IntRelType irt, int y,
1962  IntPropLevel ipl=IPL_DEF);
1966  GECODE_INT_EXPORT void
1967  nvalues(Home home, const IntVarArgs& x, IntRelType irt, IntVar y,
1968  IntPropLevel ipl=IPL_DEF);
1972  GECODE_INT_EXPORT void
1973  nvalues(Home home, const BoolVarArgs& x, IntRelType irt, int y,
1974  IntPropLevel ipl=IPL_DEF);
1978  GECODE_INT_EXPORT void
1979  nvalues(Home home, const BoolVarArgs& x, IntRelType irt, IntVar y,
1980  IntPropLevel ipl=IPL_DEF);
1982 
2003  GECODE_INT_EXPORT void
2004  sequence(Home home, const IntVarArgs& x, const IntSet& s,
2005  int q, int l, int u, IntPropLevel ipl=IPL_DEF);
2006 
2021  GECODE_INT_EXPORT void
2022  sequence(Home home, const BoolVarArgs& x, const IntSet& s,
2023  int q, int l, int u, IntPropLevel ipl=IPL_DEF);
2024 
2026 
2048  class DFA : public SharedHandle {
2049  private:
2051  class DFAI;
2054  bool equal(const DFA& d) const;
2055  public:
2057  class Transition {
2058  public:
2059  int i_state;
2060  int symbol;
2061  int o_state;
2062  Transition(void);
2065  Transition(int i_state0, int symbol0, int o_state0);
2066  };
2068  class Transitions {
2069  private:
2071  const Transition* c_trans;
2073  const Transition* e_trans;
2074  public:
2076  Transitions(const DFA& d);
2078  Transitions(const DFA& d, int n);
2080  bool operator ()(void) const;
2082  void operator ++(void);
2084  int i_state(void) const;
2086  int symbol(void) const;
2088  int o_state(void) const;
2089  };
2091  class Symbols {
2092  private:
2094  const Transition* c_trans;
2096  const Transition* e_trans;
2097  public:
2099  Symbols(const DFA& d);
2101  bool operator ()(void) const;
2103  void operator ++(void);
2105  int val(void) const;
2106  };
2119  void init(int s, Transition t[], int f[], bool minimize=true);
2120  public:
2121  friend class Transitions;
2123  DFA(void);
2136  DFA(int s, Transition t[], int f[], bool minimize=true);
2147  DFA(int s, std::initializer_list<Transition> t,
2148  std::initializer_list<int> f, bool minimize=true);
2150  DFA(const DFA& d);
2153  bool operator ==(const DFA& d) const;
2155  bool operator !=(const DFA& d) const;
2157  int n_states(void) const;
2159  int n_transitions(void) const;
2161  unsigned int n_symbols(void) const;
2163  unsigned int max_degree(void) const;
2165  int final_fst(void) const;
2167  int final_lst(void) const;
2169  int symbol_min(void) const;
2171  int symbol_max(void) const;
2173  std::size_t hash(void) const;
2174  };
2175 
2176 }
2177 
2179 
2180 namespace Gecode {
2181 
2190  class TupleSet : public SharedHandle {
2191  public:
2196  typedef int* Tuple;
2200  class Range {
2201  public:
2203  int min;
2205  int max;
2207  BitSetData* s;
2209  unsigned int width(void) const;
2211  const BitSetData* supports(unsigned int n_words, int n) const;
2212  };
2213  protected:
2215  class ValueData {
2216  public:
2218  unsigned int n;
2222  unsigned int start(int n) const;
2223  };
2229  protected:
2231  static const int n_initial_free = 1024;
2232  public:
2234  int arity;
2236  unsigned int n_words;
2240  int n_free;
2242  int min;
2244  int max;
2246  std::size_t key;
2248  int* td;
2254  BitSetData* support;
2255 
2257  Tuple add(void);
2259  Tuple get(int i) const;
2261  static void set(BitSetData* d, unsigned int n);
2263  static bool get(const BitSetData* d, unsigned int n);
2265  unsigned int tuple2idx(Tuple t) const;
2267  const Range* fst(int i) const;
2269  const Range* lst(int i) const;
2272  void finalize(void);
2275  void resize(void);
2277  bool finalized(void) const;
2279  Data(int a);
2282  virtual ~Data(void);
2283  };
2284 
2286  Data& data(void) const;
2288  Data& raw(void) const;
2291  void _add(const IntArgs& t);
2294  bool equal(const TupleSet& t) const;
2295  public:
2297 
2298  TupleSet(void);
2302  TupleSet(int a);
2305  void init(int a);
2308  TupleSet(const TupleSet& t);
2311  TupleSet& operator =(const TupleSet& t);
2314  TupleSet(int a, const DFA& dfa);
2316  operator bool(void) const;
2318  bool operator ==(const TupleSet& t) const;
2320  bool operator !=(const TupleSet& t) const;
2322 
2324 
2325  TupleSet& add(const IntArgs& t);
2328  bool finalized(void) const;
2330  void finalize(void);
2332 
2334 
2335  int arity(void) const;
2338  int tuples(void) const;
2340  unsigned int words(void) const;
2342  Tuple operator [](int i) const;
2344  int min(void) const;
2346  int max(void) const;
2348  std::size_t hash(void) const;
2350 
2352 
2353  const Range* fst(int i) const;
2356  const Range* lst(int i) const;
2358  class Ranges {
2359  protected:
2361  const Range* c;
2363  const Range* l;
2364  public:
2366 
2367  Ranges(const TupleSet& ts, int i);
2370 
2372 
2373  bool operator ()(void) const;
2376  void operator ++(void);
2378 
2380 
2381  int min(void) const;
2384  int max(void) const;
2386  unsigned int width(void) const;
2388  };
2390  };
2391 
2392 }
2393 
2395 
2396 namespace Gecode {
2397 
2410  GECODE_INT_EXPORT void
2411  extensional(Home home, const IntVarArgs& x, DFA d,
2412  IntPropLevel ipl=IPL_DEF);
2413 
2426  GECODE_INT_EXPORT void
2427  extensional(Home home, const BoolVarArgs& x, DFA d,
2428  IntPropLevel ipl=IPL_DEF);
2429 
2440  void
2441  extensional(Home home, const IntVarArgs& x, const TupleSet& t,
2442  IntPropLevel ipl=IPL_DEF);
2443 
2456  GECODE_INT_EXPORT void
2457  extensional(Home home, const IntVarArgs& x, const TupleSet& t, bool pos,
2458  IntPropLevel ipl=IPL_DEF);
2459 
2470  void
2471  extensional(Home home, const IntVarArgs& x, const TupleSet& t, Reify r,
2472  IntPropLevel ipl=IPL_DEF);
2473 
2486  GECODE_INT_EXPORT void
2487  extensional(Home home, const IntVarArgs& x, const TupleSet& t, bool pos,
2488  Reify r,
2489  IntPropLevel ipl=IPL_DEF);
2490 
2501  void
2502  extensional(Home home, const BoolVarArgs& x, const TupleSet& t,
2503  IntPropLevel ipl=IPL_DEF);
2504 
2517  GECODE_INT_EXPORT void
2518  extensional(Home home, const BoolVarArgs& x, const TupleSet& t, bool pos,
2519  IntPropLevel ipl=IPL_DEF);
2520 
2531  void
2532  extensional(Home home, const BoolVarArgs& x, const TupleSet& t, Reify r,
2533  IntPropLevel ipl=IPL_DEF);
2534 
2547  GECODE_INT_EXPORT void
2548  extensional(Home home, const BoolVarArgs& x, const TupleSet& t, bool pos,
2549  Reify r,
2550  IntPropLevel ipl=IPL_DEF);
2551 
2552 }
2553 
2554 #include <gecode/int/extensional.hpp>
2555 
2556 namespace Gecode {
2557 
2569  GECODE_INT_EXPORT void
2570  min(Home home, IntVar x0, IntVar x1, IntVar x2,
2571  IntPropLevel ipl=IPL_DEF);
2579  GECODE_INT_EXPORT void
2580  min(Home home, const IntVarArgs& x, IntVar y,
2581  IntPropLevel ipl=IPL_DEF);
2587  GECODE_INT_EXPORT void
2588  max(Home home, IntVar x0, IntVar x1, IntVar x2,
2589  IntPropLevel ipl=IPL_DEF);
2597  GECODE_INT_EXPORT void
2598  max(Home home, const IntVarArgs& x, IntVar y,
2599  IntPropLevel ipl=IPL_DEF);
2600 
2610  GECODE_INT_EXPORT void
2611  argmin(Home home, const IntVarArgs& x, IntVar y, bool tiebreak=true,
2612  IntPropLevel ipl=IPL_DEF);
2622  GECODE_INT_EXPORT void
2623  argmin(Home home, const IntVarArgs& x, int o, IntVar y, bool tiebreak=true,
2624  IntPropLevel ipl=IPL_DEF);
2634  GECODE_INT_EXPORT void
2635  argmax(Home home, const IntVarArgs& x, IntVar y, bool tiebreak=true,
2636  IntPropLevel ipl=IPL_DEF);
2646  GECODE_INT_EXPORT void
2647  argmax(Home home, const IntVarArgs& x, int o, IntVar y, bool tiebreak=true,
2648  IntPropLevel ipl=IPL_DEF);
2649 
2655  GECODE_INT_EXPORT void
2656  abs(Home home, IntVar x0, IntVar x1,
2657  IntPropLevel ipl=IPL_DEF);
2658 
2664  GECODE_INT_EXPORT void
2665  mult(Home home, IntVar x0, IntVar x1, IntVar x2,
2666  IntPropLevel ipl=IPL_DEF);
2667 
2672  GECODE_INT_EXPORT void
2673  divmod(Home home, IntVar x0, IntVar x1, IntVar x2, IntVar x3,
2674  IntPropLevel ipl=IPL_DEF);
2675 
2680  GECODE_INT_EXPORT void
2681  div(Home home, IntVar x0, IntVar x1, IntVar x2,
2682  IntPropLevel ipl=IPL_DEF);
2683 
2688  GECODE_INT_EXPORT void
2689  mod(Home home, IntVar x0, IntVar x1, IntVar x2,
2690  IntPropLevel ipl=IPL_DEF);
2691 
2697  GECODE_INT_EXPORT void
2698  sqr(Home home, IntVar x0, IntVar x1,
2699  IntPropLevel ipl=IPL_DEF);
2700 
2706  GECODE_INT_EXPORT void
2707  sqrt(Home home, IntVar x0, IntVar x1,
2708  IntPropLevel ipl=IPL_DEF);
2709 
2718  GECODE_INT_EXPORT void
2719  pow(Home home, IntVar x0, int n, IntVar x1,
2720  IntPropLevel ipl=IPL_DEF);
2721 
2730  GECODE_INT_EXPORT void
2731  nroot(Home home, IntVar x0, int n, IntVar x1,
2732  IntPropLevel ipl=IPL_DEF);
2733 
2735 
2771  GECODE_INT_EXPORT void
2772  linear(Home home, const IntVarArgs& x,
2773  IntRelType irt, int c,
2774  IntPropLevel ipl=IPL_DEF);
2778  GECODE_INT_EXPORT void
2779  linear(Home home, const IntVarArgs& x,
2780  IntRelType irt, IntVar y,
2781  IntPropLevel ipl=IPL_DEF);
2785  GECODE_INT_EXPORT void
2786  linear(Home home, const IntVarArgs& x,
2787  IntRelType irt, int c, Reify r,
2788  IntPropLevel ipl=IPL_DEF);
2792  GECODE_INT_EXPORT void
2793  linear(Home home, const IntVarArgs& x,
2794  IntRelType irt, IntVar y, Reify r,
2795  IntPropLevel ipl=IPL_DEF);
2802  GECODE_INT_EXPORT void
2803  linear(Home home, const IntArgs& a, const IntVarArgs& x,
2804  IntRelType irt, int c,
2805  IntPropLevel ipl=IPL_DEF);
2812  GECODE_INT_EXPORT void
2813  linear(Home home, const IntArgs& a, const IntVarArgs& x,
2814  IntRelType irt, IntVar y,
2815  IntPropLevel ipl=IPL_DEF);
2822  GECODE_INT_EXPORT void
2823  linear(Home home, const IntArgs& a, const IntVarArgs& x,
2824  IntRelType irt, int c, Reify r,
2825  IntPropLevel ipl=IPL_DEF);
2832  GECODE_INT_EXPORT void
2833  linear(Home home, const IntArgs& a, const IntVarArgs& x,
2834  IntRelType irt, IntVar y, Reify r,
2835  IntPropLevel ipl=IPL_DEF);
2836 
2837 
2865  GECODE_INT_EXPORT void
2866  linear(Home home, const BoolVarArgs& x,
2867  IntRelType irt, int c,
2868  IntPropLevel ipl=IPL_DEF);
2872  GECODE_INT_EXPORT void
2873  linear(Home home, const BoolVarArgs& x,
2874  IntRelType irt, int c, Reify r,
2875  IntPropLevel ipl=IPL_DEF);
2879  GECODE_INT_EXPORT void
2880  linear(Home home, const BoolVarArgs& x,
2881  IntRelType irt, IntVar y,
2882  IntPropLevel ipl=IPL_DEF);
2886  GECODE_INT_EXPORT void
2887  linear(Home home, const BoolVarArgs& x,
2888  IntRelType irt, IntVar y, Reify r,
2889  IntPropLevel ipl=IPL_DEF);
2896  GECODE_INT_EXPORT void
2897  linear(Home home, const IntArgs& a, const BoolVarArgs& x,
2898  IntRelType irt, int c,
2899  IntPropLevel ipl=IPL_DEF);
2906  GECODE_INT_EXPORT void
2907  linear(Home home, const IntArgs& a, const BoolVarArgs& x,
2908  IntRelType irt, int c, Reify r,
2909  IntPropLevel ipl=IPL_DEF);
2916  GECODE_INT_EXPORT void
2917  linear(Home home, const IntArgs& a, const BoolVarArgs& x,
2918  IntRelType irt, IntVar y,
2919  IntPropLevel ipl=IPL_DEF);
2926  GECODE_INT_EXPORT void
2927  linear(Home home, const IntArgs& a, const BoolVarArgs& x,
2928  IntRelType irt, IntVar y, Reify r,
2929  IntPropLevel ipl=IPL_DEF);
2930 
2931 
2958  GECODE_INT_EXPORT void
2959  binpacking(Home home,
2960  const IntVarArgs& l,
2961  const IntVarArgs& b, const IntArgs& s,
2962  IntPropLevel ipl=IPL_DEF);
2963  /* \brief Post propagator for multi-dimensional bin packing
2964  *
2965  * In the following \a n refers to the number of items and \a m
2966  * refers to the number of bins.
2967  *
2968  * The multi-dimensional bin-packing constraint enforces that
2969  * all items are packed into bins
2970  * \f$b_i\in\{0,\ldots,m-1\}\f$ for \f$0\leq i<n\f$
2971  * and that the load of each bin corresponds to the items
2972  * packed into it for each dimension \f$l_{j\cdot
2973  * d + k} = \sum_{\{i\in\{0,\ldots,n-1\}|
2974  * b_{j\cdot d+k}=i}\}s_{i\cdot d+k}\f$
2975  * for \f$0\leq j<m\f$, \f$0\leq k<d\f$
2976  * Furthermore, the load variables must satisfy the capacity
2977  * constraints \f$l_{j\cdot d + k} \leq
2978  * c_k\f$ for \f$0\leq j<m\f$, \f$0\leq k<d\f$.
2979  *
2980  * The constraint is implemented by the decomposition
2981  * introduced in: Stefano Gualandi and Michele Lombardi. A
2982  * simple and effective decomposition for the multidimensional
2983  * binpacking constraint. CP 2013, pages 356--364.
2984  *
2985  * Posting the constraint returns a maximal set containing conflicting
2986  * items that require pairwise different bins.
2987  *
2988  * Note that posting the constraint has exponential complexity in the
2989  * number of items due to the Bron-Kerbosch algorithm used for finding
2990  * the maximal conflict item sets.
2991  *
2992  * Throws the following exceptions:
2993  * - Of type Int::ArgumentSizeMismatch if any of the following properties
2994  * is violated: \f$|b|=n\f$, \f$|l|=m\cdot d\f$, \f$|s|=n\cdot d\f$,
2995  * and \f$|c|=d\f$.
2996  * - Of type Int::ArgumentSame if \a l and \a b share unassigned variables.
2997  * - Of type Int::OutOfLimits if \a s or \a c contains a negative number.
2998  *
2999  * \ingroup TaskModelIntBinPacking
3000  */
3002  binpacking(Home home, int d,
3003  const IntVarArgs& l, const IntVarArgs& b,
3004  const IntArgs& s, const IntArgs& c,
3005  IntPropLevel ipl=IPL_DEF);
3006 
3007 
3026  GECODE_INT_EXPORT void
3027  nooverlap(Home home,
3028  const IntVarArgs& x, const IntArgs& w,
3029  const IntVarArgs& y, const IntArgs& h,
3030  IntPropLevel ipl=IPL_DEF);
3044  GECODE_INT_EXPORT void
3045  nooverlap(Home home,
3046  const IntVarArgs& x, const IntArgs& w,
3047  const IntVarArgs& y, const IntArgs& h,
3048  const BoolVarArgs& o,
3049  IntPropLevel ipl=IPL_DEF);
3066  GECODE_INT_EXPORT void
3067  nooverlap(Home home,
3068  const IntVarArgs& x0, const IntVarArgs& w, const IntVarArgs& x1,
3069  const IntVarArgs& y0, const IntVarArgs& h, const IntVarArgs& y1,
3070  IntPropLevel ipl=IPL_DEF);
3088  GECODE_INT_EXPORT void
3089  nooverlap(Home home,
3090  const IntVarArgs& x0, const IntVarArgs& w, const IntVarArgs& x1,
3091  const IntVarArgs& y0, const IntVarArgs& h, const IntVarArgs& y1,
3092  const BoolVarArgs& o,
3093  IntPropLevel ipl=IPL_DEF);
3094 
3095 
3101 
3144  GECODE_INT_EXPORT void
3145  cumulatives(Home home, const IntVarArgs& m,
3146  const IntVarArgs& s, const IntVarArgs& p,
3147  const IntVarArgs& e, const IntVarArgs& u,
3148  const IntArgs& c, bool at_most,
3149  IntPropLevel ipl=IPL_DEF);
3154  GECODE_INT_EXPORT void
3155  cumulatives(Home home, const IntArgs& m,
3156  const IntVarArgs& s, const IntVarArgs& p,
3157  const IntVarArgs& e, const IntVarArgs& u,
3158  const IntArgs& c, bool at_most,
3159  IntPropLevel ipl=IPL_DEF);
3164  GECODE_INT_EXPORT void
3165  cumulatives(Home home, const IntVarArgs& m,
3166  const IntVarArgs& s, const IntArgs& p,
3167  const IntVarArgs& e, const IntVarArgs& u,
3168  const IntArgs& c, bool at_most,
3169  IntPropLevel ipl=IPL_DEF);
3174  GECODE_INT_EXPORT void
3175  cumulatives(Home home, const IntArgs& m,
3176  const IntVarArgs& s, const IntArgs& p,
3177  const IntVarArgs& e, const IntVarArgs& u,
3178  const IntArgs& c, bool at_most,
3179  IntPropLevel ipl=IPL_DEF);
3184  GECODE_INT_EXPORT void
3185  cumulatives(Home home, const IntVarArgs& m,
3186  const IntVarArgs& s, const IntVarArgs& p,
3187  const IntVarArgs& e, const IntArgs& u,
3188  const IntArgs& c, bool at_most,
3189  IntPropLevel ipl=IPL_DEF);
3194  GECODE_INT_EXPORT void
3195  cumulatives(Home home, const IntArgs& m,
3196  const IntVarArgs& s, const IntVarArgs& p,
3197  const IntVarArgs& e, const IntArgs& u,
3198  const IntArgs& c, bool at_most,
3199  IntPropLevel ipl=IPL_DEF);
3204  GECODE_INT_EXPORT void
3205  cumulatives(Home home, const IntVarArgs& m,
3206  const IntVarArgs& s, const IntArgs& p,
3207  const IntVarArgs& e, const IntArgs& u,
3208  const IntArgs& c, bool at_most,
3209  IntPropLevel ipl=IPL_DEF);
3214  GECODE_INT_EXPORT void
3215  cumulatives(Home home, const IntArgs& m,
3216  const IntVarArgs& s, const IntArgs& p,
3217  const IntVarArgs& e, const IntArgs& u,
3218  const IntArgs& c, bool at_most,
3219  IntPropLevel ipl=IPL_DEF);
3220 
3247  GECODE_INT_EXPORT void
3248  unary(Home home, const IntVarArgs& s, const IntArgs& p,
3249  IntPropLevel ipl=IPL_DEF);
3250 
3279  GECODE_INT_EXPORT void
3280  unary(Home home, const IntVarArgs& s, const IntArgs& p,
3281  const BoolVarArgs& m, IntPropLevel ipl=IPL_DEF);
3282 
3319  GECODE_INT_EXPORT void
3320  unary(Home home, const TaskTypeArgs& t,
3321  const IntVarArgs& flex, const IntArgs& fix, IntPropLevel ipl=IPL_DEF);
3322 
3361  GECODE_INT_EXPORT void
3362  unary(Home home, const TaskTypeArgs& t,
3363  const IntVarArgs& flex, const IntArgs& fix,
3364  const BoolVarArgs& m, IntPropLevel ipl=IPL_DEF);
3365 
3392  GECODE_INT_EXPORT void
3393  unary(Home home, const IntVarArgs& s, const IntVarArgs& p,
3394  const IntVarArgs& e, IntPropLevel ipl=IPL_DEF);
3395 
3424  GECODE_INT_EXPORT void
3425  unary(Home home, const IntVarArgs& s, const IntVarArgs& p,
3426  const IntVarArgs& e, const BoolVarArgs& m, IntPropLevel ipl=IPL_DEF);
3427 
3428 
3429 
3472  GECODE_INT_EXPORT void
3473  cumulative(Home home, int c, const TaskTypeArgs& t,
3474  const IntVarArgs& flex, const IntArgs& fix, const IntArgs& u,
3475  IntPropLevel ipl=IPL_DEF);
3476 
3477 
3482  GECODE_INT_EXPORT void
3483  cumulative(Home home, IntVar c, const TaskTypeArgs& t,
3484  const IntVarArgs& flex, const IntArgs& fix, const IntArgs& u,
3485  IntPropLevel ipl=IPL_DEF);
3486 
3531  GECODE_INT_EXPORT void
3532  cumulative(Home home, int c, const TaskTypeArgs& t,
3533  const IntVarArgs& flex, const IntArgs& fix, const IntArgs& u,
3534  const BoolVarArgs& m, IntPropLevel ipl=IPL_DEF);
3535 
3539  GECODE_INT_EXPORT void
3540  cumulative(Home home, IntVar c, const TaskTypeArgs& t,
3541  const IntVarArgs& flex, const IntArgs& fix, const IntArgs& u,
3542  const BoolVarArgs& m, IntPropLevel ipl=IPL_DEF);
3543 
3576  GECODE_INT_EXPORT void
3577  cumulative(Home home, int c, const IntVarArgs& s, const IntArgs& p,
3578  const IntArgs& u, IntPropLevel ipl=IPL_DEF);
3579 
3583  GECODE_INT_EXPORT void
3584  cumulative(Home home, IntVar c, const IntVarArgs& s, const IntArgs& p,
3585  const IntArgs& u, IntPropLevel ipl=IPL_DEF);
3586 
3621  GECODE_INT_EXPORT void
3622  cumulative(Home home, int c, const IntVarArgs& s, const IntArgs& p,
3623  const IntArgs& u, const BoolVarArgs& m, IntPropLevel ipl=IPL_DEF);
3624 
3628  GECODE_INT_EXPORT void
3629  cumulative(Home home, IntVar c, const IntVarArgs& s, const IntArgs& p,
3630  const IntArgs& u, const BoolVarArgs& m, IntPropLevel ipl=IPL_DEF);
3631 
3668  GECODE_INT_EXPORT void
3669  cumulative(Home home, int c, const IntVarArgs& s, const IntVarArgs& p,
3670  const IntVarArgs& e, const IntArgs& u, IntPropLevel ipl=IPL_DEF);
3671 
3675  GECODE_INT_EXPORT void
3676  cumulative(Home home, IntVar c, const IntVarArgs& s, const IntVarArgs& p,
3677  const IntVarArgs& e, const IntArgs& u, IntPropLevel ipl=IPL_DEF);
3678 
3717  GECODE_INT_EXPORT void
3718  cumulative(Home home, int c, const IntVarArgs& s, const IntVarArgs& p,
3719  const IntVarArgs& e, const IntArgs& u, const BoolVarArgs& m,
3720  IntPropLevel ipl=IPL_DEF);
3721 
3725  GECODE_INT_EXPORT void
3726  cumulative(Home home, IntVar c, const IntVarArgs& s, const IntVarArgs& p,
3727  const IntVarArgs& e, const IntArgs& u, const BoolVarArgs& m,
3728  IntPropLevel ipl=IPL_DEF);
3730 
3731 
3751  GECODE_INT_EXPORT void
3752  circuit(Home home, const IntVarArgs& x,
3753  IntPropLevel ipl=IPL_DEF);
3769  GECODE_INT_EXPORT void
3770  circuit(Home home, int offset, const IntVarArgs& x,
3771  IntPropLevel ipl=IPL_DEF);
3793  GECODE_INT_EXPORT void
3794  circuit(Home home,
3795  const IntArgs& c,
3796  const IntVarArgs& x, const IntVarArgs& y, IntVar z,
3797  IntPropLevel ipl=IPL_DEF);
3820  GECODE_INT_EXPORT void
3821  circuit(Home home,
3822  const IntArgs& c, int offset,
3823  const IntVarArgs& x, const IntVarArgs& y, IntVar z,
3824  IntPropLevel ipl=IPL_DEF);
3843  GECODE_INT_EXPORT void
3844  circuit(Home home,
3845  const IntArgs& c,
3846  const IntVarArgs& x, IntVar z,
3847  IntPropLevel ipl=IPL_DEF);
3868  GECODE_INT_EXPORT void
3869  circuit(Home home,
3870  const IntArgs& c, int offset,
3871  const IntVarArgs& x, IntVar z,
3872  IntPropLevel ipl=IPL_DEF);
3888  GECODE_INT_EXPORT void
3889  path(Home home, const IntVarArgs& x, IntVar s, IntVar e,
3890  IntPropLevel ipl=IPL_DEF);
3908  GECODE_INT_EXPORT void
3909  path(Home home, int offset, const IntVarArgs& x, IntVar s, IntVar e,
3910  IntPropLevel ipl=IPL_DEF);
3933  GECODE_INT_EXPORT void
3934  path(Home home,
3935  const IntArgs& c,
3936  const IntVarArgs& x, IntVar s, IntVar e, const IntVarArgs& y, IntVar z,
3937  IntPropLevel ipl=IPL_DEF);
3962  GECODE_INT_EXPORT void
3963  path(Home home,
3964  const IntArgs& c, int offset,
3965  const IntVarArgs& x, IntVar s, IntVar e, const IntVarArgs& y, IntVar z,
3966  IntPropLevel ipl=IPL_DEF);
3987  GECODE_INT_EXPORT void
3988  path(Home home,
3989  const IntArgs& c,
3990  const IntVarArgs& x, IntVar s, IntVar e, IntVar z,
3991  IntPropLevel ipl=IPL_DEF);
4014  GECODE_INT_EXPORT void
4015  path(Home home,
4016  const IntArgs& c, int offset,
4017  const IntVarArgs& x, IntVar s, IntVar e, IntVar z,
4018  IntPropLevel ipl=IPL_DEF);
4020 
4021 
4022 
4031  GECODE_INT_EXPORT void
4033  wait(Home home, IntVar x, std::function<void(Space& home)> c,
4034  IntPropLevel ipl=IPL_DEF);
4036  GECODE_INT_EXPORT void
4037  wait(Home home, BoolVar x, std::function<void(Space& home)> c,
4038  IntPropLevel ipl=IPL_DEF);
4040  GECODE_INT_EXPORT void
4041  wait(Home home, const IntVarArgs& x, std::function<void(Space& home)> c,
4042  IntPropLevel ipl=IPL_DEF);
4044  GECODE_INT_EXPORT void
4045  wait(Home home, const BoolVarArgs& x,
4046  std::function<void(Space& home)> c,
4047  IntPropLevel ipl=IPL_DEF);
4049  GECODE_INT_EXPORT void
4050  when(Home home, BoolVar x,
4051  std::function<void(Space& home)> t,
4052  std::function<void(Space& home)> e,
4053  IntPropLevel ipl=IPL_DEF);
4055  GECODE_INT_EXPORT void
4056  when(Home home, BoolVar x,
4057  std::function<void(Space& home)> t,
4058  IntPropLevel ipl=IPL_DEF);
4060 
4061 
4086  GECODE_INT_EXPORT void
4087  unshare(Home home, IntVarArgs& x,
4088  IntPropLevel ipl=IPL_DEF);
4090  GECODE_INT_EXPORT void
4091  unshare(Home home, BoolVarArgs& x,
4092  IntPropLevel ipl=IPL_DEF);
4094 
4095 }
4096 
4097 namespace Gecode {
4098 
4112  typedef std::function<bool(const Space& home, IntVar x, int i)>
4122  typedef std::function<bool(const Space& home, BoolVar x, int i)>
4124 
4134  typedef std::function<double(const Space& home, IntVar x, int i)>
4145  typedef std::function<double(const Space& home, BoolVar x, int i)>
4147 
4158  typedef std::function<int(const Space& home, IntVar x, int i)>
4170  typedef std::function<int(const Space& home, BoolVar x, int i)>
4172 
4184  typedef std::function<void(Space& home, unsigned int a,
4185  IntVar x, int i, int n)>
4198  typedef std::function<void(Space& home, unsigned int a,
4199  BoolVar x, int i, int n)>
4201 
4202 }
4203 
4205 
4206 namespace Gecode {
4207 
4213  class IntAFC : public AFC {
4214  public:
4222  IntAFC(void);
4224  IntAFC(const IntAFC& a);
4226  IntAFC& operator =(const IntAFC& a);
4234  IntAFC(Home home, const IntVarArgs& x, double d=1.0, bool share=true);
4245  void init(Home home, const IntVarArgs& x, double d=1.0, bool share=true);
4246  };
4247 
4253  class BoolAFC : public AFC {
4254  public:
4262  BoolAFC(void);
4264  BoolAFC(const BoolAFC& a);
4266  BoolAFC& operator =(const BoolAFC& a);
4274  BoolAFC(Home home, const BoolVarArgs& x, double d=1.0, bool share=true);
4285  void init(Home home, const BoolVarArgs& x, double d=1.0, bool share=true);
4286  };
4287 
4288 }
4289 
4290 #include <gecode/int/branch/afc.hpp>
4291 
4292 namespace Gecode {
4293 
4299  class IntAction : public Action {
4300  public:
4308  IntAction(void);
4310  IntAction(const IntAction& a);
4312  IntAction& operator =(const IntAction& a);
4321  IntAction(Home home, const IntVarArgs& x, double d=1.0,
4322  IntBranchMerit bm=nullptr);
4334  GECODE_INT_EXPORT void
4335  init(Home home, const IntVarArgs& x, double d=1.0,
4336  IntBranchMerit bm=nullptr);
4337  };
4338 
4344  class BoolAction : public Action {
4345  public:
4353  BoolAction(void);
4355  BoolAction(const BoolAction& a);
4357  BoolAction& operator =(const BoolAction& a);
4366  BoolAction(Home home, const BoolVarArgs& x, double d=1.0,
4367  BoolBranchMerit bm=nullptr);
4379  GECODE_INT_EXPORT void
4380  init(Home home, const BoolVarArgs& x, double d=1.0,
4381  BoolBranchMerit bm=nullptr);
4382  };
4383 
4384 }
4385 
4387 
4388 namespace Gecode {
4389 
4395  class IntCHB : public CHB {
4396  public:
4404  IntCHB(void);
4406  IntCHB(const IntCHB& chb);
4408  IntCHB& operator =(const IntCHB& chb);
4418  IntCHB(Home home, const IntVarArgs& x, IntBranchMerit bm=nullptr);
4430  GECODE_INT_EXPORT void
4431  init(Home home, const IntVarArgs& x, IntBranchMerit bm=nullptr);
4432  };
4433 
4439  class BoolCHB : public CHB {
4440  public:
4448  BoolCHB(void);
4450  BoolCHB(const BoolCHB& chb);
4452  BoolCHB& operator =(const BoolCHB& chb);
4462  BoolCHB(Home home, const BoolVarArgs& x, BoolBranchMerit bm=nullptr);
4474  GECODE_INT_EXPORT void
4475  init(Home home, const BoolVarArgs& x, BoolBranchMerit bm=nullptr);
4476  };
4477 
4478 }
4479 
4480 #include <gecode/int/branch/chb.hpp>
4481 
4482 namespace Gecode {
4483 
4485  typedef std::function<void(const Space &home, const Brancher& b,
4486  unsigned int a,
4487  IntVar x, int i, const int& n,
4488  std::ostream& o)>
4490 
4492  typedef std::function<void(const Space &home, const Brancher& b,
4493  unsigned int a,
4494  BoolVar x, int i, const int& n,
4495  std::ostream& o)>
4497 
4498 }
4499 
4500 namespace Gecode {
4501 
4507  class IntVarBranch : public VarBranch<IntVar> {
4508  public:
4510  enum Select {
4511  SEL_NONE = 0,
4537 
4560  SEL_REGRET_MAX_MAX
4561  };
4562  protected:
4565  public:
4567  IntVarBranch(void);
4569  IntVarBranch(Rnd r);
4573  IntVarBranch(Select s, double d, BranchTbl t);
4583  Select select(void) const;
4585  void expand(Home home, const IntVarArgs& x);
4586  };
4587 
4593  class BoolVarBranch : public VarBranch<BoolVar> {
4594  public:
4596  enum Select {
4597  SEL_NONE = 0,
4608  SEL_CHB_MAX
4609  };
4610  protected:
4613  public:
4615  BoolVarBranch(void);
4617  BoolVarBranch(Rnd r);
4621  BoolVarBranch(Select s, double d, BranchTbl t);
4631  Select select(void) const;
4633  void expand(Home home, const BoolVarArgs& x);
4634  };
4635 
4641  IntVarBranch INT_VAR_NONE(void);
4654  IntVarBranch INT_VAR_AFC_MIN(double d=1.0, BranchTbl tbl=nullptr);
4658  IntVarBranch INT_VAR_AFC_MAX(double d=1.0, BranchTbl tbl=nullptr);
4662  IntVarBranch INT_VAR_ACTION_MIN(double d=1.0, BranchTbl tbl=nullptr);
4666  IntVarBranch INT_VAR_ACTION_MAX(double d=1.0, BranchTbl tbl=nullptr);
4694  IntVarBranch INT_VAR_AFC_SIZE_MIN(double d=1.0, BranchTbl tbl=nullptr);
4698  IntVarBranch INT_VAR_AFC_SIZE_MAX(double d=1.0, BranchTbl tbl=nullptr);
4702  IntVarBranch INT_VAR_ACTION_SIZE_MIN(double d=1.0, BranchTbl tbl=nullptr);
4706  IntVarBranch INT_VAR_ACTION_SIZE_MAX(double d=1.0, BranchTbl tbl=nullptr);
4741 
4755  BoolVarBranch BOOL_VAR_AFC_MIN(double d=1.0, BranchTbl tbl=nullptr);
4759  BoolVarBranch BOOL_VAR_AFC_MAX(double d=1.0, BranchTbl tbl=nullptr);
4763  BoolVarBranch BOOL_VAR_ACTION_MIN(double d=1.0, BranchTbl tbl=nullptr);
4767  BoolVarBranch BOOL_VAR_ACTION_MAX(double d=1.0, BranchTbl tbl=nullptr);
4779 
4780 }
4781 
4782 #include <gecode/int/branch/var.hpp>
4783 
4784 namespace Gecode {
4785 
4791  class IntValBranch : public ValBranch<IntVar> {
4792  public:
4794  enum Select {
4805  SEL_VALUES_MAX
4806  };
4807  protected:
4810  public:
4812  IntValBranch(Select s = SEL_MIN);
4814  IntValBranch(Rnd r);
4818  Select select(void) const;
4819  };
4820 
4826  class BoolValBranch : public ValBranch<BoolVar> {
4827  public:
4829  enum Select {
4833  SEL_VAL_COMMIT
4834  };
4835  protected:
4838  public:
4840  BoolValBranch(Select s = SEL_MIN);
4842  BoolValBranch(Rnd r);
4846  Select select(void) const;
4847  };
4848 
4854  IntValBranch INT_VAL_MIN(void);
4857  IntValBranch INT_VAL_MED(void);
4859  IntValBranch INT_VAL_MAX(void);
4881 
4896 
4897 }
4898 
4899 #include <gecode/int/branch/val.hpp>
4900 
4901 namespace Gecode {
4902 
4908  class IntAssign : public ValBranch<IntVar> {
4909  public:
4911  enum Select {
4916  SEL_VAL_COMMIT
4917  };
4918  protected:
4921  public:
4923  IntAssign(Select s = SEL_MIN);
4925  IntAssign(Rnd r);
4929  Select select(void) const;
4930  };
4931 
4937  class BoolAssign : public ValBranch<BoolVar> {
4938  public:
4940  enum Select {
4944  SEL_VAL_COMMIT
4945  };
4946  protected:
4949  public:
4951  BoolAssign(Select s = SEL_MIN);
4953  BoolAssign(Rnd r);
4957  Select select(void) const;
4958  };
4959 
4965  IntAssign INT_ASSIGN_MIN(void);
4968  IntAssign INT_ASSIGN_MED(void);
4970  IntAssign INT_ASSIGN_MAX(void);
4980 
4995 
4996 }
4997 
4999 
5000 namespace Gecode {
5006  GECODE_INT_EXPORT void
5007  branch(Home home, const IntVarArgs& x,
5008  IntVarBranch vars, IntValBranch vals,
5009  IntBranchFilter bf=nullptr,
5010  IntVarValPrint vvp=nullptr);
5016  GECODE_INT_EXPORT void
5017  branch(Home home, const IntVarArgs& x,
5019  IntBranchFilter bf=nullptr,
5020  IntVarValPrint vvp=nullptr);
5026  GECODE_INT_EXPORT void
5027  branch(Home home, IntVar x, IntValBranch vals,
5028  IntVarValPrint vvp=nullptr);
5034  GECODE_INT_EXPORT void
5035  branch(Home home, const BoolVarArgs& x,
5036  BoolVarBranch vars, BoolValBranch vals,
5037  BoolBranchFilter bf=nullptr,
5038  BoolVarValPrint vvp=nullptr);
5044  GECODE_INT_EXPORT void
5045  branch(Home home, const BoolVarArgs& x,
5047  BoolBranchFilter bf=nullptr,
5048  BoolVarValPrint vvp=nullptr);
5054  GECODE_INT_EXPORT void
5055  branch(Home home, BoolVar x, BoolValBranch vals,
5056  BoolVarValPrint vvp=nullptr);
5057 
5063  GECODE_INT_EXPORT void
5064  assign(Home home, const IntVarArgs& x, IntAssign vals,
5065  IntBranchFilter bf=nullptr,
5066  IntVarValPrint vvp=nullptr);
5072  GECODE_INT_EXPORT void
5073  assign(Home home, IntVar x, IntAssign vals,
5074  IntVarValPrint vvp=nullptr);
5080  GECODE_INT_EXPORT void
5081  assign(Home home, const BoolVarArgs& x, BoolAssign vals,
5082  BoolBranchFilter bf=nullptr,
5083  BoolVarValPrint vvp=nullptr);
5089  GECODE_INT_EXPORT void
5090  assign(Home home, BoolVar x, BoolAssign vals,
5091  BoolVarValPrint vvp=nullptr);
5092 
5093 }
5094 
5095 namespace Gecode {
5096 
5100  template<class Char, class Traits>
5101  std::basic_ostream<Char,Traits>&
5102  operator <<(std::basic_ostream<Char,Traits>& os, const DFA& d);
5103 
5107  template<class Char, class Traits>
5108  std::basic_ostream<Char,Traits>&
5109  operator <<(std::basic_ostream<Char,Traits>& os, const TupleSet& ts);
5110 
5111 }
5112 
5113 // LDSB-related declarations.
5114 namespace Gecode {
5115 
5116  namespace Int { namespace LDSB {
5117  class SymmetryObject;
5118  }}
5119 
5126  public:
5130  void increment(void);
5132  void decrement(void);
5133  public:
5135  SymmetryHandle(void);
5139  SymmetryHandle(const SymmetryHandle& h);
5141  const SymmetryHandle& operator=(const SymmetryHandle& h);
5143  ~SymmetryHandle(void);
5144  };
5145  class Symmetries;
5147  template<>
5149  public:
5153  };
5154 
5161  class Symmetries : public ArgArray<SymmetryHandle> {};
5163  // If this is instead a typedef, strange things happen with the
5164  // overloading of the "branch" function.
5165 
5172  const IntArgs& indices);
5199  SymmetryHandle ValueSequenceSymmetry(const IntArgs& v, int ss);
5200 
5202  GECODE_INT_EXPORT SymmetryHandle values_reflect(int lower, int upper);
5206 
5218  GECODE_INT_EXPORT void
5219  branch(Home home, const IntVarArgs& x,
5220  IntVarBranch vars, IntValBranch vals,
5221  const Symmetries& syms,
5222  IntBranchFilter bf=nullptr,
5223  IntVarValPrint vvp=nullptr);
5235  GECODE_INT_EXPORT void
5236  branch(Home home, const IntVarArgs& x,
5238  const Symmetries& syms,
5239  IntBranchFilter bf=nullptr,
5240  IntVarValPrint vvp=nullptr);
5252  GECODE_INT_EXPORT void
5253  branch(Home home, const BoolVarArgs& x,
5254  BoolVarBranch vars, BoolValBranch vals,
5255  const Symmetries& syms,
5256  BoolBranchFilter bf=nullptr,
5257  BoolVarValPrint vvp=nullptr);
5269  GECODE_INT_EXPORT void
5270  branch(Home home, const BoolVarArgs& x,
5272  const Symmetries& syms,
5273  BoolBranchFilter bf=nullptr,
5274  BoolVarValPrint vvp=nullptr);
5275 
5276 #ifdef GECODE_HAS_CBS
5277 
5298  GECODE_INT_EXPORT void
5299  cbsbranch(Home home, const IntVarArgs& x);
5300 
5301 
5322  GECODE_INT_EXPORT void
5323  cbsbranch(Home home, const BoolVarArgs& x);
5324 
5325 #endif
5326 
5327 }
5328 
5329 namespace Gecode {
5330 
5331  /*
5332  * \brief Relaxed assignment of variables in \a x from values in \a sx
5333  *
5334  * The variables in \a x are assigned values from the assigned variables
5335  * in the solution \a sx with a relaxation probability \a p. That is,
5336  * if \$fp=0.1\f$ approximately 10% of the variables in \a x will be
5337  * assigned a value from \a sx.
5338  *
5339  * The random numbers are generated from the generator \a r. At least
5340  * one variable will not be assigned: in case the relaxation attempt
5341  * would suggest that all variables should be assigned, a single
5342  * variable will be selected randomly to remain unassigned.
5343  *
5344  * Throws an exception of type Int::ArgumentSizeMismatch, if \a x and
5345  * \a sx are of different size.
5346  *
5347  * Throws an exception of type Int::OutOfLimits, if \a p is not between
5348  * \a 0.0 and \a 1.0.
5349  *
5350  * \ingroup TaskModelInt
5351  */
5352  GECODE_INT_EXPORT void
5353  relax(Home home, const IntVarArgs& x, const IntVarArgs& sx,
5354  Rnd r, double p);
5355 
5356  /*
5357  * \brief Relaxed assignment of variables in \a x from values in \a sx
5358  *
5359  * The variables in \a x are assigned values from the assigned variables
5360  * in the solution \a sx with a relaxation probability \a p. That is,
5361  * if \$fp=0.1\f$ approximately 10% of the variables in \a x will be
5362  * assigned a value from \a sx.
5363  *
5364  * The random numbers are generated from the generator \a r. At least
5365  * one variable will not be assigned: in case the relaxation attempt
5366  * would suggest that all variables should be assigned, a single
5367  * variable will be selected randomly to remain unassigned.
5368  *
5369  * Throws an exception of type Int::ArgumentSizeMismatch, if \a x and
5370  * \a sx are of different size.
5371  *
5372  * Throws an exception of type Int::OutOfLimits, if \a p is not between
5373  * \a 0.0 and \a 1.0.
5374  *
5375  * \ingroup TaskModelInt
5376  */
5377  GECODE_INT_EXPORT void
5378  relax(Home home, const BoolVarArgs& x, const BoolVarArgs& sx,
5379  Rnd r, double p);
5380 
5381 }
5382 
5383 
5386 
5387 namespace Gecode {
5388 
5399  : public Iter::Ranges::Diff<Iter::Ranges::RangeList,
5400  Int::ViewRanges<Int::IntView> > {
5401  protected:
5406  public:
5408 
5412  };
5413 
5419  protected:
5421  int delta;
5422  public:
5424 
5428 
5430  bool operator ()(void) const;
5433  void operator ++(void);
5435 
5437 
5438  int min(void) const;
5441  int max(void) const;
5443  unsigned int width(void) const;
5445  };
5446 
5447 }
5448 
5451 
5452 #include <gecode/int/trace/traits.hpp>
5453 
5454 namespace Gecode {
5455 
5466 
5471  class GECODE_INT_EXPORT StdIntTracer : public IntTracer {
5472  protected:
5474  std::ostream& os;
5475  public:
5477  StdIntTracer(std::ostream& os0 = std::cerr);
5479  virtual void init(const Space& home, const IntTraceRecorder& t);
5481  virtual void prune(const Space& home, const IntTraceRecorder& t,
5482  const ViewTraceInfo& vti, int i, IntTraceDelta& d);
5484  virtual void fix(const Space& home, const IntTraceRecorder& t);
5486  virtual void fail(const Space& home, const IntTraceRecorder& t);
5488  virtual void done(const Space& home, const IntTraceRecorder& t);
5491  };
5492 
5493 
5504 
5509  class GECODE_INT_EXPORT StdBoolTracer : public BoolTracer {
5510  protected:
5512  std::ostream& os;
5513  public:
5515  StdBoolTracer(std::ostream& os0 = std::cerr);
5517  virtual void init(const Space& home, const BoolTraceRecorder& t);
5519  virtual void prune(const Space& home, const BoolTraceRecorder& t,
5520  const ViewTraceInfo& vti, int i, BoolTraceDelta& d);
5522  virtual void fix(const Space& home, const BoolTraceRecorder& t);
5524  virtual void fail(const Space& home, const BoolTraceRecorder& t);
5526  virtual void done(const Space& home, const BoolTraceRecorder& t);
5529  };
5530 
5535  GECODE_INT_EXPORT void
5536  trace(Home home, const IntVarArgs& x,
5537  TraceFilter tf,
5538  int te = (TE_INIT | TE_PRUNE | TE_FIX | TE_FAIL | TE_DONE),
5539  IntTracer& t = StdIntTracer::def);
5544  void
5545  trace(Home home, const IntVarArgs& x,
5546  int te = (TE_INIT | TE_PRUNE | TE_FIX | TE_FAIL | TE_DONE),
5547  IntTracer& t = StdIntTracer::def);
5548 
5553  GECODE_INT_EXPORT void
5554  trace(Home home, const BoolVarArgs& x,
5555  TraceFilter tf,
5556  int te = (TE_INIT | TE_PRUNE | TE_FIX | TE_FAIL | TE_DONE),
5557  BoolTracer& t = StdBoolTracer::def);
5562  void
5563  trace(Home home, const BoolVarArgs& x,
5564  int te = (TE_INIT | TE_PRUNE | TE_FIX | TE_FAIL | TE_DONE),
5565  BoolTracer& t = StdBoolTracer::def);
5566 
5567 }
5568 
5569 #include <gecode/int/trace.hpp>
5570 
5571 #endif
5572 
5573 // IFDEF: GECODE_HAS_INT_VARS
5574 // STATISTICS: int-post
5575 
Value iterator for integer variables.
Definition: int.hh:490
BoolValBranch BOOL_VAL_RND(Rnd r)
Select random value.
Definition: val.hpp:140
const Range * c
Current range.
Definition: int.hh:2361
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:4186
Bounds propagation.
Definition: int.hh:978
std::function< double(const Space &home, BoolVar x, int i)> BoolBranchMerit
Branch merit function type for Boolean variables.
Definition: int.hh:4146
With smallest accumulated failure count.
Definition: int.hh:4517
void mod(Home home, IntVar x0, IntVar x1, IntVar x2, IntPropLevel ipl)
Post propagator for .
Definition: arithmetic.cpp:263
IntVarBranch INT_VAR_DEGREE_SIZE_MAX(BranchTbl tbl)
Select variable with largest degree divided by domain size.
Definition: var.hpp:221
Int::ViewRanges< Int::IntView > rn
Iterator over the new values.
Definition: int.hh:5403
IntValBranch INT_VAL_RANGE_MIN(void)
Select the smallest range of the variable domain if it has several ranges, otherwise select values no...
Definition: val.hpp:85
Duplicate of a Boolean view.
IntPropLevel vbd(IntPropLevel ipl)
Extract value, bounds, or domain propagation from propagation level.
Definition: ipl.hpp:37
int symbol
symbol
Definition: int.hh:2060
Variables as interfaces to variable implementations.
Definition: var.hpp:47
NodeType t
Type of node.
Definition: bool-expr.cpp:230
Tracer that process view trace information.
Definition: tracer.hpp:51
IntVarBranch INT_VAR_CHB_SIZE_MAX(IntCHB c, BranchTbl tbl)
Select variable with largest CHB Q-score divided by domain size.
Definition: var.hpp:276
IntVarBranch INT_VAR_NONE(void)
Select first unassigned variable.
Definition: var.hpp:96
Combine variable selection criteria for tie-breaking.
Definition: tiebreak.hpp:38
int arity
Arity.
Definition: int.hh:2234
Select s
Which variable to select.
Definition: int.hh:4564
void mult(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition: arithmetic.cpp:88
BoolVarBranch BOOL_VAR_NONE(void)
Select first unassigned variable.
Definition: var.hpp:364
The shared handle.
int * td
Tuple data.
Definition: int.hh:2248
NNF * l
Left subtree.
Definition: bool-expr.cpp:240
TaskType
Type of task for scheduling constraints.
Definition: int.hh:1003
Inverse implication for reification.
Definition: int.hh:869
void sorted(Home home, const IntVarArgs &x, const IntVarArgs &y, const IntVarArgs &z, IntPropLevel)
Post propagator that y is x sorted in increasing order.
Definition: sorted.cpp:39
int n_free
Number of free tuple entries of arity.
Definition: int.hh:2240
BoolVarBranch BOOL_VAR_AFC_MIN(double d, BranchTbl tbl)
Select variable with smallest accumulated failure count with decay factor d.
Definition: var.hpp:394
With largest min-regret.
Definition: int.hh:4548
Select s
Which value to select.
Definition: int.hh:4948
View trace information.
Definition: core.hpp:905
Range iterator for integer sets.
Definition: int.hh:292
BoolAssign BOOL_ASSIGN_MIN(void)
Select smallest value.
Definition: assign.hpp:100
void sequence(Home home, const IntVarArgs &x, const IntSet &s, int q, int l, int u, IntPropLevel)
Post propagator for .
Definition: sequence.cpp:47
Iterator for DFA symbols.
Definition: int.hh:2091
Select random value.
Definition: int.hh:4832
void branch(Home home, const FloatVarArgs &x, FloatVarBranch vars, FloatValBranch vals, FloatBranchFilter bf, FloatVarValPrint vvp)
Branch over x with variable selection vars and value selection vals.
Definition: branch.cpp:39
bool operator==(const CachedView< View > &x, const CachedView< View > &y)
Definition: cached.hpp:401
Which values to select for branching first.
Definition: int.hh:4826
void channel(Home home, FloatVar x0, IntVar x1)
Post propagator for channeling a float and an integer variable .
Definition: channel.cpp:41
Iter::Ranges::RangeList ro
Iterator over the old values.
Definition: int.hh:5405
void count(Home home, const IntVarArgs &x, int n, IntRelType irt, int m, IntPropLevel)
Post propagator for .
Definition: count.cpp:40
bool one(const Gecode::FloatValArgs &a)
Check whether has only one coefficients.
Definition: linear.cpp:46
Standard Boolean variable tracer.
Definition: int.hh:5509
Select
Which value selection.
Definition: int.hh:4911
Select smallest value.
Definition: int.hh:4830
BoolOpType
Operation types for Booleans.
Definition: int.hh:950
With smallest accumulated failure count.
Definition: int.hh:4603
Which values to select for branching first.
Definition: int.hh:4791
With smallest degree.
Definition: int.hh:4515
IntVarBranch INT_VAR_SIZE_MAX(BranchTbl tbl)
Select variable with largest domain size.
Definition: var.hpp:211
Select smallest value.
Definition: int.hh:4795
Which integer variable to select for branching.
Definition: int.hh:4507
With largest accumulated failure count.
Definition: int.hh:4518
void abs(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition: arithmetic.cpp:41
IntAssign INT_ASSIGN_MED(void)
Select greatest value not greater than the median.
Definition: assign.hpp:60
Select s
Which value to select.
Definition: int.hh:4837
Less or equal ( )
Definition: int.hh:928
void nroot(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for $n 0$.
Definition: arithmetic.cpp:118
void pow(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for $n 0$.
Definition: arithmetic.cpp:109
IntVarBranch INT_VAR_REGRET_MIN_MIN(BranchTbl tbl)
Select variable with smallest min-regret.
Definition: var.hpp:286
IntVarBranch INT_VAR_DEGREE_MAX(BranchTbl tbl)
Select variable with largest degree.
Definition: var.hpp:121
BoolVarBranch BOOL_VAR_ACTION_MIN(double d, BranchTbl tbl)
Select variable with lowest action with decay factor d.
Definition: var.hpp:414
bool normalize(Term< View > *t, int &n, Term< View > *&t_p, int &n_p, Term< View > *&t_n, int &n_n, int &g)
Normalize linear integer constraints.
Definition: post.hpp:115
bool pos(const View &x)
Test whether x is postive.
Definition: mult.hpp:41
Conjunction.
Definition: int.hh:951
Range iterator for range lists
With largest accumulated failure count divided by domain size.
Definition: int.hh:4532
IntVarBranch INT_VAR_AFC_MIN(double d, BranchTbl tbl)
Select variable with smallest accumulated failure count with decay factor d.
Definition: var.hpp:126
int * Tuple
Type of a tuple.
Definition: int.hh:2196
void member(Home home, const IntVarArgs &x, IntVar y, IntPropLevel)
Post domain consistent propagator for .
Definition: member.cpp:39
void path(Home home, int offset, const IntVarArgs &x, IntVar s, IntVar e, IntPropLevel ipl)
Post propagator such that x forms a Hamiltonian path.
Definition: circuit.cpp:124
void dom(Home home, FloatVar x, FloatVal n)
Propagates .
Definition: dom.cpp:40
Collection of symmetries.
Definition: int.hh:5162
Which values to select for assignment.
Definition: int.hh:4937
bool equal(I &i, J &j)
Check whether range iterators i and j are equal.
void linear(Home home, const FloatVarArgs &x, FloatRelType frt, FloatVal c)
Post propagator for .
Definition: linear.cpp:41
With highest action.
Definition: int.hh:4606
Implementation of a symmetry at the modelling level.
Definition: ldsb.hh:106
IntValBranch INT_VAL_RANGE_MAX(void)
Select the largest range of the variable domain if it has several ranges, otherwise select values gre...
Definition: val.hpp:90
IntVarBranch INT_VAR_CHB_SIZE_MIN(IntCHB c, BranchTbl tbl)
Select variable with smallest CHB Q-score divided by domain size.
Definition: var.hpp:266
void nonnegative(int n, const char *l)
Check whether n is in range and nonnegative, otherwise throw out of limits with information l...
Definition: limits.hpp:68
Implication.
Definition: int.hh:953
Integer variable array.
Definition: int.hh:763
IntVarBranch INT_VAR_MERIT_MAX(IntBranchMerit bm, BranchTbl tbl)
Select variable with highest merit according to branch merit function bm.
Definition: var.hpp:111
Select the smallest range of the variable domain if it has several ranges, otherwise select values no...
Definition: int.hh:4801
void circuit(Home home, int offset, const IntVarArgs &x, IntPropLevel ipl)
Post propagator such that x forms a circuit.
Definition: circuit.cpp:41
void argmin(Home home, const IntVarArgs &x, IntVar y, bool tiebreak, IntPropLevel)
Post propagator for .
Definition: arithmetic.cpp:163
BoolVarBranch BOOL_VAR_MERIT_MIN(BoolBranchMerit bm, BranchTbl tbl)
Select variable with least merit according to branch merit function bm.
Definition: var.hpp:374
BoolAssign BOOL_ASSIGN_MAX(void)
Select largest value.
Definition: assign.hpp:105
BitSetData * support
Pointer to all support data.
Definition: int.hh:2254
Select s
Which value to select.
Definition: int.hh:4809
IntVarBranch INT_VAR_REGRET_MIN_MAX(BranchTbl tbl)
Select variable with largest min-regret.
Definition: var.hpp:291
Greater ( )
Definition: int.hh:931
void binpacking(Home home, const IntVarArgs &l, const IntVarArgs &b, const IntArgs &s, IntPropLevel)
Post propagator for bin packing.
Definition: bin-packing.cpp:41
Select largest value.
Definition: int.hh:4942
ArgArray< IntSet > IntSetArgs
Passing set arguments.
Definition: int.hh:619
Trace init events.
Definition: recorder.hpp:43
const int max
Largest allowed integer value.
Definition: int.hh:116
With largest accumulated failure count.
Definition: int.hh:4604
With lowest action.
Definition: int.hh:4605
Computation spaces.
Definition: core.hpp:1701
ExecStatus prune(Space &home, ViewArray< VX > &x, ConstIntView)
Definition: rel.hpp:264
Greater or equal ( )
Definition: int.hh:930
Standard integer variable tracer.
Definition: int.hh:5471
Select s
Which value to select.
Definition: int.hh:4920
ViewTracer< Int::IntView > IntTracer
Tracer for integer variables.
Definition: int.hh:5460
With smallest min.
Definition: int.hh:4523
int min
Smallest value.
Definition: int.hh:2242
int i_state
input state
Definition: int.hh:2059
Exclusive or.
Definition: int.hh:955
const int min
Smallest allowed integer value.
Definition: int.hh:118
Select smallest value.
Definition: int.hh:4912
Iterator over ranges.
Definition: int.hh:2358
ViewTraceRecorder< Int::IntView > IntTraceRecorder
Trace recorder for integer variables.
Definition: int.hh:5465
ArgArray< TaskType > TaskTypeArgs
Argument arrays for passing task type arguments.
Definition: int.hh:1014
Range iterator for integer variables
Definition: int.hh:473
IntAssign INT_ASSIGN_MIN(void)
Select smallest value.
Definition: assign.hpp:55
IntValBranch INT_VAL_RND(Rnd r)
Select random value.
Definition: val.hpp:70
With lowest action.
Definition: int.hh:4519
Random (uniform, for tie breaking)
Definition: int.hh:4598
Gecode::IntSet d(v, 7)
bool overflow_mul(int n, int m)
Check whether multiplying n and m would overflow.
Definition: limits.hpp:107
IntVarBranch INT_VAR_MAX_MAX(BranchTbl tbl)
Select variable with largest max.
Definition: var.hpp:201
Select s
Which variable to select.
Definition: int.hh:4612
Range * r
Ranges.
Definition: int.hh:2220
ValueData * vd
Value data.
Definition: int.hh:2250
std::string expand(Gecode::IntRelType irt)
Expand relation to abbreviation.
Definition: mm-count.cpp:44
Reify imp(BoolVar x)
Use implication for reification.
Definition: reify.hpp:73
Gecode::FloatVal c(-8, 8)
Trace prune events.
Definition: recorder.hpp:44
SymmetryHandle VariableSymmetry(const IntVarArgs &vars)
Variables in x are interchangeable.
Definition: ldsb.cpp:62
Deterministic finite automaton (DFA)
Definition: int.hh:2048
int p
Number of positive literals for node type.
Definition: bool-expr.cpp:232
IntVarBranch INT_VAR_ACTION_MAX(double d, BranchTbl tbl)
Select variable with highest action with decay factor d.
Definition: var.hpp:156
With smallest max-regret.
Definition: int.hh:4554
BoolValBranch BOOL_VAL_MIN(void)
Select smallest value.
Definition: val.hpp:130
IntVarBranch INT_VAR_AFC_SIZE_MAX(double d, BranchTbl tbl)
Select variable with largest accumulated failure count divided by domain size with decay factor d...
Definition: var.hpp:236
IntAssign INT_ASSIGN(IntBranchVal v, IntBranchCommit c)
Select value as defined by the value function v and commit function c.
Definition: assign.hpp:75
Base-class for branchers.
Definition: core.hpp:1401
Class for AFC (accumulated failure count) management.
Definition: afc.hpp:40
IntRelType neg(IntRelType irt)
Return negated relation type of irt.
Definition: irt.hpp:52
BoolValBranch BOOL_VAL_MAX(void)
Select largest value.
Definition: val.hpp:135
int n
Number of negative literals for node type.
Definition: bool-expr.cpp:234
Equality ( )
Definition: int.hh:926
void unshare(Home home, IntVarArgs &x, IntPropLevel ipl)
Replace multiple variable occurences in x by fresh variables.
Definition: unshare.cpp:136
std::size_t key
Hash key.
Definition: int.hh:2246
const long long int llmin
Smallest allowed long long integer value.
Definition: int.hh:124
Select random value.
Definition: int.hh:4915
With smallest degree.
Definition: int.hh:4601
Gecode::IntArgs i({1, 2, 3, 4})
With smallest min-regret.
Definition: int.hh:4542
A reference-counted pointer to a SymmetryObject.
Definition: int.hh:5125
void divmod(Home home, IntVar x0, IntVar x1, IntVar x2, IntVar x3, IntPropLevel)
Post propagator for .
Definition: arithmetic.cpp:230
std::function< int(const Space &home, IntVar x, int i)> IntBranchVal
Branch value function type for integer variables.
Definition: int.hh:4159
void nvalues(Home home, const IntVarArgs &x, IntRelType irt, int y, IntPropLevel)
Post propagator for .
Definition: nvalues.cpp:40
IntAssign INT_ASSIGN_RND(Rnd r)
Select random value.
Definition: assign.hpp:70
With largest action divided by domain size.
Definition: int.hh:4534
unsigned int n_words
Number of words for support.
Definition: int.hh:2236
Select
Which value selection.
Definition: int.hh:4940
IntRelType
Relation types for integers.
Definition: int.hh:925
IntVarBranch INT_VAR_MIN_MIN(BranchTbl tbl)
Select variable with smallest min.
Definition: var.hpp:186
SymmetryHandle ValueSequenceSymmetry(const IntArgs &vs, int ss)
Value sequences in v of size ss are interchangeable.
Definition: ldsb.cpp:102
Select greatest value not greater than the median.
Definition: int.hh:4796
BoolVarBranch BOOL_VAR_DEGREE_MIN(BranchTbl tbl)
Select variable with smallest degree.
Definition: var.hpp:384
void sqr(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition: arithmetic.cpp:95
Range * range
Pointer to all ranges.
Definition: int.hh:2252
IntAssign INT_ASSIGN_MAX(void)
Select largest value.
Definition: assign.hpp:65
Simple propagation levels.
Definition: int.hh:976
IntVarBranch INT_VAR_MERIT_MIN(IntBranchMerit bm, BranchTbl tbl)
Select variable with least merit according to branch merit function bm.
Definition: var.hpp:106
void extensional(Home home, const IntVarArgs &x, DFA dfa, IntPropLevel)
Post domain consistent propagator for extensional constraint described by a DFA.
Select random value.
Definition: int.hh:4943
Recording AFC information for integer variables.
Definition: int.hh:4213
BoolVarBranch BOOL_VAR_CHB_MAX(BoolCHB c, BranchTbl tbl)
Select variable with largest CHB Q-score.
Definition: var.hpp:444
IntValBranch INT_VAL_MIN(void)
Select smallest value.
Definition: val.hpp:55
Specification of a DFA transition.
Definition: int.hh:2057
void sqrt(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition: arithmetic.cpp:102
Use basic propagation algorithm.
Definition: int.hh:981
struct Gecode::@593::NNF::@62::@63 b
For binary nodes (and, or, eqv)
std::function< double(const Space &home, double w, double b)> BranchTbl
Tie-break limit function.
Definition: var.hpp:48
Value iterator from range iterator.
void wait(Home home, FloatVar x, std::function< void(Space &home)> c)
Execute c when x becomes assigned.
Definition: exec.cpp:39
Class for CHB management.
Definition: chb.hpp:46
With largest max.
Definition: int.hh:4526
unsigned int size(I &i)
Size of all ranges of range iterator i.
Reification specification.
Definition: int.hh:876
Value propagation.
Definition: int.hh:977
SymmetryHandle ValueSymmetry(const IntArgs &vs)
Values in v are interchangeable.
Definition: ldsb.cpp:81
IntValBranch INT_VAL_SPLIT_MAX(void)
Select values greater than mean of smallest and largest value.
Definition: val.hpp:80
void range(Home home, const IntVarArgs &x, SetVar y, SetVar z)
Post constraint .
Definition: minimodel.hh:2026
Range iterator for ranges of integer variable implementation.
Definition: var-imp.hpp:392
IntVarBranch INT_VAR_RND(Rnd r)
Select random variable (uniform distribution, for tie breaking)
Definition: var.hpp:101
void distinct(Home home, const IntVarArgs &x, IntPropLevel ipl)
Post propagator for for all .
Definition: distinct.cpp:46
With largest domain size.
Definition: int.hh:4528
Duplicate of an integer view.
int max
Maximum value.
Definition: int.hh:2205
Recording AFC information for Boolean variables.
Definition: int.hh:4253
bool overflow_add(int n, int m)
Check whether adding n and m would overflow.
Definition: limits.hpp:79
void argmax(Home home, const IntVarArgs &x, IntVar y, bool tiebreak, IntPropLevel)
Post propagator for .
Definition: arithmetic.cpp:110
Recording actions for Boolean variables.
Definition: int.hh:4344
Trace filters.
Definition: filter.hpp:133
BoolAssign BOOL_ASSIGN_RND(Rnd r)
Select random value.
Definition: assign.hpp:110
Integer set initialization.
Definition: int-set-1.hpp:53
BoolAssign BOOL_ASSIGN(BoolBranchVal v, BoolBranchCommit c)
Select value as defined by the value function v and commit function c.
Definition: assign.hpp:115
IntValBranch INT_VAL(IntBranchVal v, IntBranchCommit c)
Select value as defined by the value function v and commit function c Uses a commit function as defau...
Definition: val.hpp:95
Which Boolean variable to select for branching.
Definition: int.hh:4593
Select smallest value.
Definition: int.hh:4941
Less ( )
Definition: int.hh:929
Integer sets.
Definition: int.hh:174
int o_state
output state Default constructor
Definition: int.hh:2061
Post propagator for SetVar SetOpType SetVar SetRelType SetVar z
Definition: set.hh:767
IntVarBranch INT_VAR_AFC_MAX(double d, BranchTbl tbl)
Select variable with largest accumulated failure count with decay factor d.
Definition: var.hpp:136
std::function< bool(const Space &home, IntVar x, int i)> IntBranchFilter
Branch filter function type for integer variables.
Definition: int.hh:4113
Use advanced propagation algorithm.
Definition: int.hh:982
std::ostream & os
Output stream to use.
Definition: int.hh:5512
BitSetData * s
Begin of supports.
Definition: int.hh:2207
With largest CHB Q-score divided by domain size.
Definition: int.hh:4536
static StdIntTracer def
Default tracer (printing to std::cerr)
Definition: int.hh:5490
Recording CHB for integer variables.
Definition: int.hh:4395
Reify eqv(BoolVar x)
Use equivalence for reification.
Definition: reify.hpp:69
Disjunction.
Definition: int.hh:952
With largest degree divided by domain size.
Definition: int.hh:4530
Passing integer variables.
Definition: int.hh:656
SharedArray< int > IntSharedArray
Arrays of integers that can be shared among several element constraints.
Definition: int.hh:1476
ViewTracer< Int::BoolView > BoolTracer
Tracer for Boolean variables.
Definition: int.hh:5498
Passing integer arguments.
Definition: int.hh:628
Passing Boolean variables.
Definition: int.hh:712
Select values greater than mean of smallest and largest value.
Definition: int.hh:4800
With highest action.
Definition: int.hh:4520
With smallest CHB Q-score divided by domain size.
Definition: int.hh:4535
With largest degree.
Definition: int.hh:4516
std::function< int(const Space &home, BoolVar x, int i)> BoolBranchVal
Branch value function type for Boolean variables.
Definition: int.hh:4171
void nooverlap(Home home, const IntVarArgs &x, const IntArgs &w, const IntVarArgs &y, const IntArgs &h, IntPropLevel)
Post propagator for rectangle packing.
Definition: no-overlap.cpp:51
Boolean variable array.
Definition: int.hh:808
union Gecode::@593::NNF::@62 u
Union depending on nodetype t.
Boolean integer variables.
Definition: int.hh:512
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:4489
Post propagator for SetVar SetOpType SetVar SetRelType r
Definition: set.hh:767
const int v[7]
Definition: distinct.cpp:259
Propagator for recording view trace information.
Definition: recorder.hpp:59
Class represeting a set of tuples.
Definition: int.hh:2190
IntVarBranch INT_VAR_DEGREE_MIN(BranchTbl tbl)
Select variable with smallest degree.
Definition: var.hpp:116
TieBreak< VarBranch > tiebreak(VarBranch a, VarBranch b)
Combine variable selection criteria a and b for tie-breaking.
Definition: tiebreak.hpp:80
With smallest degree divided by domain size.
Definition: int.hh:4529
With smallest max.
Definition: int.hh:4525
IntValBranch INT_VAL_MAX(void)
Select largest value.
Definition: val.hpp:65
IntVarBranch INT_VAR_CHB_MIN(IntCHB c, BranchTbl tbl)
Select variable with lowest CHB Q-score.
Definition: var.hpp:166
IntPropLevel
Propagation levels for integer propagators.
Definition: int.hh:974
IntPropLevel ba(IntPropLevel ipl)
Extract basic or advanced from propagation level.
Definition: ipl.hpp:43
IntVarBranch INT_VAR_SIZE_MIN(BranchTbl tbl)
Select variable with smallest domain size.
Definition: var.hpp:206
Post propagator for f(x \diamond_{\mathit{op}} y) \sim_r z \f$ void rel(Home home
bool operator!=(const CachedView< View > &x, const CachedView< View > &y)
Definition: cached.hpp:406
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:4802
Post propagator for SetVar SetOpType SetVar y
Definition: set.hh:767
Value branching information.
Definition: val.hpp:41
Trace done events.
Definition: recorder.hpp:47
BoolVarBranch BOOL_VAR_AFC_MAX(double d, BranchTbl tbl)
Select variable with largest accumulated failure count with decay factor d.
Definition: var.hpp:404
void div(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition: arithmetic.cpp:127
void relax(Home home, const FloatVarArgs &x, const FloatVarArgs &sx, Rnd r, double p)
Definition: relax.cpp:57
IntValBranch INT_VALUES_MIN(void)
Try all values starting from smallest.
Definition: val.hpp:100
Variable branching information.
Definition: var.hpp:55
std::function< bool(const Space &home, BoolVar x, int i)> BoolBranchFilter
Branch filter function type for Boolean variables.
Definition: int.hh:4123
bool overflow_sub(int n, int m)
Check whether subtracting m from n would overflow.
Definition: limits.hpp:93
Select values not greater than mean of smallest and largest value.
Definition: int.hh:4799
BoolVarBranch BOOL_VAR_DEGREE_MAX(BranchTbl tbl)
Select variable with largest degree.
Definition: var.hpp:389
Generic domain change information to be supplied to advisors.
Definition: core.hpp:203
With highest CHB Q-score.
Definition: int.hh:4522
IntVarBranch INT_VAR_MIN_MAX(BranchTbl tbl)
Select variable with largest min.
Definition: var.hpp:191
IntValBranch INT_VALUES_MAX(void)
Try all values starting from largest.
Definition: val.hpp:105
Select
Which value selection.
Definition: int.hh:4829
void precede(Home home, const IntVarArgs &x, int s, int t, IntPropLevel)
Post propagator that s precedes t in x.
Definition: precede.cpp:43
Integer variables.
Definition: int.hh:371
With lowest CHB Q-score.
Definition: int.hh:4521
IntVarBranch INT_VAR_ACTION_MIN(double d, BranchTbl tbl)
Select variable with lowest action with decay factor d.
Definition: var.hpp:146
Select random value.
Definition: int.hh:4798
BoolVarBranch BOOL_VAR_ACTION_MAX(double d, BranchTbl tbl)
Select variable with highest action with decay factor d.
Definition: var.hpp:424
IntVarBranch INT_VAR_AFC_SIZE_MIN(double d, BranchTbl tbl)
Select variable with smallest accumulated failure count divided by domain size with decay factor d...
Definition: var.hpp:226
Which values to select for assignment.
Definition: int.hh:4908
int n_tuples
Number of Tuples.
Definition: int.hh:2238
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
Definition: rel.cpp:43
Trace delta information for integer variables.
Definition: int.hh:5398
SymmetryHandle values_reflect(int lower, int upper)
The values from lower to upper (inclusive) can be reflected.
Definition: ldsb.cpp:106
IntVarBranch INT_VAR_REGRET_MAX_MIN(BranchTbl tbl)
Select variable with smallest max-regret.
Definition: var.hpp:296
Sort ranges according to increasing minimum.
Definition: int-set.cpp:80
Domain propagation Options: basic versus advanced propagation.
Definition: int.hh:979
Date item for bitsets.
Definition: bitset-base.hpp:65
Select
Which variable selection.
Definition: int.hh:4510
bool valid(int n)
Return whether n is in range.
Definition: limits.hpp:37
Value iterator for integer sets.
Definition: int.hh:333
Equivalence.
Definition: int.hh:954
IntValBranch INT_VAL_MED(void)
Select greatest value not greater than the median.
Definition: val.hpp:60
With smallest action divided by domain size.
Definition: int.hh:4533
IntVarBranch INT_VAR_ACTION_SIZE_MIN(double d, BranchTbl tbl)
Select variable with smallest action divided by domain size with decay factor d.
Definition: var.hpp:246
Data stored for a DFA.
Definition: dfa.hpp:42
IntVarBranch INT_VAR_MAX_MIN(BranchTbl tbl)
Select variable with smallest max.
Definition: var.hpp:196
Iterator for DFA transitions (sorted by symbols)
Definition: int.hh:2068
Int::LDSB::SymmetryObject * ref
Symmetry object that this handle refers to.
Definition: int.hh:5128
IntVarBranch INT_VAR_REGRET_MAX_MAX(BranchTbl tbl)
Select variable with largest max-regret.
Definition: var.hpp:301
Random (uniform, for tie breaking)
Definition: int.hh:4512
Select
Which variable selection.
Definition: int.hh:4596
With largest degree.
Definition: int.hh:4602
Trace fail events.
Definition: recorder.hpp:46
With smallest domain size.
Definition: int.hh:4527
Post propagator for SetVar x
Definition: set.hh:767
Trace fixpoint events.
Definition: recorder.hpp:45
std::ostream & os
Output stream to use.
Definition: int.hh:5474
Select
Which value selection.
Definition: int.hh:4794
BoolVarBranch BOOL_VAR_RND(Rnd r)
Select random variable (uniform distribution, for tie breaking)
Definition: var.hpp:369
std::function< void(const Space &home, const Brancher &b, unsigned int a, BoolVar x, int i, const int &n, std::ostream &o)> BoolVarValPrint
Function type for printing branching alternatives for Boolean variables.
Definition: int.hh:4496
IntVarBranch INT_VAR_CHB_MAX(IntCHB c, BranchTbl tbl)
Select variable with largest CHB Q-score.
Definition: var.hpp:176
Recording CHB for Boolean variables.
Definition: int.hh:4439
Select greatest value not greater than the median.
Definition: int.hh:4913
static StdBoolTracer def
Default tracer (printing to std::cerr)
Definition: int.hh:5528
void trace(Home home, const FloatVarArgs &x, TraceFilter tf, int te, FloatTracer &t)
Create a tracer for float variables.
Definition: trace.cpp:39
ViewTraceRecorder< Int::BoolView > BoolTraceRecorder
Trace recorder for Boolean variables.
Definition: int.hh:5503
SymmetryHandle VariableSequenceSymmetry(const IntVarArgs &vars, int ss)
Variable sequences in x of size ss are interchangeable.
Definition: ldsb.cpp:90
const long long int llmax
Largest allowed long long integer value.
Definition: int.hh:122
With highest merit.
Definition: int.hh:4514
Traits of arrays in Gecode.
Definition: array.hpp:76
Gecode::Support::BitSetData BitSetData
Import bit set data type.
Definition: int.hh:2198
IntValBranch INT_VAL_SPLIT_MIN(void)
Select values not greater than mean of smallest and largest value.
Definition: val.hpp:75
With largest min.
Definition: int.hh:4524
BoolValBranch BOOL_VAL(BoolBranchVal v, BoolBranchCommit c)
Select value as defined by the value function v and commit function c Uses a commit function as defau...
Definition: val.hpp:145
Gecode toplevel namespace
Argument array for variables.
Definition: array.hpp:61
const Range * l
Last range.
Definition: int.hh:2363
With highest merit.
Definition: int.hh:4600
Implication for reification.
Definition: int.hh:862
Class for action management.
Definition: action.hpp:42
BoolVarBranch BOOL_VAR_CHB_MIN(BoolCHB c, BranchTbl tbl)
Select variable with lowest CHB Q-score.
Definition: var.hpp:434
#define GECODE_VTABLE_EXPORT
Definition: support.hh:72
Range iterator for computing set difference.
Definition: ranges-diff.hpp:43
Disequality ( )
Definition: int.hh:927
BoolVar x
The Boolean control variable.
Definition: int.hh:879
int min
Minimum value.
Definition: int.hh:2203
BoolVarBranch BOOL_VAR_MERIT_MAX(BoolBranchMerit bm, BranchTbl tbl)
Select variable with highest merit according to branch merit function bm.
Definition: var.hpp:379
Random number generator.
Definition: rnd.hpp:42
Select largest value.
Definition: int.hh:4797
IntVarBranch INT_VAR_DEGREE_SIZE_MIN(BranchTbl tbl)
Select variable with smallest degree divided by domain size.
Definition: var.hpp:216
Data about values in the table.
Definition: int.hh:2215
unsigned int n
Number of ranges.
Definition: int.hh:2218
#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:354
void assign(Home home, const FloatVarArgs &x, FloatAssign fa, FloatBranchFilter bf, FloatVarValPrint vvp)
Assign all x with value selection vals.
Definition: branch.cpp:111
void check(int n, const char *l)
Check whether n is in range, otherwise throw out of limits with information l.
Definition: limits.hpp:46
Home class for posting propagators
Definition: core.hpp:853
double tbl(const Gecode::Space &, double w, double b)
Test function for tie-break limit function.
Definition: branch.cpp:61
Data stored for a Table.
Definition: int.hh:2228
std::function< double(const Space &home, IntVar x, int i)> IntBranchMerit
Branch merit function type for integer variables.
Definition: int.hh:4135
ReifyMode
Mode for reification.
Definition: int.hh:848
Select value according to user-defined functions.
Definition: int.hh:4803
int max
Largest value.
Definition: int.hh:2244
ReifyMode rm
The reification mode.
Definition: int.hh:881
void positive(int n, const char *l)
Check whether n is in range and strictly positive, otherwise throw out of limits with information l...
Definition: limits.hpp:57
Trace delta information for Boolean variables.
Definition: int.hh:5418
void unary(Home home, const IntVarArgs &s, const IntArgs &p, IntPropLevel ipl)
Post propagators for scheduling tasks on unary resources.
Definition: unary.cpp:44
struct Gecode::@593::NNF::@62::@64 a
For atomic nodes.
void ite(Home home, BoolVar b, FloatVar x, FloatVar y, FloatVar z)
Post propagator for if-then-else constraint.
Definition: bool.cpp:39
Recording actions for integer variables.
Definition: int.hh:4299
Select largest value.
Definition: int.hh:4831
Range information.
Definition: int.hh:2200
Select largest value.
Definition: int.hh:4914
int delta
Delta information.
Definition: int.hh:5421
void element(Home home, IntSharedArray c, IntVar x0, IntVar x1, IntPropLevel)
Post domain consistent propagator for .
Definition: element.cpp:39
void when(Home home, BoolVar x, std::function< void(Space &home)> t, std::function< void(Space &home)> e, IntPropLevel)
Execute t (then) when x is assigned one, and e (else) otherwise.
Definition: exec.cpp:70
std::function< void(Space &home, unsigned int a, BoolVar x, int i, int n)> BoolBranchCommit
Branch commit function type for Boolean variables.
Definition: int.hh:4200
IntVarBranch INT_VAR_ACTION_SIZE_MAX(double d, BranchTbl tbl)
Select variable with largest action divided by domain size with decay factor d.
Definition: var.hpp:256
Select all values starting from smallest.
Definition: int.hh:4804
With smallest accumulated failure count divided by domain size.
Definition: int.hh:4531
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:904
Equivalence for reification (default)
Definition: int.hh:855
IntRelType swap(IntRelType irt)
Return swapped relation type of irt.
Definition: irt.hpp:37
Reify pmi(BoolVar x)
Use reverse implication for reification.
Definition: reify.hpp:77
Boolean view for Boolean variables.
Definition: view.hpp:1380
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.