Generated on Sat Jan 20 2018 22:21:13 for Gecode by doxygen 1.8.13
int.hh
Go to the documentation of this file.
1 /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2 /*
3  * Main authors:
4  * Christian Schulte <schulte@gecode.org>
5  * Guido Tack <tack@gecode.org>
6  *
7  * Contributing authors:
8  * Stefano Gualandi <stefano.gualandi@gmail.com>
9  * Mikael Lagerkvist <lagerkvist@gecode.org>
10  * David Rijsman <David.Rijsman@quintiq.com>
11  *
12  * Copyright:
13  * Stefano Gualandi, 2013
14  * Mikael Lagerkvist, 2006
15  * David Rijsman, 2009
16  * Christian Schulte, 2002
17  * Guido Tack, 2004
18  *
19  * Last modified:
20  * $Date: 2017-04-01 20:27:10 +0200 (Sat, 01 Apr 2017) $ by $Author: schulte $
21  * $Revision: 15623 $
22  *
23  * This file is part of Gecode, the generic constraint
24  * development environment:
25  * http://www.gecode.org
26  *
27  * Permission is hereby granted, free of charge, to any person obtaining
28  * a copy of this software and associated documentation files (the
29  * "Software"), to deal in the Software without restriction, including
30  * without limitation the rights to use, copy, modify, merge, publish,
31  * distribute, sublicense, and/or sell copies of the Software, and to
32  * permit persons to whom the Software is furnished to do so, subject to
33  * the following conditions:
34  *
35  * The above copyright notice and this permission notice shall be
36  * included in all copies or substantial portions of the Software.
37  *
38  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
39  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
40  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
41  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
42  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
43  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
44  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
45  *
46  */
47 
48 #ifndef __GECODE_INT_HH__
49 #define __GECODE_INT_HH__
50 
51 #include <climits>
52 #include <cfloat>
53 #include <iostream>
54 
55 #include <vector>
56 
57 #include <functional>
58 
59 #include <gecode/kernel.hh>
60 #include <gecode/search.hh>
61 #include <gecode/iter.hh>
62 
63 /*
64  * Configure linking
65  *
66  */
67 #if !defined(GECODE_STATIC_LIBS) && \
68  (defined(__CYGWIN__) || defined(__MINGW32__) || defined(_MSC_VER))
69 
70 #ifdef GECODE_BUILD_INT
71 #define GECODE_INT_EXPORT __declspec( dllexport )
72 #else
73 #define GECODE_INT_EXPORT __declspec( dllimport )
74 #endif
75 
76 #else
77 
78 #ifdef GECODE_GCC_HAS_CLASS_VISIBILITY
79 #define GECODE_INT_EXPORT __attribute__ ((visibility("default")))
80 #else
81 #define GECODE_INT_EXPORT
82 #endif
83 
84 #endif
85 
86 // Configure auto-linking
87 #ifndef GECODE_BUILD_INT
88 #define GECODE_LIBRARY_NAME "Int"
90 #endif
91 
103 #include <gecode/int/exception.hpp>
104 
105 namespace Gecode { namespace Int {
106 
114  namespace Limits {
116  const int max = INT_MAX - 1;
118  const int min = -max;
120  const int infinity = max + 1;
122  const long long int llmax = LLONG_MAX - 1;
124  const long long int llmin = -llmax;
126  const long long int llinfinity = llmax + 1;
128  bool valid(int n);
130  bool valid(long long int n);
132  void check(int n, const char* l);
134  void check(long long int n, const char* l);
136  void positive(int n, const char* l);
138  void positive(long long int n, const char* l);
140  void nonnegative(int n, const char* l);
142  void nonnegative(long long int n, const char* l);
144  bool overflow_add(int n, int m);
146  bool overflow_add(long long int n, long long int m);
148  bool overflow_sub(int n, int m);
150  bool overflow_sub(long long int n, long long int m);
152  bool overflow_mul(int n, int m);
154  bool overflow_mul(long long int n, long long int m);
155  }
156 
157 }}
158 
159 #include <gecode/int/limits.hpp>
160 
161 namespace Gecode {
162 
163  class IntSetRanges;
164 
165  template<class I> class IntSetInit;
166 
174  class IntSet : public SharedHandle {
175  friend class IntSetRanges;
176  template<class I> friend class IntSetInit;
177  private:
179  class Range {
180  public:
181  int min, max;
182  };
183  class IntSetObject : public SharedHandle::Object {
184  public:
186  unsigned int size;
188  int n;
190  Range* r;
192  GECODE_INT_EXPORT static IntSetObject* allocate(int m);
194  GECODE_INT_EXPORT SharedHandle::Object* copy(void) const;
196  GECODE_INT_EXPORT bool in(int n) 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);
235 
237 
238  int ranges(void) const;
241  int min(int i) const;
243  int max(int i) const;
245  unsigned int width(int i) const;
247 
249 
250  bool in(int n) const;
253  unsigned int size(void) const;
255  unsigned int width(void) const;
257  int min(void) const;
259  int max(void) const;
261 
263 
264  GECODE_INT_EXPORT static const IntSet empty;
267  };
268 
274  class IntSetRanges {
275  private:
277  const IntSet::Range* i;
279  const IntSet::Range* e;
280  public:
282 
283  IntSetRanges(void);
286  IntSetRanges(const IntSet& s);
288  void init(const IntSet& s);
290 
292 
293  bool operator ()(void) const;
296  void operator ++(void);
298 
300 
301  int min(void) const;
304  int max(void) const;
306  unsigned int width(void) const;
308  };
309 
315  class IntSetValues : public Iter::Ranges::ToValues<IntSetRanges> {
316  public:
318 
319  IntSetValues(void);
322  IntSetValues(const IntSet& s);
324  void init(const IntSet& s);
326  };
327 
332  template<class Char, class Traits>
333  std::basic_ostream<Char,Traits>&
334  operator <<(std::basic_ostream<Char,Traits>& os, const IntSet& s);
335 
336 }
337 
338 #include <gecode/int/int-set-1.hpp>
339 
340 #include <gecode/int/var-imp.hpp>
341 
342 namespace Gecode {
343 
344  namespace Int {
345  class IntView;
346  }
347 
353  class IntVar : public VarImpVar<Int::IntVarImp> {
354  friend class IntVarArray;
355  friend class IntVarArgs;
356  private:
364  void _init(Space& home, int min, int max);
371  void _init(Space& home, const IntSet& d);
372  public:
374 
375  IntVar(void);
378  IntVar(const IntVar& y);
380  IntVar(const Int::IntView& y);
392  GECODE_INT_EXPORT IntVar(Space& home, int min, int max);
404  GECODE_INT_EXPORT IntVar(Space& home, const IntSet& d);
406 
408 
409  int min(void) const;
412  int max(void) const;
414  int med(void) const;
422  int val(void) const;
423 
425  unsigned int size(void) const;
427  unsigned int width(void) const;
429  unsigned int regret_min(void) const;
431  unsigned int regret_max(void) const;
433 
435 
436  bool range(void) const;
439  bool in(int n) const;
441  };
442 
447  template<class Char, class Traits>
448  std::basic_ostream<Char,Traits>&
449  operator <<(std::basic_ostream<Char,Traits>& os, const IntVar& x);
450 
456  public:
458 
459  IntVarRanges(void);
462  IntVarRanges(const IntVar& x);
464  void init(const IntVar& x);
466  };
467 
472  class IntVarValues : public Iter::Ranges::ToValues<IntVarRanges> {
473  public:
475 
476  IntVarValues(void);
479  IntVarValues(const IntVar& x);
481  void init(const IntVar& x);
483  };
484 
485  namespace Int {
486  class BoolView;
487  }
488 
494  class BoolVar : public VarImpVar<Int::BoolVarImp> {
495  friend class BoolVarArray;
496  friend class BoolVarArgs;
497  private:
505  void _init(Space& home, int min, int max);
506  public:
508 
509  BoolVar(void);
512  BoolVar(const BoolVar& y);
514  BoolVar(const Int::BoolView& y);
526  GECODE_INT_EXPORT BoolVar(Space& home, int min, int max);
528 
530 
531  int min(void) const;
534  int max(void) const;
536  int med(void) const;
544  int val(void) const;
545 
547  unsigned int size(void) const;
549  unsigned int width(void) const;
551  unsigned int regret_min(void) const;
553  unsigned int regret_max(void) const;
555 
557 
558  bool range(void) const;
561  bool in(int n) const;
563 
565 
566  bool zero(void) const;
569  bool one(void) const;
571  bool none(void) const;
573  };
574 
579  template<class Char, class Traits>
580  std::basic_ostream<Char,Traits>&
581  operator <<(std::basic_ostream<Char,Traits>& os, const BoolVar& x);
582 
583 }
584 
585 
586 #include <gecode/int/view.hpp>
587 #include <gecode/int/propagator.hpp>
588 
589 namespace Gecode {
590 
602 
603 }
604 
606 
607 namespace Gecode {
608 
610  class IntArgs : public PrimArgArray<int> {
611  public:
613 
614  IntArgs(void);
617  explicit IntArgs(int n);
619  IntArgs(const SharedArray<int>& x);
621  IntArgs(const std::vector<int>& x);
623  template<class InputIterator>
624  IntArgs(InputIterator first, InputIterator last);
627  IntArgs(int n, int e0, ...);
629  IntArgs(int n, const int* e);
631  IntArgs(const PrimArgArray<int>& a);
632 
634  static IntArgs create(int n, int start, int inc=1);
636  };
637 
639  class IntVarArgs : public VarArgArray<IntVar> {
640  public:
642 
643  IntVarArgs(void) {}
646  explicit IntVarArgs(int n) : VarArgArray<IntVar>(n) {}
652  IntVarArgs(const std::vector<IntVar>& a) : VarArgArray<IntVar>(a) {}
654  template<class InputIterator>
655  IntVarArgs(InputIterator first, InputIterator last)
656  : VarArgArray<IntVar>(first,last) {}
669  IntVarArgs(Space& home, int n, int min, int max);
682  IntVarArgs(Space& home, int n, const IntSet& s);
684  };
693  class BoolVarArgs : public VarArgArray<BoolVar> {
694  public:
696 
697  BoolVarArgs(void) {}
700  explicit BoolVarArgs(int n) : VarArgArray<BoolVar>(n) {}
705  : VarArgArray<BoolVar>(a) {}
707  BoolVarArgs(const std::vector<BoolVar>& a) : VarArgArray<BoolVar>(a) {}
709  template<class InputIterator>
710  BoolVarArgs(InputIterator first, InputIterator last)
711  : VarArgArray<BoolVar>(first,last) {}
724  BoolVarArgs(Space& home, int n, int min, int max);
726  };
728 
744  class IntVarArray : public VarArray<IntVar> {
745  public:
747 
748  IntVarArray(void);
751  IntVarArray(Space& home, int n);
753  IntVarArray(const IntVarArray& a);
755  IntVarArray(Space& home, const IntVarArgs& a);
768  IntVarArray(Space& home, int n, int min, int max);
781  IntVarArray(Space& home, int n, const IntSet& s);
783  };
784 
789  class BoolVarArray : public VarArray<BoolVar> {
790  public:
792 
793  BoolVarArray(void);
796  BoolVarArray(Space& home, int n);
798  BoolVarArray(const BoolVarArray& a);
800  BoolVarArray(Space& home, const BoolVarArgs& a);
813  BoolVarArray(Space& home, int n, int min, int max);
815  };
816 
817 }
818 
819 #include <gecode/int/int-set-2.hpp>
820 
821 #include <gecode/int/array.hpp>
822 
823 namespace Gecode {
824 
829  enum ReifyMode {
851  };
852 
857  class Reify {
858  protected:
863  public:
865  Reify(void);
867  Reify(BoolVar x, ReifyMode rm=RM_EQV);
869  BoolVar var(void) const;
871  ReifyMode mode(void) const;
873  void var(BoolVar x);
875  void mode(ReifyMode rm);
876  };
877 
882  Reify eqv(BoolVar x);
883 
888  Reify imp(BoolVar x);
889 
894  Reify pmi(BoolVar x);
895 
896 }
897 
898 #include <gecode/int/reify.hpp>
899 
900 namespace Gecode {
901 
906  enum IntRelType {
913  };
914 
917 
920 
921 }
922 
923 #include <gecode/int/irt.hpp>
924 
925 namespace Gecode {
926 
931  enum BoolOpType {
937  };
938 
957  IPL_DEF = 0,
958  IPL_VAL = 1,
959  IPL_BND = 2,
960  IPL_DOM = 3,
961  IPL_SPEED = 4,
964  IPL_BASIC = 16,
968  };
969 
972 
975 
978 
979 }
980 
981 #include <gecode/int/ipl.hpp>
982 
983 namespace Gecode {
984 
990  enum TaskType {
991  TT_FIXP, //< Task with fixed processing time
992  TT_FIXS, //< Task with fixed start time
993  TT_FIXE //< Task with fixed end time
994  };
995 
1002 
1004  template<>
1006  public:
1007  typedef TaskTypeArgs StorageType;
1009  typedef TaskTypeArgs ArgsType;
1010  };
1011 
1012 
1020  GECODE_INT_EXPORT void
1022  dom(Home home, IntVar x, int n,
1023  IntPropLevel ipl=IPL_DEF);
1025  GECODE_INT_EXPORT void
1026  dom(Home home, const IntVarArgs& x, int n,
1027  IntPropLevel ipl=IPL_DEF);
1028 
1030  GECODE_INT_EXPORT void
1031  dom(Home home, IntVar x, int l, int m,
1032  IntPropLevel ipl=IPL_DEF);
1034  GECODE_INT_EXPORT void
1035  dom(Home home, const IntVarArgs& x, int l, int m,
1036  IntPropLevel ipl=IPL_DEF);
1037 
1039  GECODE_INT_EXPORT void
1040  dom(Home home, IntVar x, const IntSet& s,
1041  IntPropLevel ipl=IPL_DEF);
1043  GECODE_INT_EXPORT void
1044  dom(Home home, const IntVarArgs& x, const IntSet& s,
1045  IntPropLevel ipl=IPL_DEF);
1046 
1048  GECODE_INT_EXPORT void
1049  dom(Home home, IntVar x, int n, Reify r,
1050  IntPropLevel ipl=IPL_DEF);
1052  GECODE_INT_EXPORT void
1053  dom(Home home, IntVar x, int l, int m, Reify r,
1054  IntPropLevel ipl=IPL_DEF);
1056  GECODE_INT_EXPORT void
1057  dom(Home home, IntVar x, const IntSet& s, Reify r,
1058  IntPropLevel ipl=IPL_DEF);
1059 
1061  GECODE_INT_EXPORT void
1062  dom(Home home, IntVar x, IntVar d,
1063  IntPropLevel ipl=IPL_DEF);
1065  GECODE_INT_EXPORT void
1066  dom(Home home, BoolVar x, BoolVar d,
1067  IntPropLevel ipl=IPL_DEF);
1069  GECODE_INT_EXPORT void
1070  dom(Home home, const IntVarArgs& x, const IntVarArgs& d,
1071  IntPropLevel ipl=IPL_DEF);
1073  GECODE_INT_EXPORT void
1074  dom(Home home, const BoolVarArgs& x, const BoolVarArgs& d,
1075  IntPropLevel ipl=IPL_DEF);
1077 
1078 
1089  GECODE_INT_EXPORT void
1090  rel(Home home, IntVar x0, IntRelType irt, IntVar x1,
1091  IntPropLevel ipl=IPL_DEF);
1098  GECODE_INT_EXPORT void
1099  rel(Home home, const IntVarArgs& x, IntRelType irt, IntVar y,
1100  IntPropLevel ipl=IPL_DEF);
1104  GECODE_INT_EXPORT void
1105  rel(Home home, IntVar x, IntRelType irt, int c,
1106  IntPropLevel ipl=IPL_DEF);
1110  GECODE_INT_EXPORT void
1111  rel(Home home, const IntVarArgs& x, IntRelType irt, int c,
1112  IntPropLevel ipl=IPL_DEF);
1119  GECODE_INT_EXPORT void
1120  rel(Home home, IntVar x0, IntRelType irt, IntVar x1, Reify r,
1121  IntPropLevel ipl=IPL_DEF);
1128  GECODE_INT_EXPORT void
1129  rel(Home home, IntVar x, IntRelType irt, int c, Reify r,
1130  IntPropLevel ipl=IPL_DEF);
1145  GECODE_INT_EXPORT void
1146  rel(Home home, const IntVarArgs& x, IntRelType irt,
1147  IntPropLevel ipl=IPL_DEF);
1162  GECODE_INT_EXPORT void
1163  rel(Home home, const IntVarArgs& x, IntRelType irt, const IntVarArgs& y,
1164  IntPropLevel ipl=IPL_DEF);
1178  GECODE_INT_EXPORT void
1179  rel(Home home, const IntVarArgs& x, IntRelType irt, const IntArgs& y,
1180  IntPropLevel ipl=IPL_DEF);
1194  GECODE_INT_EXPORT void
1195  rel(Home home, const IntArgs& x, IntRelType irt, const IntVarArgs& y,
1196  IntPropLevel ipl=IPL_DEF);
1197 
1205  GECODE_INT_EXPORT void
1206  rel(Home home, BoolVar x0, IntRelType irt, BoolVar x1,
1207  IntPropLevel ipl=IPL_DEF);
1211  GECODE_INT_EXPORT void
1212  rel(Home home, BoolVar x0, IntRelType irt, BoolVar x1, Reify r,
1213  IntPropLevel ipl=IPL_DEF);
1217  GECODE_INT_EXPORT void
1218  rel(Home home, const BoolVarArgs& x, IntRelType irt, BoolVar y,
1219  IntPropLevel ipl=IPL_DEF);
1227  GECODE_INT_EXPORT void
1228  rel(Home home, BoolVar x, IntRelType irt, int n,
1229  IntPropLevel ipl=IPL_DEF);
1237  GECODE_INT_EXPORT void
1238  rel(Home home, BoolVar x, IntRelType irt, int n, Reify r,
1239  IntPropLevel ipl=IPL_DEF);
1247  GECODE_INT_EXPORT void
1248  rel(Home home, const BoolVarArgs& x, IntRelType irt, int n,
1249  IntPropLevel ipl=IPL_DEF);
1262  GECODE_INT_EXPORT void
1263  rel(Home home, const BoolVarArgs& x, IntRelType irt, const BoolVarArgs& y,
1264  IntPropLevel ipl=IPL_DEF);
1277  GECODE_INT_EXPORT void
1278  rel(Home home, const BoolVarArgs& x, IntRelType irt, const IntArgs& y,
1279  IntPropLevel ipl=IPL_DEF);
1292  GECODE_INT_EXPORT void
1293  rel(Home home, const IntArgs& x, IntRelType irt, const BoolVarArgs& y,
1294  IntPropLevel ipl=IPL_DEF);
1305  GECODE_INT_EXPORT void
1306  rel(Home home, const BoolVarArgs& x, IntRelType irt,
1307  IntPropLevel ipl=IPL_DEF);
1313  GECODE_INT_EXPORT void
1314  rel(Home home, BoolVar x0, BoolOpType o, BoolVar x1, BoolVar x2,
1315  IntPropLevel ipl=IPL_DEF);
1324  GECODE_INT_EXPORT void
1325  rel(Home home, BoolVar x0, BoolOpType o, BoolVar x1, int n,
1326  IntPropLevel ipl=IPL_DEF);
1336  GECODE_INT_EXPORT void
1337  rel(Home home, BoolOpType o, const BoolVarArgs& x, BoolVar y,
1338  IntPropLevel ipl=IPL_DEF);
1351  GECODE_INT_EXPORT void
1352  rel(Home home, BoolOpType o, const BoolVarArgs& x, int n,
1353  IntPropLevel ipl=IPL_DEF);
1364  GECODE_INT_EXPORT void
1365  clause(Home home, BoolOpType o, const BoolVarArgs& x, const BoolVarArgs& y,
1366  BoolVar z, IntPropLevel ipl=IPL_DEF);
1380  GECODE_INT_EXPORT void
1381  clause(Home home, BoolOpType o, const BoolVarArgs& x, const BoolVarArgs& y,
1382  int n, IntPropLevel ipl=IPL_DEF);
1392  GECODE_INT_EXPORT void
1393  ite(Home home, BoolVar b, IntVar x, IntVar y, IntVar z,
1394  IntPropLevel ipl=IPL_DEF);
1401  GECODE_INT_EXPORT void
1402  ite(Home home, BoolVar b, BoolVar x, BoolVar y, BoolVar z,
1403  IntPropLevel ipl=IPL_DEF);
1404 
1405 
1417  GECODE_INT_EXPORT void
1418  precede(Home home, const IntVarArgs& x, int s, int t,
1427  GECODE_INT_EXPORT void
1428  precede(Home home, const IntVarArgs& x, const IntArgs& c,
1430 
1431 
1437  GECODE_INT_EXPORT void
1439  member(Home home, const IntVarArgs& x, IntVar y,
1440  IntPropLevel ipl=IPL_DEF);
1442  GECODE_INT_EXPORT void
1443  member(Home home, const BoolVarArgs& x, BoolVar y,
1444  IntPropLevel ipl=IPL_DEF);
1446  GECODE_INT_EXPORT void
1447  member(Home home, const IntVarArgs& x, IntVar y, Reify r,
1448  IntPropLevel ipl=IPL_DEF);
1450  GECODE_INT_EXPORT void
1451  member(Home home, const BoolVarArgs& x, BoolVar y, Reify r,
1452  IntPropLevel ipl=IPL_DEF);
1454 
1455 
1469  GECODE_INT_EXPORT void
1470  element(Home home, IntSharedArray n, IntVar x0, IntVar x1,
1471  IntPropLevel ipl=IPL_DEF);
1477  GECODE_INT_EXPORT void
1478  element(Home home, IntSharedArray n, IntVar x0, BoolVar x1,
1479  IntPropLevel ipl=IPL_DEF);
1485  GECODE_INT_EXPORT void
1486  element(Home home, IntSharedArray n, IntVar x0, int x1,
1487  IntPropLevel ipl=IPL_DEF);
1493  GECODE_INT_EXPORT void
1494  element(Home home, const IntVarArgs& x, IntVar y0, IntVar y1,
1495  IntPropLevel ipl=IPL_DEF);
1501  GECODE_INT_EXPORT void
1502  element(Home home, const IntVarArgs& x, IntVar y0, int y1,
1503  IntPropLevel ipl=IPL_DEF);
1505  GECODE_INT_EXPORT void
1506  element(Home home, const BoolVarArgs& x, IntVar y0, BoolVar y1,
1507  IntPropLevel ipl=IPL_DEF);
1509  GECODE_INT_EXPORT void
1510  element(Home home, const BoolVarArgs& x, IntVar y0, int y1,
1511  IntPropLevel ipl=IPL_DEF);
1512 
1525  GECODE_INT_EXPORT void
1526  element(Home home, IntSharedArray a,
1527  IntVar x, int w, IntVar y, int h, IntVar z,
1528  IntPropLevel ipl=IPL_DEF);
1541  GECODE_INT_EXPORT void
1542  element(Home home, IntSharedArray a,
1543  IntVar x, int w, IntVar y, int h, BoolVar z,
1544  IntPropLevel ipl=IPL_DEF);
1560  GECODE_INT_EXPORT void
1561  element(Home home, const IntVarArgs& a,
1562  IntVar x, int w, IntVar y, int h, IntVar z,
1563  IntPropLevel ipl=IPL_DEF);
1576  GECODE_INT_EXPORT void
1577  element(Home home, const BoolVarArgs& a,
1578  IntVar x, int w, IntVar y, int h, BoolVar z,
1579  IntPropLevel ipl=IPL_DEF);
1581 
1582 
1597  GECODE_INT_EXPORT void
1598  distinct(Home home, const IntVarArgs& x,
1599  IntPropLevel ipl=IPL_DEF);
1612  GECODE_INT_EXPORT void
1613  distinct(Home home, const IntArgs& n, const IntVarArgs& x,
1614  IntPropLevel ipl=IPL_DEF);
1629  GECODE_INT_EXPORT void
1630  distinct(Home home, const BoolVarArgs& b, const IntVarArgs& x,
1631  IntPropLevel ipl=IPL_DEF);
1644  GECODE_INT_EXPORT void
1645  distinct(Home home, const IntVarArgs& x, int c,
1646  IntPropLevel ipl=IPL_DEF);
1648 
1649 
1667  GECODE_INT_EXPORT void
1668  channel(Home home, const IntVarArgs& x, const IntVarArgs& y,
1669  IntPropLevel ipl=IPL_DEF);
1670 
1684  GECODE_INT_EXPORT void
1685  channel(Home home, const IntVarArgs& x, int xoff,
1686  const IntVarArgs& y, int yoff,
1687  IntPropLevel ipl=IPL_DEF);
1688 
1690  GECODE_INT_EXPORT void
1691  channel(Home home, BoolVar x0, IntVar x1,
1692  IntPropLevel ipl=IPL_DEF);
1694  void
1695  channel(Home home, IntVar x0, BoolVar x1,
1696  IntPropLevel ipl=IPL_DEF);
1702  GECODE_INT_EXPORT void
1703  channel(Home home, const BoolVarArgs& x, IntVar y, int o=0,
1704  IntPropLevel ipl=IPL_DEF);
1706 
1707 }
1708 
1709 #include <gecode/int/channel.hpp>
1710 
1711 namespace Gecode {
1712 
1729  GECODE_INT_EXPORT void
1730  sorted(Home home, const IntVarArgs& x, const IntVarArgs& y,
1731  IntPropLevel ipl=IPL_DEF);
1732 
1744  GECODE_INT_EXPORT void
1745  sorted(Home home, const IntVarArgs& x, const IntVarArgs& y,
1746  const IntVarArgs& z,
1747  IntPropLevel ipl=IPL_DEF);
1749 
1750 
1769  GECODE_INT_EXPORT void
1770  count(Home home, const IntVarArgs& x, int n, IntRelType irt, int m,
1771  IntPropLevel ipl=IPL_DEF);
1776  GECODE_INT_EXPORT void
1777  count(Home home, const IntVarArgs& x, const IntSet& y, IntRelType irt, int m,
1778  IntPropLevel ipl=IPL_DEF);
1786  GECODE_INT_EXPORT void
1787  count(Home home, const IntVarArgs& x, IntVar y, IntRelType irt, int m,
1788  IntPropLevel ipl=IPL_DEF);
1796  GECODE_INT_EXPORT void
1797  count(Home home, const IntVarArgs& x, const IntArgs& y, IntRelType irt, int m,
1798  IntPropLevel ipl=IPL_DEF);
1803  GECODE_INT_EXPORT void
1804  count(Home home, const IntVarArgs& x, int n, IntRelType irt, IntVar z,
1805  IntPropLevel ipl=IPL_DEF);
1810  GECODE_INT_EXPORT void
1811  count(Home home, const IntVarArgs& x, const IntSet& y, IntRelType irt, IntVar z,
1812  IntPropLevel ipl=IPL_DEF);
1820  GECODE_INT_EXPORT void
1821  count(Home home, const IntVarArgs& x, IntVar y, IntRelType irt, IntVar z,
1822  IntPropLevel ipl=IPL_DEF);
1830  GECODE_INT_EXPORT void
1831  count(Home home, const IntVarArgs& x, const IntArgs& y, IntRelType irt, IntVar z,
1832  IntPropLevel ipl=IPL_DEF);
1833 
1847  GECODE_INT_EXPORT void
1848  count(Home home, const IntVarArgs& x, const IntVarArgs& c,
1849  IntPropLevel ipl=IPL_DEF);
1850 
1864  GECODE_INT_EXPORT void
1865  count(Home home, const IntVarArgs& x, const IntSetArgs& c,
1866  IntPropLevel ipl=IPL_DEF);
1867 
1884  GECODE_INT_EXPORT void
1885  count(Home home, const IntVarArgs& x,
1886  const IntVarArgs& c, const IntArgs& v,
1887  IntPropLevel ipl=IPL_DEF);
1888 
1905  GECODE_INT_EXPORT void
1906  count(Home home, const IntVarArgs& x,
1907  const IntSetArgs& c, const IntArgs& v,
1908  IntPropLevel ipl=IPL_DEF);
1909 
1926  GECODE_INT_EXPORT void
1927  count(Home home, const IntVarArgs& x,
1928  const IntSet& c, const IntArgs& v,
1929  IntPropLevel ipl=IPL_DEF);
1930 
1932 
1947  GECODE_INT_EXPORT void
1948  nvalues(Home home, const IntVarArgs& x, IntRelType irt, int y,
1949  IntPropLevel ipl=IPL_DEF);
1953  GECODE_INT_EXPORT void
1954  nvalues(Home home, const IntVarArgs& x, IntRelType irt, IntVar y,
1955  IntPropLevel ipl=IPL_DEF);
1959  GECODE_INT_EXPORT void
1960  nvalues(Home home, const BoolVarArgs& x, IntRelType irt, int y,
1961  IntPropLevel ipl=IPL_DEF);
1965  GECODE_INT_EXPORT void
1966  nvalues(Home home, const BoolVarArgs& x, IntRelType irt, IntVar y,
1967  IntPropLevel ipl=IPL_DEF);
1969 
1990  GECODE_INT_EXPORT void
1991  sequence(Home home, const IntVarArgs& x, const IntSet& s,
1992  int q, int l, int u, IntPropLevel ipl=IPL_DEF);
1993 
2008  GECODE_INT_EXPORT void
2009  sequence(Home home, const BoolVarArgs& x, const IntSet& s,
2010  int q, int l, int u, IntPropLevel ipl=IPL_DEF);
2011 
2013 
2026 
2034  class DFA : public SharedHandle {
2035  private:
2037  class DFAI;
2038  public:
2040  class Transition {
2041  public:
2042  int i_state;
2043  int symbol;
2044  int o_state;
2045  Transition();
2048  Transition(int i_state0, int symbol0, int o_state0);
2049  };
2051  class Transitions {
2052  private:
2054  const Transition* c_trans;
2056  const Transition* e_trans;
2057  public:
2059  Transitions(const DFA& d);
2061  Transitions(const DFA& d, int n);
2063  bool operator ()(void) const;
2065  void operator ++(void);
2067  int i_state(void) const;
2069  int symbol(void) const;
2071  int o_state(void) const;
2072  };
2074  class Symbols {
2075  private:
2077  const Transition* c_trans;
2079  const Transition* e_trans;
2080  public:
2082  Symbols(const DFA& d);
2084  bool operator ()(void) const;
2086  void operator ++(void);
2088  int val(void) const;
2089  };
2090  public:
2091  friend class Transitions;
2093  DFA(void);
2106  DFA(int s, Transition t[], int f[], bool minimize=true);
2108  DFA(const DFA& d);
2110  int n_states(void) const;
2112  int n_transitions(void) const;
2114  unsigned int n_symbols(void) const;
2116  unsigned int max_degree(void) const;
2118  int final_fst(void) const;
2120  int final_lst(void) const;
2122  int symbol_min(void) const;
2124  int symbol_max(void) const;
2125  };
2126 
2137  GECODE_INT_EXPORT void
2138  extensional(Home home, const IntVarArgs& x, DFA d,
2139  IntPropLevel ipl=IPL_DEF);
2140 
2151  GECODE_INT_EXPORT void
2152  extensional(Home home, const BoolVarArgs& x, DFA d,
2153  IntPropLevel ipl=IPL_DEF);
2154 
2161  class TupleSet : public SharedHandle {
2162  public:
2167  typedef int* Tuple;
2168 
2174  : public SharedHandle::Object {
2175  public:
2177  int arity;
2179  int size;
2181  Tuple** tuples;
2183  Tuple* tuple_data;
2185  int* data;
2187  int excess;
2189  int min, max;
2191  unsigned int domsize;
2193  Tuple** last;
2195  Tuple* nullpointer;
2196 
2198  template<class T>
2199  void add(T t);
2201  GECODE_INT_EXPORT void finalize(void);
2203  GECODE_INT_EXPORT void resize(void);
2205  bool finalized(void) const;
2207  TupleSetI(void);
2209  GECODE_INT_EXPORT virtual ~TupleSetI(void);
2211  GECODE_INT_EXPORT virtual SharedHandle::Object* copy(void) const;
2212  };
2213 
2215  TupleSetI* implementation(void);
2216 
2218  TupleSet(void);
2220  TupleSet(const TupleSet& d);
2221 
2223  void add(const IntArgs& tuple);
2225  void finalize(void);
2227  bool finalized(void) const;
2229  int arity(void) const;
2231  int tuples(void) const;
2233  Tuple operator [](int i) const;
2235  int min(void) const;
2237  int max(void) const;
2238  };
2239 
2260  GECODE_INT_EXPORT void
2261  extensional(Home home, const IntVarArgs& x, const TupleSet& t,
2262  IntPropLevel ipl=IPL_DEF);
2263 
2276  GECODE_INT_EXPORT void
2277  extensional(Home home, const BoolVarArgs& x, const TupleSet& t,
2278  IntPropLevel ipl=IPL_DEF);
2280 
2281 }
2282 
2285 
2286 namespace Gecode {
2287 
2299  GECODE_INT_EXPORT void
2300  min(Home home, IntVar x0, IntVar x1, IntVar x2,
2301  IntPropLevel ipl=IPL_DEF);
2309  GECODE_INT_EXPORT void
2310  min(Home home, const IntVarArgs& x, IntVar y,
2311  IntPropLevel ipl=IPL_DEF);
2317  GECODE_INT_EXPORT void
2318  max(Home home, IntVar x0, IntVar x1, IntVar x2,
2319  IntPropLevel ipl=IPL_DEF);
2327  GECODE_INT_EXPORT void
2328  max(Home home, const IntVarArgs& x, IntVar y,
2329  IntPropLevel ipl=IPL_DEF);
2330 
2340  GECODE_INT_EXPORT void
2341  argmin(Home home, const IntVarArgs& x, IntVar y, bool tiebreak=true,
2342  IntPropLevel ipl=IPL_DEF);
2352  GECODE_INT_EXPORT void
2353  argmin(Home home, const IntVarArgs& x, int o, IntVar y, bool tiebreak=true,
2354  IntPropLevel ipl=IPL_DEF);
2364  GECODE_INT_EXPORT void
2365  argmax(Home home, const IntVarArgs& x, IntVar y, bool tiebreak=true,
2366  IntPropLevel ipl=IPL_DEF);
2376  GECODE_INT_EXPORT void
2377  argmax(Home home, const IntVarArgs& x, int o, IntVar y, bool tiebreak=true,
2378  IntPropLevel ipl=IPL_DEF);
2379 
2385  GECODE_INT_EXPORT void
2386  abs(Home home, IntVar x0, IntVar x1,
2387  IntPropLevel ipl=IPL_DEF);
2388 
2394  GECODE_INT_EXPORT void
2395  mult(Home home, IntVar x0, IntVar x1, IntVar x2,
2396  IntPropLevel ipl=IPL_DEF);
2397 
2402  GECODE_INT_EXPORT void
2403  divmod(Home home, IntVar x0, IntVar x1, IntVar x2, IntVar x3,
2404  IntPropLevel ipl=IPL_DEF);
2405 
2410  GECODE_INT_EXPORT void
2411  div(Home home, IntVar x0, IntVar x1, IntVar x2,
2412  IntPropLevel ipl=IPL_DEF);
2413 
2418  GECODE_INT_EXPORT void
2419  mod(Home home, IntVar x0, IntVar x1, IntVar x2,
2420  IntPropLevel ipl=IPL_DEF);
2421 
2427  GECODE_INT_EXPORT void
2428  sqr(Home home, IntVar x0, IntVar x1,
2429  IntPropLevel ipl=IPL_DEF);
2430 
2436  GECODE_INT_EXPORT void
2437  sqrt(Home home, IntVar x0, IntVar x1,
2438  IntPropLevel ipl=IPL_DEF);
2439 
2448  GECODE_INT_EXPORT void
2449  pow(Home home, IntVar x0, int n, IntVar x1,
2450  IntPropLevel ipl=IPL_DEF);
2451 
2460  GECODE_INT_EXPORT void
2461  nroot(Home home, IntVar x0, int n, IntVar x1,
2462  IntPropLevel ipl=IPL_DEF);
2463 
2465 
2501  GECODE_INT_EXPORT void
2502  linear(Home home, const IntVarArgs& x,
2503  IntRelType irt, int c,
2504  IntPropLevel ipl=IPL_DEF);
2508  GECODE_INT_EXPORT void
2509  linear(Home home, const IntVarArgs& x,
2510  IntRelType irt, IntVar y,
2511  IntPropLevel ipl=IPL_DEF);
2515  GECODE_INT_EXPORT void
2516  linear(Home home, const IntVarArgs& x,
2517  IntRelType irt, int c, Reify r,
2518  IntPropLevel ipl=IPL_DEF);
2522  GECODE_INT_EXPORT void
2523  linear(Home home, const IntVarArgs& x,
2524  IntRelType irt, IntVar y, Reify r,
2525  IntPropLevel ipl=IPL_DEF);
2532  GECODE_INT_EXPORT void
2533  linear(Home home, const IntArgs& a, const IntVarArgs& x,
2534  IntRelType irt, int c,
2535  IntPropLevel ipl=IPL_DEF);
2542  GECODE_INT_EXPORT void
2543  linear(Home home, const IntArgs& a, const IntVarArgs& x,
2544  IntRelType irt, IntVar y,
2545  IntPropLevel ipl=IPL_DEF);
2552  GECODE_INT_EXPORT void
2553  linear(Home home, const IntArgs& a, const IntVarArgs& x,
2554  IntRelType irt, int c, Reify r,
2555  IntPropLevel ipl=IPL_DEF);
2562  GECODE_INT_EXPORT void
2563  linear(Home home, const IntArgs& a, const IntVarArgs& x,
2564  IntRelType irt, IntVar y, Reify r,
2565  IntPropLevel ipl=IPL_DEF);
2566 
2567 
2595  GECODE_INT_EXPORT void
2596  linear(Home home, const BoolVarArgs& x,
2597  IntRelType irt, int c,
2598  IntPropLevel ipl=IPL_DEF);
2602  GECODE_INT_EXPORT void
2603  linear(Home home, const BoolVarArgs& x,
2604  IntRelType irt, int c, Reify r,
2605  IntPropLevel ipl=IPL_DEF);
2609  GECODE_INT_EXPORT void
2610  linear(Home home, const BoolVarArgs& x,
2611  IntRelType irt, IntVar y,
2612  IntPropLevel ipl=IPL_DEF);
2616  GECODE_INT_EXPORT void
2617  linear(Home home, const BoolVarArgs& x,
2618  IntRelType irt, IntVar y, Reify r,
2619  IntPropLevel ipl=IPL_DEF);
2626  GECODE_INT_EXPORT void
2627  linear(Home home, const IntArgs& a, const BoolVarArgs& x,
2628  IntRelType irt, int c,
2629  IntPropLevel ipl=IPL_DEF);
2636  GECODE_INT_EXPORT void
2637  linear(Home home, const IntArgs& a, const BoolVarArgs& x,
2638  IntRelType irt, int c, Reify r,
2639  IntPropLevel ipl=IPL_DEF);
2646  GECODE_INT_EXPORT void
2647  linear(Home home, const IntArgs& a, const BoolVarArgs& x,
2648  IntRelType irt, IntVar y,
2649  IntPropLevel ipl=IPL_DEF);
2656  GECODE_INT_EXPORT void
2657  linear(Home home, const IntArgs& a, const BoolVarArgs& x,
2658  IntRelType irt, IntVar y, Reify r,
2659  IntPropLevel ipl=IPL_DEF);
2660 
2661 
2688  GECODE_INT_EXPORT void
2689  binpacking(Home home,
2690  const IntVarArgs& l,
2691  const IntVarArgs& b, const IntArgs& s,
2692  IntPropLevel ipl=IPL_DEF);
2693  /* \brief Post propagator for multi-dimensional bin packing
2694  *
2695  * In the following \a n refers to the number of items and \a m
2696  * refers to the number of bins.
2697  *
2698  * The multi-dimensional bin-packing constraint enforces that
2699  * all items are packed into bins
2700  * \f$b_i\in\{0,\ldots,m-1\}\f$ for \f$0\leq i<n\f$
2701  * and that the load of each bin corresponds to the items
2702  * packed into it for each dimension \f$l_{j\cdot
2703  * d + k} = \sum_{\{i\in\{0,\ldots,n-1\}|
2704  * b_{j\cdot d+k}=i}\}s_{i\cdot d+k}\f$
2705  * for \f$0\leq j<m\f$, \f$0\leq k<d\f$
2706  * Furthermore, the load variables must satisfy the capacity
2707  * constraints \f$l_{j\cdot d + k} \leq
2708  * c_k\f$ for \f$0\leq j<m\f$, \f$0\leq k<d\f$.
2709  *
2710  * The constraint is implemented by the decomposition
2711  * introduced in: Stefano Gualandi and Michele Lombardi. A
2712  * simple and effective decomposition for the multidimensional
2713  * binpacking constraint. CP 2013, pages 356--364.
2714  *
2715  * Posting the constraint returns a maximal set containing conflicting
2716  * items that require pairwise different bins.
2717  *
2718  * Note that posting the constraint has exponential complexity in the
2719  * number of items due to the Bron-Kerbosch algorithm used for finding
2720  * the maximal conflict item sets.
2721  *
2722  * Throws the following exceptions:
2723  * - Of type Int::ArgumentSizeMismatch if any of the following properties
2724  * is violated: \f$|b|=n\f$, \f$|l|=m\cdot d\f$, \f$|s|=n\cdot d\f$,
2725  * and \f$|c|=d\f$.
2726  * - Of type Int::ArgumentSame if \a l and \a b share unassigned variables.
2727  * - Of type Int::OutOfLimits if \a s or \a c contains a negative number.
2728  *
2729  * \ingroup TaskModelIntBinPacking
2730  */
2732  binpacking(Home home, int d,
2733  const IntVarArgs& l, const IntVarArgs& b,
2734  const IntArgs& s, const IntArgs& c,
2735  IntPropLevel ipl=IPL_DEF);
2736 
2737 
2756  GECODE_INT_EXPORT void
2757  nooverlap(Home home,
2758  const IntVarArgs& x, const IntArgs& w,
2759  const IntVarArgs& y, const IntArgs& h,
2760  IntPropLevel ipl=IPL_DEF);
2774  GECODE_INT_EXPORT void
2775  nooverlap(Home home,
2776  const IntVarArgs& x, const IntArgs& w,
2777  const IntVarArgs& y, const IntArgs& h,
2778  const BoolVarArgs& o,
2779  IntPropLevel ipl=IPL_DEF);
2796  GECODE_INT_EXPORT void
2797  nooverlap(Home home,
2798  const IntVarArgs& x0, const IntVarArgs& w, const IntVarArgs& x1,
2799  const IntVarArgs& y0, const IntVarArgs& h, const IntVarArgs& y1,
2800  IntPropLevel ipl=IPL_DEF);
2818  GECODE_INT_EXPORT void
2819  nooverlap(Home home,
2820  const IntVarArgs& x0, const IntVarArgs& w, const IntVarArgs& x1,
2821  const IntVarArgs& y0, const IntVarArgs& h, const IntVarArgs& y1,
2822  const BoolVarArgs& o,
2823  IntPropLevel ipl=IPL_DEF);
2824 
2825 
2831 
2874  GECODE_INT_EXPORT void
2875  cumulatives(Home home, const IntVarArgs& m,
2876  const IntVarArgs& s, const IntVarArgs& p,
2877  const IntVarArgs& e, const IntVarArgs& u,
2878  const IntArgs& c, bool at_most,
2879  IntPropLevel ipl=IPL_DEF);
2884  GECODE_INT_EXPORT void
2885  cumulatives(Home home, const IntArgs& m,
2886  const IntVarArgs& s, const IntVarArgs& p,
2887  const IntVarArgs& e, const IntVarArgs& u,
2888  const IntArgs& c, bool at_most,
2889  IntPropLevel ipl=IPL_DEF);
2894  GECODE_INT_EXPORT void
2895  cumulatives(Home home, const IntVarArgs& m,
2896  const IntVarArgs& s, const IntArgs& p,
2897  const IntVarArgs& e, const IntVarArgs& u,
2898  const IntArgs& c, bool at_most,
2899  IntPropLevel ipl=IPL_DEF);
2904  GECODE_INT_EXPORT void
2905  cumulatives(Home home, const IntArgs& m,
2906  const IntVarArgs& s, const IntArgs& p,
2907  const IntVarArgs& e, const IntVarArgs& u,
2908  const IntArgs& c, bool at_most,
2909  IntPropLevel ipl=IPL_DEF);
2914  GECODE_INT_EXPORT void
2915  cumulatives(Home home, const IntVarArgs& m,
2916  const IntVarArgs& s, const IntVarArgs& p,
2917  const IntVarArgs& e, const IntArgs& u,
2918  const IntArgs& c, bool at_most,
2919  IntPropLevel ipl=IPL_DEF);
2924  GECODE_INT_EXPORT void
2925  cumulatives(Home home, const IntArgs& m,
2926  const IntVarArgs& s, const IntVarArgs& p,
2927  const IntVarArgs& e, const IntArgs& u,
2928  const IntArgs& c, bool at_most,
2929  IntPropLevel ipl=IPL_DEF);
2934  GECODE_INT_EXPORT void
2935  cumulatives(Home home, const IntVarArgs& m,
2936  const IntVarArgs& s, const IntArgs& p,
2937  const IntVarArgs& e, const IntArgs& u,
2938  const IntArgs& c, bool at_most,
2939  IntPropLevel ipl=IPL_DEF);
2944  GECODE_INT_EXPORT void
2945  cumulatives(Home home, const IntArgs& m,
2946  const IntVarArgs& s, const IntArgs& p,
2947  const IntVarArgs& e, const IntArgs& u,
2948  const IntArgs& c, bool at_most,
2949  IntPropLevel ipl=IPL_DEF);
2950 
2977  GECODE_INT_EXPORT void
2978  unary(Home home, const IntVarArgs& s, const IntArgs& p,
2979  IntPropLevel ipl=IPL_DEF);
2980 
3009  GECODE_INT_EXPORT void
3010  unary(Home home, const IntVarArgs& s, const IntArgs& p,
3011  const BoolVarArgs& m, IntPropLevel ipl=IPL_DEF);
3012 
3049  GECODE_INT_EXPORT void
3050  unary(Home home, const TaskTypeArgs& t,
3051  const IntVarArgs& flex, const IntArgs& fix, IntPropLevel ipl=IPL_DEF);
3052 
3091  GECODE_INT_EXPORT void
3092  unary(Home home, const TaskTypeArgs& t,
3093  const IntVarArgs& flex, const IntArgs& fix,
3094  const BoolVarArgs& m, IntPropLevel ipl=IPL_DEF);
3095 
3122  GECODE_INT_EXPORT void
3123  unary(Home home, const IntVarArgs& s, const IntVarArgs& p,
3124  const IntVarArgs& e, IntPropLevel ipl=IPL_DEF);
3125 
3154  GECODE_INT_EXPORT void
3155  unary(Home home, const IntVarArgs& s, const IntVarArgs& p,
3156  const IntVarArgs& e, const BoolVarArgs& m, IntPropLevel ipl=IPL_DEF);
3157 
3158 
3159 
3202  GECODE_INT_EXPORT void
3203  cumulative(Home home, int c, const TaskTypeArgs& t,
3204  const IntVarArgs& flex, const IntArgs& fix, const IntArgs& u,
3205  IntPropLevel ipl=IPL_DEF);
3206 
3207 
3212  GECODE_INT_EXPORT void
3213  cumulative(Home home, IntVar c, const TaskTypeArgs& t,
3214  const IntVarArgs& flex, const IntArgs& fix, const IntArgs& u,
3215  IntPropLevel ipl=IPL_DEF);
3216 
3261  GECODE_INT_EXPORT void
3262  cumulative(Home home, int c, const TaskTypeArgs& t,
3263  const IntVarArgs& flex, const IntArgs& fix, const IntArgs& u,
3264  const BoolVarArgs& m, IntPropLevel ipl=IPL_DEF);
3265 
3269  GECODE_INT_EXPORT void
3270  cumulative(Home home, IntVar c, const TaskTypeArgs& t,
3271  const IntVarArgs& flex, const IntArgs& fix, const IntArgs& u,
3272  const BoolVarArgs& m, IntPropLevel ipl=IPL_DEF);
3273 
3306  GECODE_INT_EXPORT void
3307  cumulative(Home home, int c, const IntVarArgs& s, const IntArgs& p,
3308  const IntArgs& u, IntPropLevel ipl=IPL_DEF);
3309 
3313  GECODE_INT_EXPORT void
3314  cumulative(Home home, IntVar c, const IntVarArgs& s, const IntArgs& p,
3315  const IntArgs& u, IntPropLevel ipl=IPL_DEF);
3316 
3351  GECODE_INT_EXPORT void
3352  cumulative(Home home, int c, const IntVarArgs& s, const IntArgs& p,
3353  const IntArgs& u, const BoolVarArgs& m, IntPropLevel ipl=IPL_DEF);
3354 
3358  GECODE_INT_EXPORT void
3359  cumulative(Home home, IntVar c, const IntVarArgs& s, const IntArgs& p,
3360  const IntArgs& u, const BoolVarArgs& m, IntPropLevel ipl=IPL_DEF);
3361 
3398  GECODE_INT_EXPORT void
3399  cumulative(Home home, int c, const IntVarArgs& s, const IntVarArgs& p,
3400  const IntVarArgs& e, const IntArgs& u, IntPropLevel ipl=IPL_DEF);
3401 
3405  GECODE_INT_EXPORT void
3406  cumulative(Home home, IntVar c, const IntVarArgs& s, const IntVarArgs& p,
3407  const IntVarArgs& e, const IntArgs& u, IntPropLevel ipl=IPL_DEF);
3408 
3447  GECODE_INT_EXPORT void
3448  cumulative(Home home, int c, const IntVarArgs& s, const IntVarArgs& p,
3449  const IntVarArgs& e, const IntArgs& u, const BoolVarArgs& m,
3450  IntPropLevel ipl=IPL_DEF);
3451 
3455  GECODE_INT_EXPORT void
3456  cumulative(Home home, IntVar c, const IntVarArgs& s, const IntVarArgs& p,
3457  const IntVarArgs& e, const IntArgs& u, const BoolVarArgs& m,
3458  IntPropLevel ipl=IPL_DEF);
3460 
3461 
3481  GECODE_INT_EXPORT void
3482  circuit(Home home, const IntVarArgs& x,
3483  IntPropLevel ipl=IPL_DEF);
3499  GECODE_INT_EXPORT void
3500  circuit(Home home, int offset, const IntVarArgs& x,
3501  IntPropLevel ipl=IPL_DEF);
3523  GECODE_INT_EXPORT void
3524  circuit(Home home,
3525  const IntArgs& c,
3526  const IntVarArgs& x, const IntVarArgs& y, IntVar z,
3527  IntPropLevel ipl=IPL_DEF);
3550  GECODE_INT_EXPORT void
3551  circuit(Home home,
3552  const IntArgs& c, int offset,
3553  const IntVarArgs& x, const IntVarArgs& y, IntVar z,
3554  IntPropLevel ipl=IPL_DEF);
3573  GECODE_INT_EXPORT void
3574  circuit(Home home,
3575  const IntArgs& c,
3576  const IntVarArgs& x, IntVar z,
3577  IntPropLevel ipl=IPL_DEF);
3598  GECODE_INT_EXPORT void
3599  circuit(Home home,
3600  const IntArgs& c, int offset,
3601  const IntVarArgs& x, IntVar z,
3602  IntPropLevel ipl=IPL_DEF);
3618  GECODE_INT_EXPORT void
3619  path(Home home, const IntVarArgs& x, IntVar s, IntVar e,
3620  IntPropLevel ipl=IPL_DEF);
3638  GECODE_INT_EXPORT void
3639  path(Home home, int offset, const IntVarArgs& x, IntVar s, IntVar e,
3640  IntPropLevel ipl=IPL_DEF);
3663  GECODE_INT_EXPORT void
3664  path(Home home,
3665  const IntArgs& c,
3666  const IntVarArgs& x, IntVar s, IntVar e, const IntVarArgs& y, IntVar z,
3667  IntPropLevel ipl=IPL_DEF);
3692  GECODE_INT_EXPORT void
3693  path(Home home,
3694  const IntArgs& c, int offset,
3695  const IntVarArgs& x, IntVar s, IntVar e, const IntVarArgs& y, IntVar z,
3696  IntPropLevel ipl=IPL_DEF);
3717  GECODE_INT_EXPORT void
3718  path(Home home,
3719  const IntArgs& c,
3720  const IntVarArgs& x, IntVar s, IntVar e, IntVar z,
3721  IntPropLevel ipl=IPL_DEF);
3744  GECODE_INT_EXPORT void
3745  path(Home home,
3746  const IntArgs& c, int offset,
3747  const IntVarArgs& x, IntVar s, IntVar e, IntVar z,
3748  IntPropLevel ipl=IPL_DEF);
3750 
3751 
3752 
3761  GECODE_INT_EXPORT void
3763  wait(Home home, IntVar x, std::function<void(Space& home)> c,
3764  IntPropLevel ipl=IPL_DEF);
3766  GECODE_INT_EXPORT void
3767  wait(Home home, BoolVar x, std::function<void(Space& home)> c,
3768  IntPropLevel ipl=IPL_DEF);
3770  GECODE_INT_EXPORT void
3771  wait(Home home, const IntVarArgs& x, std::function<void(Space& home)> c,
3772  IntPropLevel ipl=IPL_DEF);
3774  GECODE_INT_EXPORT void
3775  wait(Home home, const BoolVarArgs& x,
3776  std::function<void(Space& home)> c,
3777  IntPropLevel ipl=IPL_DEF);
3779  GECODE_INT_EXPORT void
3780  when(Home home, BoolVar x,
3781  std::function<void(Space& home)> t,
3782  std::function<void(Space& home)> e,
3783  IntPropLevel ipl=IPL_DEF);
3785  GECODE_INT_EXPORT void
3786  when(Home home, BoolVar x,
3787  std::function<void(Space& home)> t,
3788  IntPropLevel ipl=IPL_DEF);
3790 
3791 
3816  GECODE_INT_EXPORT void
3817  unshare(Home home, IntVarArgs& x,
3818  IntPropLevel ipl=IPL_DEF);
3820  GECODE_INT_EXPORT void
3821  unshare(Home home, BoolVarArgs& x,
3822  IntPropLevel ipl=IPL_DEF);
3824 
3825 }
3826 
3827 namespace Gecode {
3828 
3842  typedef std::function<bool(const Space& home, IntVar x, int i)>
3852  typedef std::function<bool(const Space& home, BoolVar x, int i)>
3854 
3864  typedef std::function<double(const Space& home, IntVar x, int i)>
3875  typedef std::function<double(const Space& home, BoolVar x, int i)>
3877 
3888  typedef std::function<int(const Space& home, IntVar x, int i)>
3900  typedef std::function<int(const Space& home, BoolVar x, int i)>
3902 
3914  typedef std::function<void(Space& home, unsigned int a,
3915  IntVar x, int i, int n)>
3928  typedef std::function<void(Space& home, unsigned int a,
3929  BoolVar x, int i, int n)>
3931 
3932 }
3933 
3935 
3936 namespace Gecode {
3937 
3943  class IntAFC : public AFC {
3944  public:
3952  IntAFC(void);
3954  IntAFC(const IntAFC& a);
3956  IntAFC& operator =(const IntAFC& a);
3958  IntAFC(Home home, const IntVarArgs& x, double d=1.0);
3966  void init(Home home, const IntVarArgs& x, double d=1.0);
3967  };
3968 
3974  class BoolAFC : public AFC {
3975  public:
3983  BoolAFC(void);
3985  BoolAFC(const BoolAFC& a);
3987  BoolAFC& operator =(const BoolAFC& a);
3989  BoolAFC(Home home, const BoolVarArgs& x, double d=1.0);
3997  void init(Home home, const BoolVarArgs& x, double d=1.0);
3998  };
3999 
4000 }
4001 
4002 #include <gecode/int/branch/afc.hpp>
4003 
4004 namespace Gecode {
4005 
4011  class IntAction : public Action {
4012  public:
4020  IntAction(void);
4022  IntAction(const IntAction& a);
4024  IntAction& operator =(const IntAction& a);
4033  IntAction(Home home, const IntVarArgs& x, double d=1.0,
4034  IntBranchMerit bm=nullptr);
4046  GECODE_INT_EXPORT void
4047  init(Home home, const IntVarArgs& x, double d=1.0,
4048  IntBranchMerit bm=nullptr);
4049  };
4050 
4056  class BoolAction : public Action {
4057  public:
4065  BoolAction(void);
4067  BoolAction(const BoolAction& a);
4069  BoolAction& operator =(const BoolAction& a);
4078  BoolAction(Home home, const BoolVarArgs& x, double d=1.0,
4079  BoolBranchMerit bm=nullptr);
4091  GECODE_INT_EXPORT void
4092  init(Home home, const BoolVarArgs& x, double d=1.0,
4093  BoolBranchMerit bm=nullptr);
4094  };
4095 
4096 }
4097 
4099 
4100 namespace Gecode {
4101 
4107  class IntCHB : public CHB {
4108  public:
4116  IntCHB(void);
4118  IntCHB(const IntCHB& chb);
4120  IntCHB& operator =(const IntCHB& chb);
4130  IntCHB(Home home, const IntVarArgs& x, IntBranchMerit bm=nullptr);
4142  GECODE_INT_EXPORT void
4143  init(Home home, const IntVarArgs& x, IntBranchMerit bm=nullptr);
4144  };
4145 
4151  class BoolCHB : public CHB {
4152  public:
4160  BoolCHB(void);
4162  BoolCHB(const BoolCHB& chb);
4164  BoolCHB& operator =(const BoolCHB& chb);
4174  BoolCHB(Home home, const BoolVarArgs& x, BoolBranchMerit bm=nullptr);
4186  GECODE_INT_EXPORT void
4187  init(Home home, const BoolVarArgs& x, BoolBranchMerit bm=nullptr);
4188  };
4189 
4190 }
4191 
4192 #include <gecode/int/branch/chb.hpp>
4193 
4194 namespace Gecode {
4195 
4197  typedef std::function<void(const Space &home, const Brancher& b,
4198  unsigned int a,
4199  IntVar x, int i, const int& n,
4200  std::ostream& o)>
4202 
4204  typedef std::function<void(const Space &home, const Brancher& b,
4205  unsigned int a,
4206  BoolVar x, int i, const int& n,
4207  std::ostream& o)>
4209 
4210 }
4211 
4212 namespace Gecode {
4213 
4219  class IntVarBranch : public VarBranch<IntVar> {
4220  public:
4222  enum Select {
4223  SEL_NONE = 0,
4249 
4272  SEL_REGRET_MAX_MAX
4273  };
4274  protected:
4277  public:
4279  IntVarBranch(void);
4281  IntVarBranch(Rnd r);
4285  IntVarBranch(Select s, double d, BranchTbl t);
4295  Select select(void) const;
4297  void expand(Home home, const IntVarArgs& x);
4298  };
4299 
4305  class BoolVarBranch : public VarBranch<BoolVar> {
4306  public:
4308  enum Select {
4309  SEL_NONE = 0,
4320  SEL_CHB_MAX
4321  };
4322  protected:
4325  public:
4327  BoolVarBranch(void);
4329  BoolVarBranch(Rnd r);
4333  BoolVarBranch(Select s, double d, BranchTbl t);
4343  Select select(void) const;
4345  void expand(Home home, const BoolVarArgs& x);
4346  };
4347 
4353  IntVarBranch INT_VAR_NONE(void);
4366  IntVarBranch INT_VAR_AFC_MIN(double d=1.0, BranchTbl tbl=nullptr);
4370  IntVarBranch INT_VAR_AFC_MAX(double d=1.0, BranchTbl tbl=nullptr);
4374  IntVarBranch INT_VAR_ACTION_MIN(double d=1.0, BranchTbl tbl=nullptr);
4378  IntVarBranch INT_VAR_ACTION_MAX(double d=1.0, BranchTbl tbl=nullptr);
4406  IntVarBranch INT_VAR_AFC_SIZE_MIN(double d=1.0, BranchTbl tbl=nullptr);
4410  IntVarBranch INT_VAR_AFC_SIZE_MAX(double d=1.0, BranchTbl tbl=nullptr);
4414  IntVarBranch INT_VAR_ACTION_SIZE_MIN(double d=1.0, BranchTbl tbl=nullptr);
4418  IntVarBranch INT_VAR_ACTION_SIZE_MAX(double d=1.0, BranchTbl tbl=nullptr);
4453 
4467  BoolVarBranch BOOL_VAR_AFC_MIN(double d=1.0, BranchTbl tbl=nullptr);
4471  BoolVarBranch BOOL_VAR_AFC_MAX(double d=1.0, BranchTbl tbl=nullptr);
4475  BoolVarBranch BOOL_VAR_ACTION_MIN(double d=1.0, BranchTbl tbl=nullptr);
4479  BoolVarBranch BOOL_VAR_ACTION_MAX(double d=1.0, BranchTbl tbl=nullptr);
4491 
4492 }
4493 
4494 #include <gecode/int/branch/var.hpp>
4495 
4496 namespace Gecode {
4497 
4503  class IntValBranch : public ValBranch<IntVar> {
4504  public:
4506  enum Select {
4517  SEL_VALUES_MAX
4518  };
4519  protected:
4522  public:
4524  IntValBranch(Select s = SEL_MIN);
4526  IntValBranch(Rnd r);
4530  Select select(void) const;
4531  };
4532 
4538  class BoolValBranch : public ValBranch<BoolVar> {
4539  public:
4541  enum Select {
4545  SEL_VAL_COMMIT
4546  };
4547  protected:
4550  public:
4552  BoolValBranch(Select s = SEL_MIN);
4554  BoolValBranch(Rnd r);
4558  Select select(void) const;
4559  };
4560 
4566  IntValBranch INT_VAL_MIN(void);
4569  IntValBranch INT_VAL_MED(void);
4571  IntValBranch INT_VAL_MAX(void);
4593 
4608 
4609 }
4610 
4611 #include <gecode/int/branch/val.hpp>
4612 
4613 namespace Gecode {
4614 
4620  class IntAssign : public ValBranch<IntVar> {
4621  public:
4623  enum Select {
4628  SEL_VAL_COMMIT
4629  };
4630  protected:
4633  public:
4635  IntAssign(Select s = SEL_MIN);
4637  IntAssign(Rnd r);
4641  Select select(void) const;
4642  };
4643 
4649  class BoolAssign : public ValBranch<BoolVar> {
4650  public:
4652  enum Select {
4656  SEL_VAL_COMMIT
4657  };
4658  protected:
4661  public:
4663  BoolAssign(Select s = SEL_MIN);
4665  BoolAssign(Rnd r);
4669  Select select(void) const;
4670  };
4671 
4677  IntAssign INT_ASSIGN_MIN(void);
4680  IntAssign INT_ASSIGN_MED(void);
4682  IntAssign INT_ASSIGN_MAX(void);
4692 
4707 
4708 }
4709 
4711 
4712 namespace Gecode {
4718  GECODE_INT_EXPORT void
4719  branch(Home home, const IntVarArgs& x,
4720  IntVarBranch vars, IntValBranch vals,
4721  IntBranchFilter bf=nullptr,
4722  IntVarValPrint vvp=nullptr);
4728  GECODE_INT_EXPORT void
4729  branch(Home home, const IntVarArgs& x,
4731  IntBranchFilter bf=nullptr,
4732  IntVarValPrint vvp=nullptr);
4738  GECODE_INT_EXPORT void
4739  branch(Home home, IntVar x, IntValBranch vals,
4740  IntVarValPrint vvp=nullptr);
4746  GECODE_INT_EXPORT void
4747  branch(Home home, const BoolVarArgs& x,
4748  BoolVarBranch vars, BoolValBranch vals,
4749  BoolBranchFilter bf=nullptr,
4750  BoolVarValPrint vvp=nullptr);
4756  GECODE_INT_EXPORT void
4757  branch(Home home, const BoolVarArgs& x,
4759  BoolBranchFilter bf=nullptr,
4760  BoolVarValPrint vvp=nullptr);
4766  GECODE_INT_EXPORT void
4767  branch(Home home, BoolVar x, BoolValBranch vals,
4768  BoolVarValPrint vvp=nullptr);
4769 
4775  GECODE_INT_EXPORT void
4776  assign(Home home, const IntVarArgs& x, IntAssign vals,
4777  IntBranchFilter bf=nullptr,
4778  IntVarValPrint vvp=nullptr);
4784  GECODE_INT_EXPORT void
4785  assign(Home home, IntVar x, IntAssign vals,
4786  IntVarValPrint vvp=nullptr);
4792  GECODE_INT_EXPORT void
4793  assign(Home home, const BoolVarArgs& x, BoolAssign vals,
4794  BoolBranchFilter bf=nullptr,
4795  BoolVarValPrint vvp=nullptr);
4801  GECODE_INT_EXPORT void
4802  assign(Home home, BoolVar x, BoolAssign vals,
4803  BoolVarValPrint vvp=nullptr);
4804 
4805 }
4806 
4807 namespace Gecode {
4808 
4812  template<class Char, class Traits>
4813  std::basic_ostream<Char,Traits>&
4814  operator <<(std::basic_ostream<Char,Traits>& os, const DFA& d);
4815 
4819  template<class Char, class Traits>
4820  std::basic_ostream<Char,Traits>&
4821  operator <<(std::basic_ostream<Char,Traits>& os, const TupleSet& ts);
4822 
4823 }
4824 
4825 // LDSB-related declarations.
4826 namespace Gecode {
4827 
4828  namespace Int { namespace LDSB {
4829  class SymmetryObject;
4830  }}
4831 
4838  public:
4842  void increment(void);
4844  void decrement(void);
4845  public:
4847  SymmetryHandle(void);
4851  SymmetryHandle(const SymmetryHandle& h);
4853  const SymmetryHandle& operator=(const SymmetryHandle& h);
4855  ~SymmetryHandle(void);
4856  };
4857  class Symmetries;
4859  template<>
4861  public:
4865  };
4866 
4873  class Symmetries : public ArgArray<SymmetryHandle> {};
4875  // If this is instead a typedef, strange things happen with the
4876  // overloading of the "branch" function.
4877 
4884  const IntArgs& indices);
4911  SymmetryHandle ValueSequenceSymmetry(const IntArgs& v, int ss);
4912 
4914  GECODE_INT_EXPORT SymmetryHandle values_reflect(int lower, int upper);
4918 
4930  GECODE_INT_EXPORT void
4931  branch(Home home, const IntVarArgs& x,
4932  IntVarBranch vars, IntValBranch vals,
4933  const Symmetries& syms,
4934  IntBranchFilter bf=nullptr,
4935  IntVarValPrint vvp=nullptr);
4947  GECODE_INT_EXPORT void
4948  branch(Home home, const IntVarArgs& x,
4950  const Symmetries& syms,
4951  IntBranchFilter bf=nullptr,
4952  IntVarValPrint vvp=nullptr);
4964  GECODE_INT_EXPORT void
4965  branch(Home home, const BoolVarArgs& x,
4966  BoolVarBranch vars, BoolValBranch vals,
4967  const Symmetries& syms,
4968  BoolBranchFilter bf=nullptr,
4969  BoolVarValPrint vvp=nullptr);
4981  GECODE_INT_EXPORT void
4982  branch(Home home, const BoolVarArgs& x,
4984  const Symmetries& syms,
4985  BoolBranchFilter bf=nullptr,
4986  BoolVarValPrint vvp=nullptr);
4987 }
4988 
4989 namespace Gecode {
4990 
4991  /*
4992  * \brief Relaxed assignment of variables in \a x from values in \a sx
4993  *
4994  * The variables in \a x are assigned values from the assigned variables
4995  * in the solution \a sx with a relaxation probability \a p. That is,
4996  * if \$fp=0.1\f$ approximately 10% of the variables in \a x will be
4997  * assigned a value from \a sx.
4998  *
4999  * The random numbers are generated from the generator \a r. At least
5000  * one variable will not be assigned: in case the relaxation attempt
5001  * would suggest that all variables should be assigned, a single
5002  * variable will be selected randomly to remain unassigned.
5003  *
5004  * Throws an exception of type Int::ArgumentSizeMismatch, if \a x and
5005  * \a sx are of different size.
5006  *
5007  * Throws an exception of type Int::OutOfLimits, if \a p is not between
5008  * \a 0.0 and \a 1.0.
5009  *
5010  * \ingroup TaskModelInt
5011  */
5012  GECODE_INT_EXPORT void
5013  relax(Home home, const IntVarArgs& x, const IntVarArgs& sx,
5014  Rnd r, double p);
5015 
5016  /*
5017  * \brief Relaxed assignment of variables in \a x from values in \a sx
5018  *
5019  * The variables in \a x are assigned values from the assigned variables
5020  * in the solution \a sx with a relaxation probability \a p. That is,
5021  * if \$fp=0.1\f$ approximately 10% of the variables in \a x will be
5022  * assigned a value from \a sx.
5023  *
5024  * The random numbers are generated from the generator \a r. At least
5025  * one variable will not be assigned: in case the relaxation attempt
5026  * would suggest that all variables should be assigned, a single
5027  * variable will be selected randomly to remain unassigned.
5028  *
5029  * Throws an exception of type Int::ArgumentSizeMismatch, if \a x and
5030  * \a sx are of different size.
5031  *
5032  * Throws an exception of type Int::OutOfLimits, if \a p is not between
5033  * \a 0.0 and \a 1.0.
5034  *
5035  * \ingroup TaskModelInt
5036  */
5037  GECODE_INT_EXPORT void
5038  relax(Home home, const BoolVarArgs& x, const BoolVarArgs& sx,
5039  Rnd r, double p);
5040 
5041 }
5042 
5043 
5046 
5047 namespace Gecode {
5048 
5059  : public Iter::Ranges::Diff<Iter::Ranges::RangeList,
5060  Int::ViewRanges<Int::IntView> > {
5061  protected:
5066  public:
5068 
5072  };
5073 
5079  protected:
5081  int delta;
5082  public:
5084 
5088 
5090  bool operator ()(void) const;
5093  void operator ++(void);
5095 
5097 
5098  int min(void) const;
5101  int max(void) const;
5103  unsigned int width(void) const;
5105  };
5106 
5107 }
5108 
5111 
5112 #include <gecode/int/trace/traits.hpp>
5113 
5114 namespace Gecode {
5115 
5126 
5131  class GECODE_INT_EXPORT StdIntTracer : public IntTracer {
5132  protected:
5134  std::ostream& os;
5135  public:
5137  StdIntTracer(std::ostream& os0 = std::cerr);
5139  virtual void init(const Space& home, const IntTraceRecorder& t);
5141  virtual void prune(const Space& home, const IntTraceRecorder& t,
5142  const ViewTraceInfo& vti, int i, IntTraceDelta& d);
5144  virtual void fix(const Space& home, const IntTraceRecorder& t);
5146  virtual void fail(const Space& home, const IntTraceRecorder& t);
5148  virtual void done(const Space& home, const IntTraceRecorder& t);
5151  };
5152 
5153 
5164 
5169  class GECODE_INT_EXPORT StdBoolTracer : public BoolTracer {
5170  protected:
5172  std::ostream& os;
5173  public:
5175  StdBoolTracer(std::ostream& os0 = std::cerr);
5177  virtual void init(const Space& home, const BoolTraceRecorder& t);
5179  virtual void prune(const Space& home, const BoolTraceRecorder& t,
5180  const ViewTraceInfo& vti, int i, BoolTraceDelta& d);
5182  virtual void fix(const Space& home, const BoolTraceRecorder& t);
5184  virtual void fail(const Space& home, const BoolTraceRecorder& t);
5186  virtual void done(const Space& home, const BoolTraceRecorder& t);
5189  };
5190 
5195  GECODE_INT_EXPORT void
5196  trace(Home home, const IntVarArgs& x,
5197  TraceFilter tf,
5198  int te = (TE_INIT | TE_PRUNE | TE_FIX | TE_FAIL | TE_DONE),
5199  IntTracer& t = StdIntTracer::def);
5204  void
5205  trace(Home home, const IntVarArgs& x,
5206  int te = (TE_INIT | TE_PRUNE | TE_FIX | TE_FAIL | TE_DONE),
5207  IntTracer& t = StdIntTracer::def);
5208 
5213  GECODE_INT_EXPORT void
5214  trace(Home home, const BoolVarArgs& x,
5215  TraceFilter tf,
5216  int te = (TE_INIT | TE_PRUNE | TE_FIX | TE_FAIL | TE_DONE),
5217  BoolTracer& t = StdBoolTracer::def);
5222  void
5223  trace(Home home, const BoolVarArgs& x,
5224  int te = (TE_INIT | TE_PRUNE | TE_FIX | TE_FAIL | TE_DONE),
5225  BoolTracer& t = StdBoolTracer::def);
5226 
5227 }
5228 
5229 #include <gecode/int/trace.hpp>
5230 
5231 #endif
5232 
5233 // IFDEF: GECODE_HAS_INT_VARS
5234 // STATISTICS: int-post
5235 
Value iterator for integer variables.
Definition: int.hh:472
BoolValBranch BOOL_VAL_RND(Rnd r)
Select random value.
Definition: val.hpp:144
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:3916
Bounds propagation.
Definition: int.hh:959
std::function< double(const Space &home, BoolVar x, int i)> BoolBranchMerit
Branch merit function type for Boolean variables.
Definition: int.hh:3876
With smallest accumulated failure count.
Definition: int.hh:4229
void mod(Home home, IntVar x0, IntVar x1, IntVar x2, IntPropLevel ipl)
Post propagator for .
Definition: arithmetic.cpp:267
IntVarBranch INT_VAR_DEGREE_SIZE_MAX(BranchTbl tbl)
Select variable with largest degree divided by domain size.
Definition: var.hpp:225
Int::ViewRanges< Int::IntView > rn
Iterator over the new values.
Definition: int.hh:5063
IntValBranch INT_VAL_RANGE_MIN(void)
Select the smallest range of the variable domain if it has several ranges, otherwise select values no...
Definition: val.hpp:89
IntVarArgs(const VarArray< IntVar > &a)
Initialize from variable array a (copy elements)
Definition: int.hh:650
Duplicate of a Boolean view.
IntPropLevel vbd(IntPropLevel ipl)
Extract value, bounds, or domain propagation from propagation level.
Definition: ipl.hpp:41
int symbol
symbol
Definition: int.hh:2043
Variables as interfaces to variable implementations.
Definition: var.hpp:51
NodeType t
Type of node.
Definition: bool-expr.cpp:234
Tracer that process view trace information.
Definition: tracer.hpp:55
IntVarBranch INT_VAR_CHB_SIZE_MAX(IntCHB c, BranchTbl tbl)
Select variable with largest CHB Q-score divided by domain size.
Definition: var.hpp:280
IntVarBranch INT_VAR_NONE(void)
Select first unassigned variable.
Definition: var.hpp:100
Combine variable selection criteria for tie-breaking.
Select s
Which variable to select.
Definition: int.hh:4276
void mult(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition: arithmetic.cpp:92
BoolVarBranch BOOL_VAR_NONE(void)
Select first unassigned variable.
Definition: var.hpp:368
The shared handle.
Definition: core.hpp:79
NNF * l
Left subtree.
Definition: bool-expr.cpp:244
TaskType
Type of task for scheduling constraints.
Definition: int.hh:990
Inverse implication for reification.
Definition: int.hh:850
void sorted(Home home, const IntVarArgs &x, const IntVarArgs &y, const IntVarArgs &z, IntPropLevel)
Post propagator that y is x sorted in increasing order.
Definition: sorted.cpp:43
BoolVarBranch BOOL_VAR_AFC_MIN(double d, BranchTbl tbl)
Select variable with smallest accumulated failure count with decay factor d.
Definition: var.hpp:398
union Gecode::@579::NNF::@61 u
Union depending on nodetype t.
With largest min-regret.
Definition: int.hh:4260
Select s
Which value to select.
Definition: int.hh:4660
View trace information.
Definition: core.hpp:974
Range iterator for integer sets.
Definition: int.hh:274
BoolAssign BOOL_ASSIGN_MIN(void)
Select smallest value.
Definition: assign.hpp:104
BoolVarArgs(const VarArray< BoolVar > &a)
Initialize from variable array a (copy elements)
Definition: int.hh:704
void sequence(Home home, const IntVarArgs &x, const IntSet &s, int q, int l, int u, IntPropLevel)
Post propagator for .
Definition: sequence.cpp:51
Iterator for DFA symbols.
Definition: int.hh:2074
Select random value.
Definition: int.hh:4544
void branch(Home home, const FloatVarArgs &x, FloatVarBranch vars, FloatValBranch vals, FloatBranchFilter bf, FloatVarValPrint vvp)
Branch over x with variable selection vars and value selection vals.
Definition: branch.cpp:43
Which values to select for branching first.
Definition: int.hh:4538
void channel(Home home, FloatVar x0, IntVar x1)
Post propagator for channeling a float and an integer variable .
Definition: channel.cpp:45
Iter::Ranges::RangeList ro
Iterator over the old values.
Definition: int.hh:5065
void count(Home home, const IntVarArgs &x, int n, IntRelType irt, int m, IntPropLevel)
Post propagator for .
Definition: count.cpp:44
bool one(const Gecode::FloatValArgs &a)
Check whether has only one coefficients.
Definition: linear.cpp:50
Standard Boolean variable tracer.
Definition: int.hh:5169
Select
Which value selection.
Definition: int.hh:4623
Select smallest value.
Definition: int.hh:4542
Argument array for primtive types.
Definition: array.hpp:640
BoolOpType
Operation types for Booleans.
Definition: int.hh:931
With smallest accumulated failure count.
Definition: int.hh:4315
Which values to select for branching first.
Definition: int.hh:4503
With smallest degree.
Definition: int.hh:4227
BoolVarArgs(const BoolVarArgs &a)
Initialize from variable argument array a (copy elements)
Definition: int.hh:702
IntVarBranch INT_VAR_SIZE_MAX(BranchTbl tbl)
Select variable with largest domain size.
Definition: var.hpp:215
Select smallest value.
Definition: int.hh:4507
Which integer variable to select for branching.
Definition: int.hh:4219
int excess
Excess storage.
Definition: int.hh:2187
With largest accumulated failure count.
Definition: int.hh:4230
void abs(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition: arithmetic.cpp:45
IntAssign INT_ASSIGN_MED(void)
Select greatest value not greater than the median.
Definition: assign.hpp:64
Select s
Which value to select.
Definition: int.hh:4549
Less or equal ( )
Definition: int.hh:909
void nroot(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for $n 0$.
Definition: arithmetic.cpp:122
void pow(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for $n 0$.
Definition: arithmetic.cpp:113
IntVarBranch INT_VAR_REGRET_MIN_MIN(BranchTbl tbl)
Select variable with smallest min-regret.
Definition: var.hpp:290
IntVarBranch INT_VAR_DEGREE_MAX(BranchTbl tbl)
Select variable with largest degree.
Definition: var.hpp:125
BoolVarBranch BOOL_VAR_ACTION_MIN(double d, BranchTbl tbl)
Select variable with lowest action with decay factor d.
Definition: var.hpp:418
bool normalize(Term< View > *t, int &n, Term< View > *&t_p, int &n_p, Term< View > *&t_n, int &n_n, int &g)
Normalize linear integer constraints.
Definition: post.hpp:119
Conjunction.
Definition: int.hh:932
Range iterator for range lists
With largest accumulated failure count divided by domain size.
Definition: int.hh:4244
IntVarBranch INT_VAR_AFC_MIN(double d, BranchTbl tbl)
Select variable with smallest accumulated failure count with decay factor d.
Definition: var.hpp:130
int * Tuple
Type of a tuple.
Definition: int.hh:2167
void member(Home home, const IntVarArgs &x, IntVar y, IntPropLevel)
Post domain consistent propagator for .
Definition: member.cpp:43
BoolVarArgs(const std::vector< BoolVar > &a)
Initialize from vector a.
Definition: int.hh:707
void path(Home home, int offset, const IntVarArgs &x, IntVar s, IntVar e, IntPropLevel ipl)
Post propagator such that x forms a Hamiltonian path.
Definition: circuit.cpp:128
void dom(Home home, FloatVar x, FloatVal n)
Propagates .
Definition: dom.cpp:44
Collection of symmetries.
Definition: int.hh:4874
Which values to select for assignment.
Definition: int.hh:4649
void linear(Home home, const FloatVarArgs &x, FloatRelType frt, FloatVal c)
Post propagator for .
Definition: linear.cpp:45
With highest action.
Definition: int.hh:4318
Implementation of a symmetry at the modelling level.
Definition: ldsb.hh:110
IntValBranch INT_VAL_RANGE_MAX(void)
Select the largest range of the variable domain if it has several ranges, otherwise select values gre...
Definition: val.hpp:94
IntVarBranch INT_VAR_CHB_SIZE_MIN(IntCHB c, BranchTbl tbl)
Select variable with smallest CHB Q-score divided by domain size.
Definition: var.hpp:270
void nonnegative(int n, const char *l)
Check whether n is in range and nonnegative, otherwise throw out of limits with information l...
Definition: limits.hpp:72
IntVarArgs(InputIterator first, InputIterator last)
Initialize from InputIterator first and last.
Definition: int.hh:655
Implication.
Definition: int.hh:934
Integer variable array.
Definition: int.hh:744
IntVarBranch INT_VAR_MERIT_MAX(IntBranchMerit bm, BranchTbl tbl)
Select variable with highest merit according to branch merit function bm.
Definition: var.hpp:115
Select the smallest range of the variable domain if it has several ranges, otherwise select values no...
Definition: int.hh:4513
void circuit(Home home, int offset, const IntVarArgs &x, IntPropLevel ipl)
Post propagator such that x forms a circuit.
Definition: circuit.cpp:45
void argmin(Home home, const IntVarArgs &x, IntVar y, bool tiebreak, IntPropLevel)
Post propagator for .
Definition: arithmetic.cpp:167
BoolVarBranch BOOL_VAR_MERIT_MIN(BoolBranchMerit bm, BranchTbl tbl)
Select variable with least merit according to branch merit function bm.
Definition: var.hpp:378
IntVarArgs(const std::vector< IntVar > &a)
Initialize from vector a.
Definition: int.hh:652
BoolAssign BOOL_ASSIGN_MAX(void)
Select largest value.
Definition: assign.hpp:109
Select s
Which value to select.
Definition: int.hh:4521
IntVarBranch INT_VAR_REGRET_MIN_MAX(BranchTbl tbl)
Select variable with largest min-regret.
Definition: var.hpp:295
Greater ( )
Definition: int.hh:912
void binpacking(Home home, const IntVarArgs &l, const IntVarArgs &b, const IntArgs &s, IntPropLevel)
Post propagator for bin packing.
Definition: bin-packing.cpp:45
Select largest value.
Definition: int.hh:4654
ArgArray< IntSet > IntSetArgs
Passing set arguments.
Definition: int.hh:601
Trace init events.
const int max
Largest allowed integer value.
Definition: int.hh:116
With largest accumulated failure count.
Definition: int.hh:4316
With lowest action.
Definition: int.hh:4317
Computation spaces.
Definition: core.hpp:1748
ExecStatus prune(Space &home, ViewArray< VX > &x, ConstIntView)
Definition: rel.hpp:257
Greater or equal ( )
Definition: int.hh:911
Standard integer variable tracer.
Definition: int.hh:5131
Select s
Which value to select.
Definition: int.hh:4632
ViewTracer< Int::IntView > IntTracer
Tracer for integer variables.
Definition: int.hh:5120
With smallest min.
Definition: int.hh:4235
int i_state
input state
Definition: int.hh:2042
Exclusive or.
Definition: int.hh:936
const int min
Smallest allowed integer value.
Definition: int.hh:118
Select smallest value.
Definition: int.hh:4624
IntVarArgs(int n)
Allocate array with n elements.
Definition: int.hh:646
ViewTraceRecorder< Int::IntView > IntTraceRecorder
Trace recorder for integer variables.
Definition: int.hh:5125
Range iterator for integer variables
Definition: int.hh:455
IntAssign INT_ASSIGN_MIN(void)
Select smallest value.
Definition: assign.hpp:59
IntValBranch INT_VAL_RND(Rnd r)
Select random value.
Definition: val.hpp:74
With lowest action.
Definition: int.hh:4231
Random (uniform, for tie breaking)
Definition: int.hh:4310
Gecode::IntSet d(v, 7)
bool overflow_mul(int n, int m)
Check whether multiplying n and m would overflow.
Definition: limits.hpp:111
IntVarBranch INT_VAR_MAX_MAX(BranchTbl tbl)
Select variable with largest max.
Definition: var.hpp:205
Select s
Which variable to select.
Definition: int.hh:4324
std::string expand(Gecode::IntRelType irt)
Expand relation to abbreviation.
Definition: mm-count.cpp:48
Reify imp(BoolVar x)
Use implication for reification.
Definition: reify.hpp:77
struct Gecode::@579::NNF::@61::@63 a
For atomic nodes.
Gecode::FloatVal c(-8, 8)
Trace prune events.
SymmetryHandle VariableSymmetry(const IntVarArgs &vars)
Variables in x are interchangeable.
Definition: ldsb.cpp:66
Deterministic finite automaton (DFA)
Definition: int.hh:2034
int p
Number of positive literals for node type.
Definition: bool-expr.cpp:236
IntVarBranch INT_VAR_ACTION_MAX(double d, BranchTbl tbl)
Select variable with highest action with decay factor d.
Definition: var.hpp:160
With smallest max-regret.
Definition: int.hh:4266
BoolValBranch BOOL_VAL_MIN(void)
Select smallest value.
Definition: val.hpp:134
IntVarBranch INT_VAR_AFC_SIZE_MAX(double d, BranchTbl tbl)
Select variable with largest accumulated failure count divided by domain size with decay factor d...
Definition: var.hpp:240
IntAssign INT_ASSIGN(IntBranchVal v, IntBranchCommit c)
Select value as defined by the value function v and commit function c.
Definition: assign.hpp:79
Gecode::IntArgs i(4, 1, 2, 3, 4)
Base-class for branchers.
Definition: core.hpp:1446
Class for AFC (accumulated failure count) management.
Definition: afc.hpp:44
IntRelType neg(IntRelType irt)
Return negated relation type of irt.
Definition: irt.hpp:56
BoolValBranch BOOL_VAL_MAX(void)
Select largest value.
Definition: val.hpp:139
int n
Number of negative literals for node type.
Definition: bool-expr.cpp:238
Equality ( )
Definition: int.hh:907
void unshare(Home home, IntVarArgs &x, IntPropLevel ipl)
Replace multiple variable occurences in x by fresh variables.
Definition: unshare.cpp:133
const long long int llmin
Smallest allowed long long integer value.
Definition: int.hh:124
Select random value.
Definition: int.hh:4627
With smallest degree.
Definition: int.hh:4313
Tuple ** last
Initial last structure.
Definition: int.hh:2193
With smallest min-regret.
Definition: int.hh:4254
A reference-counted pointer to a SymmetryObject.
Definition: int.hh:4837
void divmod(Home home, IntVar x0, IntVar x1, IntVar x2, IntVar x3, IntPropLevel)
Post propagator for .
Definition: arithmetic.cpp:234
std::function< int(const Space &home, IntVar x, int i)> IntBranchVal
Branch value function type for integer variables.
Definition: int.hh:3889
void nvalues(Home home, const IntVarArgs &x, IntRelType irt, int y, IntPropLevel)
Post propagator for .
Definition: nvalues.cpp:44
IntAssign INT_ASSIGN_RND(Rnd r)
Select random value.
Definition: assign.hpp:74
With largest action divided by domain size.
Definition: int.hh:4246
Select
Which value selection.
Definition: int.hh:4652
IntRelType
Relation types for integers.
Definition: int.hh:906
IntVarBranch INT_VAR_MIN_MIN(BranchTbl tbl)
Select variable with smallest min.
Definition: var.hpp:190
SymmetryHandle ValueSequenceSymmetry(const IntArgs &vs, int ss)
Value sequences in v of size ss are interchangeable.
Definition: ldsb.cpp:106
Select greatest value not greater than the median.
Definition: int.hh:4508
BoolVarBranch BOOL_VAR_DEGREE_MIN(BranchTbl tbl)
Select variable with smallest degree.
Definition: var.hpp:388
void sqr(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition: arithmetic.cpp:99
IntAssign INT_ASSIGN_MAX(void)
Select largest value.
Definition: assign.hpp:69
Simple propagation levels.
Definition: int.hh:957
IntVarBranch INT_VAR_MERIT_MIN(IntBranchMerit bm, BranchTbl tbl)
Select variable with least merit according to branch merit function bm.
Definition: var.hpp:110
void extensional(Home home, const IntVarArgs &x, DFA dfa, IntPropLevel)
Post domain consistent propagator for extensional constraint described by a DFA.
Definition: extensional.cpp:45
Select random value.
Definition: int.hh:4655
Recording AFC information for integer variables.
Definition: int.hh:3943
BoolVarBranch BOOL_VAR_CHB_MAX(BoolCHB c, BranchTbl tbl)
Select variable with largest CHB Q-score.
Definition: var.hpp:448
IntValBranch INT_VAL_MIN(void)
Select smallest value.
Definition: val.hpp:59
Specification of a DFA transition.
Definition: int.hh:2040
void sqrt(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition: arithmetic.cpp:106
Use basic propagation algorithm.
Definition: int.hh:965
std::function< double(const Space &home, double w, double b)> BranchTbl
Tie-break limit function.
Definition: branch-var.hpp:52
Value iterator from range iterator.
void wait(Home home, FloatVar x, std::function< void(Space &home)> c)
Execute c when x becomes assigned.
Definition: exec.cpp:44
Class for CHB management.
Definition: chb.hpp:50
With largest max.
Definition: int.hh:4238
unsigned int size(I &i)
Size of all ranges of range iterator i.
Reification specification.
Definition: int.hh:857
Value propagation.
Definition: int.hh:958
struct Gecode::@579::NNF::@61::@62 b
For binary nodes (and, or, eqv)
SymmetryHandle ValueSymmetry(const IntArgs &vs)
Values in v are interchangeable.
Definition: ldsb.cpp:85
IntValBranch INT_VAL_SPLIT_MAX(void)
Select values greater than mean of smallest and largest value.
Definition: val.hpp:84
void range(Home home, const IntVarArgs &x, SetVar y, SetVar z)
Post constraint .
Definition: minimodel.hh:1901
unsigned int domsize
Domain size.
Definition: int.hh:2191
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:105
void distinct(Home home, const IntVarArgs &x, IntPropLevel ipl)
Post propagator for for all .
Definition: distinct.cpp:50
With largest domain size.
Definition: int.hh:4240
Duplicate of an integer view.
Tuple ** tuples
Tuples index.
Definition: int.hh:2181
Recording AFC information for Boolean variables.
Definition: int.hh:3974
bool overflow_add(int n, int m)
Check whether adding n and m would overflow.
Definition: limits.hpp:83
void argmax(Home home, const IntVarArgs &x, IntVar y, bool tiebreak, IntPropLevel)
Post propagator for .
Definition: arithmetic.cpp:114
Recording actions for Boolean variables.
Definition: int.hh:4056
Trace filters.
int min
Minimum and maximum in domain-values.
Definition: int.hh:2189
BoolAssign BOOL_ASSIGN_RND(Rnd r)
Select random value.
Definition: assign.hpp:114
Integer set initialization.
Definition: int-set-1.hpp:57
BoolAssign BOOL_ASSIGN(BoolBranchVal v, BoolBranchCommit c)
Select value as defined by the value function v and commit function c.
Definition: assign.hpp:119
IntValBranch INT_VAL(IntBranchVal v, IntBranchCommit c)
Select value as defined by the value function v and commit function c Uses a commit function as defau...
Definition: val.hpp:99
Which Boolean variable to select for branching.
Definition: int.hh:4305
Select smallest value.
Definition: int.hh:4653
Less ( )
Definition: int.hh:910
Integer sets.
Definition: int.hh:174
int o_state
output state Default constructor
Definition: int.hh:2044
Tuple * nullpointer
Pointer to nullptr-pointer.
Definition: int.hh:2195
Post propagator for SetVar SetOpType SetVar SetRelType SetVar z
Definition: set.hh:784
IntVarBranch INT_VAR_AFC_MAX(double d, BranchTbl tbl)
Select variable with largest accumulated failure count with decay factor d.
Definition: var.hpp:140
std::function< bool(const Space &home, IntVar x, int i)> IntBranchFilter
Branch filter function type for integer variables.
Definition: int.hh:3843
Data stored for a Table.
Definition: int.hh:2173
Use advanced propagation algorithm.
Definition: int.hh:966
std::ostream & os
Output stream to use.
Definition: int.hh:5172
With largest CHB Q-score divided by domain size.
Definition: int.hh:4248
static StdIntTracer def
Default tracer (printing to std::cerr)
Definition: int.hh:5150
Prefer speed.
Definition: int.hh:962
Recording CHB for integer variables.
Definition: int.hh:4107
Reify eqv(BoolVar x)
Use equivalence for reification.
Definition: reify.hpp:73
Disjunction.
Definition: int.hh:933
With largest degree divided by domain size.
Definition: int.hh:4242
IntVarArgs(const IntVarArgs &a)
Initialize from variable argument array a (copy elements)
Definition: int.hh:648
int * data
Tuples data.
Definition: int.hh:2185
IntPropLevel sm(IntPropLevel ipl)
Extract speed or memory from propagation level.
Definition: ipl.hpp:47
Passing integer variables.
Definition: int.hh:639
SharedArray< int > IntSharedArray
Arrays of integers that can be shared among several element constraints.
Definition: int.hh:1463
ViewTracer< Int::BoolView > BoolTracer
Tracer for Boolean variables.
Definition: int.hh:5158
Passing integer arguments.
Definition: int.hh:610
BoolVarArgs(InputIterator first, InputIterator last)
Initialize from InputIterator first and last.
Definition: int.hh:710
Passing Boolean variables.
Definition: int.hh:693
Select values greater than mean of smallest and largest value.
Definition: int.hh:4512
Tuple * tuple_data
Tuple index data.
Definition: int.hh:2183
With highest action.
Definition: int.hh:4232
With smallest CHB Q-score divided by domain size.
Definition: int.hh:4247
With largest degree.
Definition: int.hh:4228
std::function< int(const Space &home, BoolVar x, int i)> BoolBranchVal
Branch value function type for Boolean variables.
Definition: int.hh:3901
void nooverlap(Home home, const IntVarArgs &x, const IntArgs &w, const IntVarArgs &y, const IntArgs &h, IntPropLevel)
Post propagator for rectangle packing.
Definition: no-overlap.cpp:55
Boolean variable array.
Definition: int.hh:789
Boolean integer variables.
Definition: int.hh:494
Prefer to save memory Options: basic versus advanced propagation.
Definition: int.hh:963
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:4201
Post propagator for SetVar SetOpType SetVar SetRelType r
Definition: set.hh:784
const int v[7]
Definition: distinct.cpp:263
Propagator for recording view trace information.
Class represeting a set of tuples.
Definition: int.hh:2161
IntVarBranch INT_VAR_DEGREE_MIN(BranchTbl tbl)
Select variable with smallest degree.
Definition: var.hpp:120
TieBreak< VarBranch > tiebreak(VarBranch a, VarBranch b)
Combine variable selection criteria a and b for tie-breaking.
With smallest degree divided by domain size.
Definition: int.hh:4241
With smallest max.
Definition: int.hh:4237
IntValBranch INT_VAL_MAX(void)
Select largest value.
Definition: val.hpp:69
IntVarBranch INT_VAR_CHB_MIN(IntCHB c, BranchTbl tbl)
Select variable with lowest CHB Q-score.
Definition: var.hpp:170
IntPropLevel
Propagation levels for integer propagators.
Definition: int.hh:955
IntPropLevel ba(IntPropLevel ipl)
Extract basic or advanced from propagation level.
Definition: ipl.hpp:53
IntVarBranch INT_VAR_SIZE_MIN(BranchTbl tbl)
Select variable with smallest domain size.
Definition: var.hpp:210
Post propagator for f(x \diamond_{\mathit{op}} y) \sim_r z \f$ void rel(Home home
Integer view for integer variables.
Definition: view.hpp:129
const int infinity
Infinity for integers.
Definition: int.hh:120
Select the largest range of the variable domain if it has several ranges, otherwise select values gre...
Definition: int.hh:4514
Post propagator for SetVar SetOpType SetVar y
Definition: set.hh:784
BoolVarArgs(int n)
Allocate array with n elements.
Definition: int.hh:700
Value branching information.
Definition: branch-val.hpp:45
Trace done events.
BoolVarBranch BOOL_VAR_AFC_MAX(double d, BranchTbl tbl)
Select variable with largest accumulated failure count with decay factor d.
Definition: var.hpp:408
void div(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition: arithmetic.cpp:131
void relax(Home home, const FloatVarArgs &x, const FloatVarArgs &sx, Rnd r, double p)
Definition: relax.cpp:61
IntValBranch INT_VALUES_MIN(void)
Try all values starting from smallest.
Definition: val.hpp:104
Variable branching information.
Definition: branch-var.hpp:59
std::function< bool(const Space &home, BoolVar x, int i)> BoolBranchFilter
Branch filter function type for Boolean variables.
Definition: int.hh:3853
bool overflow_sub(int n, int m)
Check whether subtracting m from n would overflow.
Definition: limits.hpp:97
Select values not greater than mean of smallest and largest value.
Definition: int.hh:4511
BoolVarBranch BOOL_VAR_DEGREE_MAX(BranchTbl tbl)
Select variable with largest degree.
Definition: var.hpp:393
Generic domain change information to be supplied to advisors.
Definition: core.hpp:281
With highest CHB Q-score.
Definition: int.hh:4234
IntVarBranch INT_VAR_MIN_MAX(BranchTbl tbl)
Select variable with largest min.
Definition: var.hpp:195
IntValBranch INT_VALUES_MAX(void)
Try all values starting from largest.
Definition: val.hpp:109
Select
Which value selection.
Definition: int.hh:4541
void precede(Home home, const IntVarArgs &x, int s, int t, IntPropLevel)
Post propagator that s precedes t in x.
Definition: precede.cpp:47
Integer variables.
Definition: int.hh:353
With lowest CHB Q-score.
Definition: int.hh:4233
IntVarBranch INT_VAR_ACTION_MIN(double d, BranchTbl tbl)
Select variable with lowest action with decay factor d.
Definition: var.hpp:150
Select random value.
Definition: int.hh:4510
BoolVarBranch BOOL_VAR_ACTION_MAX(double d, BranchTbl tbl)
Select variable with highest action with decay factor d.
Definition: var.hpp:428
IntVarBranch INT_VAR_AFC_SIZE_MIN(double d, BranchTbl tbl)
Select variable with smallest accumulated failure count divided by domain size with decay factor d...
Definition: var.hpp:230
Which values to select for assignment.
Definition: int.hh:4620
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
Definition: rel.cpp:47
Trace delta information for integer variables.
Definition: int.hh:5058
SymmetryHandle values_reflect(int lower, int upper)
The values from lower to upper (inclusive) can be reflected.
Definition: ldsb.cpp:110
IntVarBranch INT_VAR_REGRET_MAX_MIN(BranchTbl tbl)
Select variable with smallest max-regret.
Definition: var.hpp:300
Sort ranges according to increasing minimum.
Definition: int-set.cpp:84
Domain propagation Preferences: prefer speed or memory.
Definition: int.hh:960
Select
Which variable selection.
Definition: int.hh:4222
bool valid(int n)
Return whether n is in range.
Definition: limits.hpp:41
Value iterator for integer sets.
Definition: int.hh:315
Equivalence.
Definition: int.hh:935
IntValBranch INT_VAL_MED(void)
Select greatest value not greater than the median.
Definition: val.hpp:64
With smallest action divided by domain size.
Definition: int.hh:4245
IntVarBranch INT_VAR_ACTION_SIZE_MIN(double d, BranchTbl tbl)
Select variable with smallest action divided by domain size with decay factor d.
Definition: var.hpp:250
Data stored for a DFA.
Definition: dfa.hpp:46
IntVarBranch INT_VAR_MAX_MIN(BranchTbl tbl)
Select variable with smallest max.
Definition: var.hpp:200
Iterator for DFA transitions (sorted by symbols)
Definition: int.hh:2051
Int::LDSB::SymmetryObject * ref
Symmetry object that this handle refers to.
Definition: int.hh:4840
PrimArgArray< TaskType > TaskTypeArgs
Argument arrays for passing task type arguments.
Definition: int.hh:1001
IntVarBranch INT_VAR_REGRET_MAX_MAX(BranchTbl tbl)
Select variable with largest max-regret.
Definition: var.hpp:305
Random (uniform, for tie breaking)
Definition: int.hh:4224
Select
Which variable selection.
Definition: int.hh:4308
With largest degree.
Definition: int.hh:4314
Trace fail events.
With smallest domain size.
Definition: int.hh:4239
Post propagator for SetVar x
Definition: set.hh:784
The shared object.
Definition: core.hpp:88
Trace fixpoint events.
std::ostream & os
Output stream to use.
Definition: int.hh:5134
Select
Which value selection.
Definition: int.hh:4506
BoolVarBranch BOOL_VAR_RND(Rnd r)
Select random variable (uniform distribution, for tie breaking)
Definition: var.hpp:373
std::function< void(const Space &home, const Brancher &b, unsigned int a, BoolVar x, int i, const int &n, std::ostream &o)> BoolVarValPrint
Function type for printing branching alternatives for Boolean variables.
Definition: int.hh:4208
IntVarBranch INT_VAR_CHB_MAX(IntCHB c, BranchTbl tbl)
Select variable with largest CHB Q-score.
Definition: var.hpp:180
Recording CHB for Boolean variables.
Definition: int.hh:4151
Select greatest value not greater than the median.
Definition: int.hh:4625
static StdBoolTracer def
Default tracer (printing to std::cerr)
Definition: int.hh:5188
void trace(Home home, const FloatVarArgs &x, TraceFilter tf, int te, FloatTracer &t)
Create a tracer for float variables.
Definition: trace.cpp:43
ViewTraceRecorder< Int::BoolView > BoolTraceRecorder
Trace recorder for Boolean variables.
Definition: int.hh:5163
SymmetryHandle VariableSequenceSymmetry(const IntVarArgs &vars, int ss)
Variable sequences in x of size ss are interchangeable.
Definition: ldsb.cpp:94
const long long int llmax
Largest allowed long long integer value.
Definition: int.hh:122
With highest merit.
Definition: int.hh:4226
Traits of arrays in Gecode.
Definition: array.hpp:68
IntValBranch INT_VAL_SPLIT_MIN(void)
Select values not greater than mean of smallest and largest value.
Definition: val.hpp:79
int size
Number of Tuples.
Definition: int.hh:2179
With largest min.
Definition: int.hh:4236
BoolValBranch BOOL_VAL(BoolBranchVal v, BoolBranchCommit c)
Select value as defined by the value function v and commit function c Uses a commit function as defau...
Definition: val.hpp:149
Gecode toplevel namespace
Argument array for variables.
Definition: array.hpp:53
With highest merit.
Definition: int.hh:4312
Implication for reification.
Definition: int.hh:843
Class for action management.
Definition: action.hpp:46
BoolVarBranch BOOL_VAR_CHB_MIN(BoolCHB c, BranchTbl tbl)
Select variable with lowest CHB Q-score.
Definition: var.hpp:438
#define GECODE_VTABLE_EXPORT
Definition: support.hh:76
Range iterator for computing set difference.
Definition: ranges-diff.hpp:47
Disequality ( )
Definition: int.hh:908
BoolVar x
The Boolean control variable.
Definition: int.hh:860
BoolVarBranch BOOL_VAR_MERIT_MAX(BoolBranchMerit bm, BranchTbl tbl)
Select variable with highest merit according to branch merit function bm.
Definition: var.hpp:383
Random number generator.
Definition: rnd.hpp:46
Select largest value.
Definition: int.hh:4509
IntVarBranch INT_VAR_DEGREE_SIZE_MIN(BranchTbl tbl)
Select variable with smallest degree divided by domain size.
Definition: var.hpp:220
#define GECODE_INT_EXPORT
Definition: int.hh:81
const long long int llinfinity
Infinity for long long integers.
Definition: int.hh:126
void cumulative(Home home, int c, const TaskTypeArgs &t, const IntVarArgs &s, const IntArgs &p, const IntArgs &u, IntPropLevel ipl)
Post propagators for scheduling tasks on cumulative resources.
Definition: cumulative.cpp:357
void assign(Home home, const FloatVarArgs &x, FloatAssign fa, FloatBranchFilter bf, FloatVarValPrint vvp)
Assign all x with value selection vals.
Definition: branch.cpp:115
void check(int n, const char *l)
Check whether n is in range, otherwise throw out of limits with information l.
Definition: limits.hpp:50
Home class for posting propagators
Definition: core.hpp:922
double tbl(const Gecode::Space &, double w, double b)
Test function for tie-break limit function.
Definition: branch.cpp:65
std::function< double(const Space &home, IntVar x, int i)> IntBranchMerit
Branch merit function type for integer variables.
Definition: int.hh:3865
ReifyMode
Mode for reification.
Definition: int.hh:829
Select value according to user-defined functions.
Definition: int.hh:4515
ReifyMode rm
The reification mode.
Definition: int.hh:862
void positive(int n, const char *l)
Check whether n is in range and strictly positive, otherwise throw out of limits with information l...
Definition: limits.hpp:61
Trace delta information for Boolean variables.
Definition: int.hh:5078
void unary(Home home, const IntVarArgs &s, const IntArgs &p, IntPropLevel ipl)
Post propagators for scheduling tasks on unary resources.
Definition: unary.cpp:48
void ite(Home home, BoolVar b, FloatVar x, FloatVar y, FloatVar z)
Post propagator for if-then-else constraint.
Definition: bool.cpp:43
Recording actions for integer variables.
Definition: int.hh:4011
Select largest value.
Definition: int.hh:4543
Select largest value.
Definition: int.hh:4626
int delta
Delta information.
Definition: int.hh:5081
void element(Home home, IntSharedArray c, IntVar x0, IntVar x1, IntPropLevel)
Post domain consistent propagator for .
Definition: element.cpp:43
void when(Home home, BoolVar x, std::function< void(Space &home)> t, std::function< void(Space &home)> e, IntPropLevel)
Execute t (then) when x is assigned one, and e (else) otherwise.
Definition: exec.cpp:75
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:3930
IntVarBranch INT_VAR_ACTION_SIZE_MAX(double d, BranchTbl tbl)
Select variable with largest action divided by domain size with decay factor d.
Definition: var.hpp:260
Select all values starting from smallest.
Definition: int.hh:4516
With smallest accumulated failure count divided by domain size.
Definition: int.hh:4243
void clause(Home home, BoolOpType o, const BoolVarArgs &x, const BoolVarArgs &y, int n, IntPropLevel)
Post domain consistent propagator for Boolean clause with positive variables x and negative variables...
Definition: bool.cpp:910
Equivalence for reification (default)
Definition: int.hh:836
IntRelType swap(IntRelType irt)
Return swapped relation type of irt.
Definition: irt.hpp:41
Reify pmi(BoolVar x)
Use reverse implication for reification.
Definition: reify.hpp:81
Boolean view for Boolean variables.
Definition: view.hpp:1315
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.