Generated on Mon Sep 22 2014 12:49:25 for Gecode by doxygen 1.8.7
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  * Mikael Lagerkvist <lagerkvist@gecode.org>
9  * David Rijsman <David.Rijsman@quintiq.com>
10  *
11  * Copyright:
12  * David Rijsman, 2009
13  * Mikael Lagerkvist, 2006
14  * Christian Schulte, 2002
15  * Guido Tack, 2004
16  *
17  * Last modified:
18  * $Date: 2013-07-23 14:31:03 +0200 (Tue, 23 Jul 2013) $ by $Author: schulte $
19  * $Revision: 13939 $
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 #include <iostream>
52 
53 #include <vector>
54 
55 #include <gecode/kernel.hh>
56 #include <gecode/iter.hh>
57 
58 /*
59  * Configure linking
60  *
61  */
62 #if !defined(GECODE_STATIC_LIBS) && \
63  (defined(__CYGWIN__) || defined(__MINGW32__) || defined(_MSC_VER))
64 
65 #ifdef GECODE_BUILD_INT
66 #define GECODE_INT_EXPORT __declspec( dllexport )
67 #else
68 #define GECODE_INT_EXPORT __declspec( dllimport )
69 #endif
70 
71 #else
72 
73 #ifdef GECODE_GCC_HAS_CLASS_VISIBILITY
74 #define GECODE_INT_EXPORT __attribute__ ((visibility("default")))
75 #else
76 #define GECODE_INT_EXPORT
77 #endif
78 
79 #endif
80 
81 // Configure auto-linking
82 #ifndef GECODE_BUILD_INT
83 #define GECODE_LIBRARY_NAME "Int"
85 #endif
86 
98 #include <gecode/int/exception.hpp>
99 
100 namespace Gecode { namespace Int {
101 
109  namespace Limits {
111  const int max = INT_MAX - 1;
113  const int min = -max;
115  const int infinity = max + 1;
117  const long long int llmax = LLONG_MAX - 1;
119  const long long int llmin = -llmax;
121  const long long int llinfinity = llmax + 1;
123  bool valid(int n);
125  bool valid(long long int n);
127  void check(int n, const char* l);
129  void check(long long int n, const char* l);
131  void positive(int n, const char* l);
133  void positive(long long int n, const char* l);
135  void nonnegative(int n, const char* l);
137  void nonnegative(long long int n, const char* l);
139  bool overflow_add(int n, int m);
141  bool overflow_add(long long int n, long long int m);
143  bool overflow_sub(int n, int m);
145  bool overflow_sub(long long int n, long long int m);
147  bool overflow_mul(int n, int m);
149  bool overflow_mul(long long int n, long long int m);
150  }
151 
152 }}
153 
154 #include <gecode/int/limits.hpp>
155 
156 namespace Gecode {
157 
158  class IntSetRanges;
159 
160  template<class I> class IntSetInit;
161 
169  class IntSet : public SharedHandle {
170  friend class IntSetRanges;
171  template<class I> friend class IntSetInit;
172  private:
174  class Range {
175  public:
176  int min, max;
177  };
178  class IntSetObject : public SharedHandle::Object {
179  public:
181  unsigned int size;
183  int n;
185  Range* r;
187  GECODE_INT_EXPORT static IntSetObject* allocate(int m);
189  GECODE_INT_EXPORT SharedHandle::Object* copy(void) const;
191  GECODE_INT_EXPORT bool in(int n) const;
193  GECODE_INT_EXPORT virtual ~IntSetObject(void);
194  };
196  class MinInc;
198  GECODE_INT_EXPORT void normalize(Range* r, int n);
200  GECODE_INT_EXPORT void init(int n, int m);
202  GECODE_INT_EXPORT void init(const int r[], int n);
204  GECODE_INT_EXPORT void init(const int r[][2], int n);
205  public:
207 
208  IntSet(void);
214  IntSet(int n, int m);
216  IntSet(const int r[], int n);
222  IntSet(const int r[][2], int n);
224  template<class I>
225  explicit IntSet(I& i);
227  template<class I>
228  explicit IntSet(const I& i);
230 
232 
233  int ranges(void) const;
236  int min(int i) const;
238  int max(int i) const;
240  unsigned int width(int i) const;
242 
244 
245  bool in(int n) const;
248  unsigned int size(void) const;
250  unsigned int width(void) const;
252  int min(void) const;
254  int max(void) const;
256 
258 
259  GECODE_INT_EXPORT static const IntSet empty;
262  };
263 
269  class IntSetRanges {
270  private:
272  const IntSet::Range* i;
274  const IntSet::Range* e;
275  public:
277 
278  IntSetRanges(void);
281  IntSetRanges(const IntSet& s);
283  void init(const IntSet& s);
285 
287 
288  bool operator ()(void) const;
291  void operator ++(void);
293 
295 
296  int min(void) const;
299  int max(void) const;
301  unsigned int width(void) const;
303  };
304 
310  class IntSetValues : public Iter::Ranges::ToValues<IntSetRanges> {
311  public:
313 
314  IntSetValues(void);
317  IntSetValues(const IntSet& s);
319  void init(const IntSet& s);
321  };
322 
327  template<class Char, class Traits>
328  std::basic_ostream<Char,Traits>&
329  operator <<(std::basic_ostream<Char,Traits>& os, const IntSet& s);
330 
331 }
332 
333 #include <gecode/int/int-set-1.hpp>
334 
335 #include <gecode/int/var-imp.hpp>
336 
337 namespace Gecode {
338 
339  namespace Int {
340  class IntView;
341  }
342 
348  class IntVar : public VarImpVar<Int::IntVarImp> {
349  friend class IntVarArray;
350  friend class IntVarArgs;
351  private:
359  void _init(Space& home, int min, int max);
366  void _init(Space& home, const IntSet& d);
367  public:
369 
370  IntVar(void);
373  IntVar(const IntVar& y);
375  IntVar(const Int::IntView& y);
387  GECODE_INT_EXPORT IntVar(Space& home, int min, int max);
399  GECODE_INT_EXPORT IntVar(Space& home, const IntSet& d);
401 
403 
404  int min(void) const;
407  int max(void) const;
409  int med(void) const;
417  int val(void) const;
418 
420  unsigned int size(void) const;
422  unsigned int width(void) const;
424  unsigned int regret_min(void) const;
426  unsigned int regret_max(void) const;
428 
430 
431  bool range(void) const;
434  bool in(int n) const;
436  };
437 
442  template<class Char, class Traits>
443  std::basic_ostream<Char,Traits>&
444  operator <<(std::basic_ostream<Char,Traits>& os, const IntVar& x);
445 
451  public:
453 
454  IntVarRanges(void);
457  IntVarRanges(const IntVar& x);
459  void init(const IntVar& x);
461  };
462 
467  class IntVarValues : public Iter::Ranges::ToValues<IntVarRanges> {
468  public:
470 
471  IntVarValues(void);
474  IntVarValues(const IntVar& x);
476  void init(const IntVar& x);
478  };
479 
480  namespace Int {
481  class BoolView;
482  }
483 
489  class BoolVar : public VarImpVar<Int::BoolVarImp> {
490  friend class BoolVarArray;
491  friend class BoolVarArgs;
492  private:
500  void _init(Space& home, int min, int max);
501  public:
503 
504  BoolVar(void);
507  BoolVar(const BoolVar& y);
509  BoolVar(const Int::BoolView& y);
521  GECODE_INT_EXPORT BoolVar(Space& home, int min, int max);
523 
525 
526  int min(void) const;
529  int max(void) const;
531  int med(void) const;
539  int val(void) const;
540 
542  unsigned int size(void) const;
544  unsigned int width(void) const;
546  unsigned int regret_min(void) const;
548  unsigned int regret_max(void) const;
550 
552 
553  bool range(void) const;
556  bool in(int n) const;
558 
560 
561  bool zero(void) const;
564  bool one(void) const;
566  bool none(void) const;
568  };
569 
574  template<class Char, class Traits>
575  std::basic_ostream<Char,Traits>&
576  operator <<(std::basic_ostream<Char,Traits>& os, const BoolVar& x);
577 
578 }
579 
580 
581 #include <gecode/int/view.hpp>
582 #include <gecode/int/propagator.hpp>
583 
584 namespace Gecode {
585 
595  typedef ArgArray<IntSet> IntSetArgs;
597 
598 }
599 
601 
602 namespace Gecode {
603 
605  class IntArgs : public PrimArgArray<int> {
606  public:
608 
609  IntArgs(void);
612  explicit IntArgs(int n);
614  IntArgs(const SharedArray<int>& x);
616  IntArgs(const std::vector<int>& x);
618  template<class InputIterator>
619  IntArgs(InputIterator first, InputIterator last);
622  IntArgs(int n, int e0, ...);
624  IntArgs(int n, const int* e);
626  IntArgs(const PrimArgArray<int>& a);
627 
629  static IntArgs create(int n, int start, int inc=1);
631  };
632 
634  class IntVarArgs : public VarArgArray<IntVar> {
635  public:
637 
638  IntVarArgs(void) {}
641  explicit IntVarArgs(int n) : VarArgArray<IntVar>(n) {}
647  IntVarArgs(const std::vector<IntVar>& a) : VarArgArray<IntVar>(a) {}
649  template<class InputIterator>
650  IntVarArgs(InputIterator first, InputIterator last)
651  : VarArgArray<IntVar>(first,last) {}
664  IntVarArgs(Space& home, int n, int min, int max);
677  IntVarArgs(Space& home, int n, const IntSet& s);
679  };
688  class BoolVarArgs : public VarArgArray<BoolVar> {
689  public:
691 
692  BoolVarArgs(void) {}
695  explicit BoolVarArgs(int n) : VarArgArray<BoolVar>(n) {}
700  : VarArgArray<BoolVar>(a) {}
702  BoolVarArgs(const std::vector<BoolVar>& a) : VarArgArray<BoolVar>(a) {}
704  template<class InputIterator>
705  BoolVarArgs(InputIterator first, InputIterator last)
706  : VarArgArray<BoolVar>(first,last) {}
719  BoolVarArgs(Space& home, int n, int min, int max);
721  };
723 
739  class IntVarArray : public VarArray<IntVar> {
740  public:
742 
743  IntVarArray(void);
746  IntVarArray(Space& home, int n);
748  IntVarArray(const IntVarArray& a);
750  IntVarArray(Space& home, const IntVarArgs& a);
763  IntVarArray(Space& home, int n, int min, int max);
776  IntVarArray(Space& home, int n, const IntSet& s);
778  };
779 
784  class BoolVarArray : public VarArray<BoolVar> {
785  public:
787 
788  BoolVarArray(void);
791  BoolVarArray(Space& home, int n);
793  BoolVarArray(const BoolVarArray& a);
795  BoolVarArray(Space& home, const BoolVarArgs& a);
808  BoolVarArray(Space& home, int n, int min, int max);
810  };
811 
812 }
813 
814 #include <gecode/int/int-set-2.hpp>
815 
816 #include <gecode/int/array.hpp>
817 
818 namespace Gecode {
819 
824  enum ReifyMode {
846  };
847 
852  class Reify {
853  protected:
858  public:
860  Reify(void);
864  BoolVar var(void) const;
866  ReifyMode mode(void) const;
868  void var(BoolVar x);
870  void mode(ReifyMode rm);
871  };
872 
877  Reify eqv(BoolVar x);
878 
883  Reify imp(BoolVar x);
884 
889  Reify pmi(BoolVar x);
890 
891 }
892 
893 #include <gecode/int/reify.hpp>
894 
895 namespace Gecode {
896 
901  enum IntRelType {
908  };
909 
914  enum BoolOpType {
920  };
921 
935  enum IntConLevel {
940  };
941 
947  enum TaskType {
948  TT_FIXP, //< Task with fixed processing time
949  TT_FIXS, //< Task with fixed start time
950  TT_FIXE //< Task with fixed end time
951  };
952 
959 
961  template<>
963  public:
967  };
968 
969 
977  GECODE_INT_EXPORT void
979  dom(Home home, IntVar x, int n,
980  IntConLevel icl=ICL_DEF);
982  GECODE_INT_EXPORT void
983  dom(Home home, const IntVarArgs& x, int n,
984  IntConLevel icl=ICL_DEF);
985 
987  GECODE_INT_EXPORT void
988  dom(Home home, IntVar x, int l, int m,
989  IntConLevel icl=ICL_DEF);
991  GECODE_INT_EXPORT void
992  dom(Home home, const IntVarArgs& x, int l, int m,
993  IntConLevel icl=ICL_DEF);
994 
996  GECODE_INT_EXPORT void
997  dom(Home home, IntVar x, const IntSet& s,
998  IntConLevel icl=ICL_DEF);
1000  GECODE_INT_EXPORT void
1001  dom(Home home, const IntVarArgs& x, const IntSet& s,
1002  IntConLevel icl=ICL_DEF);
1003 
1005  GECODE_INT_EXPORT void
1006  dom(Home home, IntVar x, int n, Reify r,
1007  IntConLevel icl=ICL_DEF);
1009  GECODE_INT_EXPORT void
1010  dom(Home home, IntVar x, int l, int m, Reify r,
1011  IntConLevel icl=ICL_DEF);
1013  GECODE_INT_EXPORT void
1014  dom(Home home, IntVar x, const IntSet& s, Reify r,
1015  IntConLevel icl=ICL_DEF);
1016 
1018  GECODE_INT_EXPORT void
1019  dom(Home home, IntVar x, IntVar d,
1020  IntConLevel icl=ICL_DEF);
1022  GECODE_INT_EXPORT void
1023  dom(Home home, BoolVar x, BoolVar d,
1024  IntConLevel icl=ICL_DEF);
1026  GECODE_INT_EXPORT void
1027  dom(Home home, const IntVarArgs& x, const IntVarArgs& d,
1028  IntConLevel icl=ICL_DEF);
1030  GECODE_INT_EXPORT void
1031  dom(Home home, const BoolVarArgs& x, const BoolVarArgs& d,
1032  IntConLevel icl=ICL_DEF);
1034 
1035 
1046  GECODE_INT_EXPORT void
1047  rel(Home home, IntVar x0, IntRelType irt, IntVar x1,
1048  IntConLevel icl=ICL_DEF);
1055  GECODE_INT_EXPORT void
1056  rel(Home home, const IntVarArgs& x, IntRelType irt, IntVar y,
1057  IntConLevel icl=ICL_DEF);
1061  GECODE_INT_EXPORT void
1062  rel(Home home, IntVar x, IntRelType irt, int c,
1063  IntConLevel icl=ICL_DEF);
1067  GECODE_INT_EXPORT void
1068  rel(Home home, const IntVarArgs& x, IntRelType irt, int c,
1069  IntConLevel icl=ICL_DEF);
1076  GECODE_INT_EXPORT void
1077  rel(Home home, IntVar x0, IntRelType irt, IntVar x1, Reify r,
1078  IntConLevel icl=ICL_DEF);
1085  GECODE_INT_EXPORT void
1086  rel(Home home, IntVar x, IntRelType irt, int c, Reify r,
1087  IntConLevel icl=ICL_DEF);
1102  GECODE_INT_EXPORT void
1103  rel(Home home, const IntVarArgs& x, IntRelType irt,
1104  IntConLevel icl=ICL_DEF);
1119  GECODE_INT_EXPORT void
1120  rel(Home home, const IntVarArgs& x, IntRelType irt, const IntVarArgs& y,
1121  IntConLevel icl=ICL_DEF);
1122 
1130  GECODE_INT_EXPORT void
1131  rel(Home home, BoolVar x0, IntRelType irt, BoolVar x1,
1132  IntConLevel icl=ICL_DEF);
1136  GECODE_INT_EXPORT void
1137  rel(Home home, BoolVar x0, IntRelType irt, BoolVar x1, Reify r,
1138  IntConLevel icl=ICL_DEF);
1142  GECODE_INT_EXPORT void
1143  rel(Home home, const BoolVarArgs& x, IntRelType irt, BoolVar y,
1144  IntConLevel icl=ICL_DEF);
1152  GECODE_INT_EXPORT void
1153  rel(Home home, BoolVar x, IntRelType irt, int n,
1154  IntConLevel icl=ICL_DEF);
1162  GECODE_INT_EXPORT void
1163  rel(Home home, BoolVar x, IntRelType irt, int n, Reify r,
1164  IntConLevel icl=ICL_DEF);
1172  GECODE_INT_EXPORT void
1173  rel(Home home, const BoolVarArgs& x, IntRelType irt, int n,
1174  IntConLevel icl=ICL_DEF);
1184  GECODE_INT_EXPORT void
1185  rel(Home home, const BoolVarArgs& x, IntRelType irt, const BoolVarArgs& y,
1186  IntConLevel icl=ICL_DEF);
1197  GECODE_INT_EXPORT void
1198  rel(Home home, const BoolVarArgs& x, IntRelType irt,
1199  IntConLevel icl=ICL_DEF);
1205  GECODE_INT_EXPORT void
1206  rel(Home home, BoolVar x0, BoolOpType o, BoolVar x1, BoolVar x2,
1207  IntConLevel icl=ICL_DEF);
1216  GECODE_INT_EXPORT void
1217  rel(Home home, BoolVar x0, BoolOpType o, BoolVar x1, int n,
1218  IntConLevel icl=ICL_DEF);
1228  GECODE_INT_EXPORT void
1229  rel(Home home, BoolOpType o, const BoolVarArgs& x, BoolVar y,
1230  IntConLevel icl=ICL_DEF);
1243  GECODE_INT_EXPORT void
1244  rel(Home home, BoolOpType o, const BoolVarArgs& x, int n,
1245  IntConLevel icl=ICL_DEF);
1256  GECODE_INT_EXPORT void
1257  clause(Home home, BoolOpType o, const BoolVarArgs& x, const BoolVarArgs& y,
1258  BoolVar z, IntConLevel icl=ICL_DEF);
1272  GECODE_INT_EXPORT void
1273  clause(Home home, BoolOpType o, const BoolVarArgs& x, const BoolVarArgs& y,
1274  int n, IntConLevel icl=ICL_DEF);
1281  GECODE_INT_EXPORT void
1282  ite(Home home, BoolVar b, IntVar x, IntVar y, IntVar z,
1283  IntConLevel icl=ICL_DEF);
1284 
1285 
1297  GECODE_INT_EXPORT void
1298  precede(Home home, const IntVarArgs& x, int s, int t,
1307  GECODE_INT_EXPORT void
1308  precede(Home home, const IntVarArgs& x, const IntArgs& c,
1310 
1311 
1317  GECODE_INT_EXPORT void
1319  member(Home home, const IntVarArgs& x, IntVar y,
1320  IntConLevel icl=ICL_DEF);
1322  GECODE_INT_EXPORT void
1323  member(Home home, const BoolVarArgs& x, BoolVar y,
1324  IntConLevel icl=ICL_DEF);
1326  GECODE_INT_EXPORT void
1327  member(Home home, const IntVarArgs& x, IntVar y, Reify r,
1328  IntConLevel icl=ICL_DEF);
1330  GECODE_INT_EXPORT void
1331  member(Home home, const BoolVarArgs& x, BoolVar y, Reify r,
1332  IntConLevel icl=ICL_DEF);
1334 
1335 
1349  GECODE_INT_EXPORT void
1350  element(Home home, IntSharedArray n, IntVar x0, IntVar x1,
1351  IntConLevel icl=ICL_DEF);
1357  GECODE_INT_EXPORT void
1358  element(Home home, IntSharedArray n, IntVar x0, BoolVar x1,
1359  IntConLevel icl=ICL_DEF);
1365  GECODE_INT_EXPORT void
1366  element(Home home, IntSharedArray n, IntVar x0, int x1,
1367  IntConLevel icl=ICL_DEF);
1373  GECODE_INT_EXPORT void
1374  element(Home home, const IntVarArgs& x, IntVar y0, IntVar y1,
1375  IntConLevel icl=ICL_DEF);
1381  GECODE_INT_EXPORT void
1382  element(Home home, const IntVarArgs& x, IntVar y0, int y1,
1383  IntConLevel icl=ICL_DEF);
1385  GECODE_INT_EXPORT void
1386  element(Home home, const BoolVarArgs& x, IntVar y0, BoolVar y1,
1387  IntConLevel icl=ICL_DEF);
1389  GECODE_INT_EXPORT void
1390  element(Home home, const BoolVarArgs& x, IntVar y0, int y1,
1391  IntConLevel icl=ICL_DEF);
1392 
1405  GECODE_INT_EXPORT void
1406  element(Home home, IntSharedArray a,
1407  IntVar x, int w, IntVar y, int h, IntVar z,
1408  IntConLevel icl=ICL_DEF);
1421  GECODE_INT_EXPORT void
1422  element(Home home, IntSharedArray a,
1423  IntVar x, int w, IntVar y, int h, BoolVar z,
1424  IntConLevel icl=ICL_DEF);
1440  GECODE_INT_EXPORT void
1441  element(Home home, const IntVarArgs& a,
1442  IntVar x, int w, IntVar y, int h, IntVar z,
1443  IntConLevel icl=ICL_DEF);
1456  GECODE_INT_EXPORT void
1457  element(Home home, const BoolVarArgs& a,
1458  IntVar x, int w, IntVar y, int h, BoolVar z,
1459  IntConLevel icl=ICL_DEF);
1461 
1462 
1477  GECODE_INT_EXPORT void
1478  distinct(Home home, const IntVarArgs& x,
1479  IntConLevel icl=ICL_DEF);
1492  GECODE_INT_EXPORT void
1493  distinct(Home home, const IntArgs& n, const IntVarArgs& x,
1494  IntConLevel icl=ICL_DEF);
1496 
1497 
1515  GECODE_INT_EXPORT void
1516  channel(Home home, const IntVarArgs& x, const IntVarArgs& y,
1517  IntConLevel icl=ICL_DEF);
1518 
1532  GECODE_INT_EXPORT void
1533  channel(Home home, const IntVarArgs& x, int xoff,
1534  const IntVarArgs& y, int yoff,
1535  IntConLevel icl=ICL_DEF);
1536 
1538  GECODE_INT_EXPORT void
1539  channel(Home home, BoolVar x0, IntVar x1,
1540  IntConLevel icl=ICL_DEF);
1542  forceinline void
1543  channel(Home home, IntVar x0, BoolVar x1,
1544  IntConLevel icl=ICL_DEF) {
1545  channel(home,x1,x0,icl);
1546  }
1552  GECODE_INT_EXPORT void
1553  channel(Home home, const BoolVarArgs& x, IntVar y, int o=0,
1554  IntConLevel icl=ICL_DEF);
1556 
1557 
1574  GECODE_INT_EXPORT void
1575  sorted(Home home, const IntVarArgs& x, const IntVarArgs& y,
1576  IntConLevel icl=ICL_DEF);
1577 
1589  GECODE_INT_EXPORT void
1590  sorted(Home home, const IntVarArgs& x, const IntVarArgs& y,
1591  const IntVarArgs& z,
1592  IntConLevel icl=ICL_DEF);
1594 
1595 
1614  GECODE_INT_EXPORT void
1615  count(Home home, const IntVarArgs& x, int n, IntRelType irt, int m,
1616  IntConLevel icl=ICL_DEF);
1621  GECODE_INT_EXPORT void
1622  count(Home home, const IntVarArgs& x, const IntSet& y, IntRelType irt, int m,
1623  IntConLevel icl=ICL_DEF);
1631  GECODE_INT_EXPORT void
1632  count(Home home, const IntVarArgs& x, IntVar y, IntRelType irt, int m,
1633  IntConLevel icl=ICL_DEF);
1641  GECODE_INT_EXPORT void
1642  count(Home home, const IntVarArgs& x, const IntArgs& y, IntRelType irt, int m,
1643  IntConLevel icl=ICL_DEF);
1648  GECODE_INT_EXPORT void
1649  count(Home home, const IntVarArgs& x, int n, IntRelType irt, IntVar z,
1650  IntConLevel icl=ICL_DEF);
1655  GECODE_INT_EXPORT void
1656  count(Home home, const IntVarArgs& x, const IntSet& y, IntRelType irt, IntVar z,
1657  IntConLevel icl=ICL_DEF);
1665  GECODE_INT_EXPORT void
1666  count(Home home, const IntVarArgs& x, IntVar y, IntRelType irt, IntVar z,
1667  IntConLevel icl=ICL_DEF);
1675  GECODE_INT_EXPORT void
1676  count(Home home, const IntVarArgs& x, const IntArgs& y, IntRelType irt, IntVar z,
1677  IntConLevel icl=ICL_DEF);
1678 
1692  GECODE_INT_EXPORT void
1693  count(Home home, const IntVarArgs& x, const IntVarArgs& c,
1694  IntConLevel icl=ICL_DEF);
1695 
1709  GECODE_INT_EXPORT void
1710  count(Home home, const IntVarArgs& x, const IntSetArgs& c,
1711  IntConLevel icl=ICL_DEF);
1712 
1729  GECODE_INT_EXPORT void
1730  count(Home home, const IntVarArgs& x,
1731  const IntVarArgs& c, const IntArgs& v,
1732  IntConLevel icl=ICL_DEF);
1733 
1750  GECODE_INT_EXPORT void
1751  count(Home home, const IntVarArgs& x,
1752  const IntSetArgs& c, const IntArgs& v,
1753  IntConLevel icl=ICL_DEF);
1754 
1771  GECODE_INT_EXPORT void
1772  count(Home home, const IntVarArgs& x,
1773  const IntSet& c, const IntArgs& v,
1774  IntConLevel icl=ICL_DEF);
1775 
1777 
1792  GECODE_INT_EXPORT void
1793  nvalues(Home home, const IntVarArgs& x, IntRelType irt, int y,
1794  IntConLevel icl=ICL_DEF);
1798  GECODE_INT_EXPORT void
1799  nvalues(Home home, const IntVarArgs& x, IntRelType irt, IntVar y,
1800  IntConLevel icl=ICL_DEF);
1804  GECODE_INT_EXPORT void
1805  nvalues(Home home, const BoolVarArgs& x, IntRelType irt, int y,
1806  IntConLevel icl=ICL_DEF);
1810  GECODE_INT_EXPORT void
1811  nvalues(Home home, const BoolVarArgs& x, IntRelType irt, IntVar y,
1812  IntConLevel icl=ICL_DEF);
1814 
1835  GECODE_INT_EXPORT void
1836  sequence(Home home, const IntVarArgs& x, const IntSet& s,
1837  int q, int l, int u, IntConLevel icl=ICL_DEF);
1838 
1853  GECODE_INT_EXPORT void
1854  sequence(Home home, const BoolVarArgs& x, const IntSet& s,
1855  int q, int l, int u, IntConLevel icl=ICL_DEF);
1856 
1858 
1871 
1879  class DFA : public SharedHandle {
1880  private:
1882  class DFAI;
1883  public:
1885  class Transition {
1886  public:
1887  int i_state;
1888  int symbol;
1889  int o_state;
1890  Transition();
1893  Transition(int i_state0, int symbol0, int o_state0);
1894  };
1896  class Transitions {
1897  private:
1899  const Transition* c_trans;
1901  const Transition* e_trans;
1902  public:
1904  Transitions(const DFA& d);
1906  Transitions(const DFA& d, int n);
1908  bool operator ()(void) const;
1910  void operator ++(void);
1912  int i_state(void) const;
1914  int symbol(void) const;
1916  int o_state(void) const;
1917  };
1919  class Symbols {
1920  private:
1922  const Transition* c_trans;
1924  const Transition* e_trans;
1925  public:
1927  Symbols(const DFA& d);
1929  bool operator ()(void) const;
1931  void operator ++(void);
1933  int val(void) const;
1934  };
1935  public:
1936  friend class Transitions;
1938  DFA(void);
1951  DFA(int s, Transition t[], int f[], bool minimize=true);
1953  DFA(const DFA& d);
1955  int n_states(void) const;
1957  int n_transitions(void) const;
1959  unsigned int n_symbols(void) const;
1961  unsigned int max_degree(void) const;
1963  int final_fst(void) const;
1965  int final_lst(void) const;
1967  int symbol_min(void) const;
1969  int symbol_max(void) const;
1970  };
1971 
1972 
1984  };
1985 
1996  GECODE_INT_EXPORT void
1997  extensional(Home home, const IntVarArgs& x, DFA d,
1998  IntConLevel icl=ICL_DEF);
1999 
2010  GECODE_INT_EXPORT void
2011  extensional(Home home, const BoolVarArgs& x, DFA d,
2012  IntConLevel icl=ICL_DEF);
2013 
2020  class TupleSet : public SharedHandle {
2021  public:
2026  typedef int* Tuple;
2027 
2033  : public SharedHandle::Object {
2034  public:
2036  int arity;
2038  int size;
2044  int* data;
2046  int excess;
2048  int min, max;
2050  unsigned int domsize;
2055 
2057  template<class T>
2058  void add(T t);
2060  GECODE_INT_EXPORT void finalize(void);
2062  GECODE_INT_EXPORT void resize(void);
2064  bool finalized(void) const;
2066  TupleSetI(void);
2068  GECODE_INT_EXPORT virtual ~TupleSetI(void);
2070  GECODE_INT_EXPORT virtual SharedHandle::Object* copy(void) const;
2071  };
2072 
2074  TupleSetI* implementation(void);
2075 
2077  TupleSet(void);
2079  TupleSet(const TupleSet& d);
2080 
2082  void add(const IntArgs& tuple);
2084  void finalize(void);
2086  bool finalized(void) const;
2088  int arity(void) const;
2090  int tuples(void) const;
2092  Tuple operator [](int i) const;
2094  int min(void) const;
2096  int max(void) const;
2097  };
2098 
2117  GECODE_INT_EXPORT void
2118  extensional(Home home, const IntVarArgs& x, const TupleSet& t,
2120 
2131  GECODE_INT_EXPORT void
2132  extensional(Home home, const BoolVarArgs& x, const TupleSet& t,
2135 
2136 }
2137 
2140 
2141 namespace Gecode {
2142 
2154  GECODE_INT_EXPORT void
2155  min(Home home, IntVar x0, IntVar x1, IntVar x2,
2156  IntConLevel icl=ICL_DEF);
2164  GECODE_INT_EXPORT void
2165  min(Home home, const IntVarArgs& x, IntVar y,
2166  IntConLevel icl=ICL_DEF);
2172  GECODE_INT_EXPORT void
2173  max(Home home, IntVar x0, IntVar x1, IntVar x2,
2174  IntConLevel icl=ICL_DEF);
2182  GECODE_INT_EXPORT void
2183  max(Home home, const IntVarArgs& x, IntVar y,
2184  IntConLevel icl=ICL_DEF);
2185 
2191  GECODE_INT_EXPORT void
2192  abs(Home home, IntVar x0, IntVar x1,
2193  IntConLevel icl=ICL_DEF);
2194 
2200  GECODE_INT_EXPORT void
2201  mult(Home home, IntVar x0, IntVar x1, IntVar x2,
2202  IntConLevel icl=ICL_DEF);
2203 
2208  GECODE_INT_EXPORT void
2209  divmod(Home home, IntVar x0, IntVar x1, IntVar x2, IntVar x3,
2210  IntConLevel icl=ICL_DEF);
2211 
2216  GECODE_INT_EXPORT void
2217  div(Home home, IntVar x0, IntVar x1, IntVar x2,
2218  IntConLevel icl=ICL_DEF);
2219 
2224  GECODE_INT_EXPORT void
2225  mod(Home home, IntVar x0, IntVar x1, IntVar x2,
2226  IntConLevel icl=ICL_DEF);
2227 
2233  GECODE_INT_EXPORT void
2234  sqr(Home home, IntVar x0, IntVar x1,
2235  IntConLevel icl=ICL_DEF);
2236 
2242  GECODE_INT_EXPORT void
2243  sqrt(Home home, IntVar x0, IntVar x1,
2244  IntConLevel icl=ICL_DEF);
2245 
2254  GECODE_INT_EXPORT void
2255  pow(Home home, IntVar x0, int n, IntVar x1,
2256  IntConLevel icl=ICL_DEF);
2257 
2266  GECODE_INT_EXPORT void
2267  nroot(Home home, IntVar x0, int n, IntVar x1,
2268  IntConLevel icl=ICL_DEF);
2269 
2271 
2303  GECODE_INT_EXPORT void
2304  linear(Home home, const IntVarArgs& x,
2305  IntRelType irt, int c,
2306  IntConLevel icl=ICL_DEF);
2310  GECODE_INT_EXPORT void
2311  linear(Home home, const IntVarArgs& x,
2312  IntRelType irt, IntVar y,
2313  IntConLevel icl=ICL_DEF);
2317  GECODE_INT_EXPORT void
2318  linear(Home home, const IntVarArgs& x,
2319  IntRelType irt, int c, Reify r,
2320  IntConLevel icl=ICL_DEF);
2324  GECODE_INT_EXPORT void
2325  linear(Home home, const IntVarArgs& x,
2326  IntRelType irt, IntVar y, Reify r,
2327  IntConLevel icl=ICL_DEF);
2334  GECODE_INT_EXPORT void
2335  linear(Home home, const IntArgs& a, const IntVarArgs& x,
2336  IntRelType irt, int c,
2337  IntConLevel icl=ICL_DEF);
2344  GECODE_INT_EXPORT void
2345  linear(Home home, const IntArgs& a, const IntVarArgs& x,
2346  IntRelType irt, IntVar y,
2347  IntConLevel icl=ICL_DEF);
2354  GECODE_INT_EXPORT void
2355  linear(Home home, const IntArgs& a, const IntVarArgs& x,
2356  IntRelType irt, int c, Reify r,
2357  IntConLevel icl=ICL_DEF);
2364  GECODE_INT_EXPORT void
2365  linear(Home home, const IntArgs& a, const IntVarArgs& x,
2366  IntRelType irt, IntVar y, Reify r,
2367  IntConLevel icl=ICL_DEF);
2368 
2369 
2397  GECODE_INT_EXPORT void
2398  linear(Home home, const BoolVarArgs& x,
2399  IntRelType irt, int c,
2400  IntConLevel icl=ICL_DEF);
2404  GECODE_INT_EXPORT void
2405  linear(Home home, const BoolVarArgs& x,
2406  IntRelType irt, int c, Reify r,
2407  IntConLevel icl=ICL_DEF);
2411  GECODE_INT_EXPORT void
2412  linear(Home home, const BoolVarArgs& x,
2413  IntRelType irt, IntVar y,
2414  IntConLevel icl=ICL_DEF);
2418  GECODE_INT_EXPORT void
2419  linear(Home home, const BoolVarArgs& x,
2420  IntRelType irt, IntVar y, Reify r,
2421  IntConLevel icl=ICL_DEF);
2428  GECODE_INT_EXPORT void
2429  linear(Home home, const IntArgs& a, const BoolVarArgs& x,
2430  IntRelType irt, int c,
2431  IntConLevel icl=ICL_DEF);
2438  GECODE_INT_EXPORT void
2439  linear(Home home, const IntArgs& a, const BoolVarArgs& x,
2440  IntRelType irt, int c, Reify r,
2441  IntConLevel icl=ICL_DEF);
2448  GECODE_INT_EXPORT void
2449  linear(Home home, const IntArgs& a, const BoolVarArgs& x,
2450  IntRelType irt, IntVar y,
2451  IntConLevel icl=ICL_DEF);
2458  GECODE_INT_EXPORT void
2459  linear(Home home, const IntArgs& a, const BoolVarArgs& x,
2460  IntRelType irt, IntVar y, Reify r,
2461  IntConLevel icl=ICL_DEF);
2462 
2463 
2490  GECODE_INT_EXPORT void
2491  binpacking(Home home,
2492  const IntVarArgs& l,
2493  const IntVarArgs& b, const IntArgs& s,
2494  IntConLevel icl=ICL_DEF);
2513  GECODE_INT_EXPORT void
2514  nooverlap(Home home,
2515  const IntVarArgs& x, const IntArgs& w,
2516  const IntVarArgs& y, const IntArgs& h,
2517  IntConLevel icl=ICL_DEF);
2531  GECODE_INT_EXPORT void
2532  nooverlap(Home home,
2533  const IntVarArgs& x, const IntArgs& w,
2534  const IntVarArgs& y, const IntArgs& h,
2535  const BoolVarArgs& o,
2536  IntConLevel icl=ICL_DEF);
2553  GECODE_INT_EXPORT void
2554  nooverlap(Home home,
2555  const IntVarArgs& x0, const IntVarArgs& w, const IntVarArgs& x1,
2556  const IntVarArgs& y0, const IntVarArgs& h, const IntVarArgs& y1,
2557  IntConLevel icl=ICL_DEF);
2575  GECODE_INT_EXPORT void
2576  nooverlap(Home home,
2577  const IntVarArgs& x0, const IntVarArgs& w, const IntVarArgs& x1,
2578  const IntVarArgs& y0, const IntVarArgs& h, const IntVarArgs& y1,
2579  const BoolVarArgs& o,
2580  IntConLevel icl=ICL_DEF);
2581 
2582 
2588 
2631  GECODE_INT_EXPORT void
2632  cumulatives(Home home, const IntVarArgs& m,
2633  const IntVarArgs& s, const IntVarArgs& p,
2634  const IntVarArgs& e, const IntVarArgs& u,
2635  const IntArgs& c, bool at_most,
2636  IntConLevel icl=ICL_DEF);
2641  GECODE_INT_EXPORT void
2642  cumulatives(Home home, const IntArgs& m,
2643  const IntVarArgs& s, const IntVarArgs& p,
2644  const IntVarArgs& e, const IntVarArgs& u,
2645  const IntArgs& c, bool at_most,
2646  IntConLevel icl=ICL_DEF);
2651  GECODE_INT_EXPORT void
2652  cumulatives(Home home, const IntVarArgs& m,
2653  const IntVarArgs& s, const IntArgs& p,
2654  const IntVarArgs& e, const IntVarArgs& u,
2655  const IntArgs& c, bool at_most,
2656  IntConLevel icl=ICL_DEF);
2661  GECODE_INT_EXPORT void
2662  cumulatives(Home home, const IntArgs& m,
2663  const IntVarArgs& s, const IntArgs& p,
2664  const IntVarArgs& e, const IntVarArgs& u,
2665  const IntArgs& c, bool at_most,
2666  IntConLevel icl=ICL_DEF);
2671  GECODE_INT_EXPORT void
2672  cumulatives(Home home, const IntVarArgs& m,
2673  const IntVarArgs& s, const IntVarArgs& p,
2674  const IntVarArgs& e, const IntArgs& u,
2675  const IntArgs& c, bool at_most,
2676  IntConLevel icl=ICL_DEF);
2681  GECODE_INT_EXPORT void
2682  cumulatives(Home home, const IntArgs& m,
2683  const IntVarArgs& s, const IntVarArgs& p,
2684  const IntVarArgs& e, const IntArgs& u,
2685  const IntArgs& c, bool at_most,
2686  IntConLevel icl=ICL_DEF);
2691  GECODE_INT_EXPORT void
2692  cumulatives(Home home, const IntVarArgs& m,
2693  const IntVarArgs& s, const IntArgs& p,
2694  const IntVarArgs& e, const IntArgs& u,
2695  const IntArgs& c, bool at_most,
2696  IntConLevel icl=ICL_DEF);
2701  GECODE_INT_EXPORT void
2702  cumulatives(Home home, const IntArgs& m,
2703  const IntVarArgs& s, const IntArgs& p,
2704  const IntVarArgs& e, const IntArgs& u,
2705  const IntArgs& c, bool at_most,
2706  IntConLevel icl=ICL_DEF);
2707 
2726  GECODE_INT_EXPORT void
2727  unary(Home home, const IntVarArgs& s, const IntArgs& p,
2728  IntConLevel icl=ICL_DEF);
2729 
2750  GECODE_INT_EXPORT void
2751  unary(Home home, const IntVarArgs& s, const IntArgs& p,
2752  const BoolVarArgs& m, IntConLevel icl=ICL_DEF);
2753 
2782  GECODE_INT_EXPORT void
2783  unary(Home home, const TaskTypeArgs& t,
2784  const IntVarArgs& flex, const IntArgs& fix, IntConLevel icl=ICL_DEF);
2785 
2816  GECODE_INT_EXPORT void
2817  unary(Home home, const TaskTypeArgs& t,
2818  const IntVarArgs& flex, const IntArgs& fix,
2819  const BoolVarArgs& m, IntConLevel icl=ICL_DEF);
2820 
2840  GECODE_INT_EXPORT void
2841  unary(Home home, const IntVarArgs& s, const IntVarArgs& p,
2842  const IntVarArgs& e, IntConLevel icl=ICL_DEF);
2843 
2865  GECODE_INT_EXPORT void
2866  unary(Home home, const IntVarArgs& s, const IntVarArgs& p,
2867  const IntVarArgs& e, const BoolVarArgs& m, IntConLevel icl=ICL_DEF);
2868 
2903  GECODE_INT_EXPORT void
2904  cumulative(Home home, int c, const TaskTypeArgs& t,
2905  const IntVarArgs& flex, const IntArgs& fix, const IntArgs& u,
2906  IntConLevel icl=ICL_DEF);
2907 
2908 
2913  GECODE_INT_EXPORT void
2914  cumulative(Home home, IntVar c, const TaskTypeArgs& t,
2915  const IntVarArgs& flex, const IntArgs& fix, const IntArgs& u,
2916  IntConLevel icl=ICL_DEF);
2917 
2954  GECODE_INT_EXPORT void
2955  cumulative(Home home, int c, const TaskTypeArgs& t,
2956  const IntVarArgs& flex, const IntArgs& fix, const IntArgs& u,
2957  const BoolVarArgs& m, IntConLevel icl=ICL_DEF);
2958 
2962  GECODE_INT_EXPORT void
2963  cumulative(Home home, IntVar c, const TaskTypeArgs& t,
2964  const IntVarArgs& flex, const IntArgs& fix, const IntArgs& u,
2965  const BoolVarArgs& m, IntConLevel icl=ICL_DEF);
2966 
2991  GECODE_INT_EXPORT void
2992  cumulative(Home home, int c, const IntVarArgs& s, const IntArgs& p,
2993  const IntArgs& u, IntConLevel icl=ICL_DEF);
2994 
2998  GECODE_INT_EXPORT void
2999  cumulative(Home home, IntVar c, const IntVarArgs& s, const IntArgs& p,
3000  const IntArgs& u, IntConLevel icl=ICL_DEF);
3001 
3028  GECODE_INT_EXPORT void
3029  cumulative(Home home, int c, const IntVarArgs& s, const IntArgs& p,
3030  const IntArgs& u, const BoolVarArgs& m, IntConLevel icl=ICL_DEF);
3031 
3035  GECODE_INT_EXPORT void
3036  cumulative(Home home, IntVar c, const IntVarArgs& s, const IntArgs& p,
3037  const IntArgs& u, const BoolVarArgs& m, IntConLevel icl=ICL_DEF);
3038 
3067  GECODE_INT_EXPORT void
3068  cumulative(Home home, int c, const IntVarArgs& s, const IntVarArgs& p,
3069  const IntVarArgs& e, const IntArgs& u, IntConLevel icl=ICL_DEF);
3070 
3074  GECODE_INT_EXPORT void
3075  cumulative(Home home, IntVar c, const IntVarArgs& s, const IntVarArgs& p,
3076  const IntVarArgs& e, const IntArgs& u, IntConLevel icl=ICL_DEF);
3077 
3108  GECODE_INT_EXPORT void
3109  cumulative(Home home, int c, const IntVarArgs& s, const IntVarArgs& p,
3110  const IntVarArgs& e, const IntArgs& u, const BoolVarArgs& m,
3111  IntConLevel icl=ICL_DEF);
3112 
3116  GECODE_INT_EXPORT void
3117  cumulative(Home home, IntVar c, const IntVarArgs& s, const IntVarArgs& p,
3118  const IntVarArgs& e, const IntArgs& u, const BoolVarArgs& m,
3119  IntConLevel icl=ICL_DEF);
3121 
3122 
3142  GECODE_INT_EXPORT void
3143  circuit(Home home, const IntVarArgs& x,
3144  IntConLevel icl=ICL_DEF);
3160  GECODE_INT_EXPORT void
3161  circuit(Home home, int offset, const IntVarArgs& x,
3162  IntConLevel icl=ICL_DEF);
3184  GECODE_INT_EXPORT void
3185  circuit(Home home,
3186  const IntArgs& c,
3187  const IntVarArgs& x, const IntVarArgs& y, IntVar z,
3188  IntConLevel icl=ICL_DEF);
3211  GECODE_INT_EXPORT void
3212  circuit(Home home,
3213  const IntArgs& c, int offset,
3214  const IntVarArgs& x, const IntVarArgs& y, IntVar z,
3215  IntConLevel icl=ICL_DEF);
3234  GECODE_INT_EXPORT void
3235  circuit(Home home,
3236  const IntArgs& c,
3237  const IntVarArgs& x, IntVar z,
3238  IntConLevel icl=ICL_DEF);
3259  GECODE_INT_EXPORT void
3260  circuit(Home home,
3261  const IntArgs& c, int offset,
3262  const IntVarArgs& x, IntVar z,
3263  IntConLevel icl=ICL_DEF);
3279  GECODE_INT_EXPORT void
3280  path(Home home, const IntVarArgs& x, IntVar s, IntVar e,
3281  IntConLevel icl=ICL_DEF);
3299  GECODE_INT_EXPORT void
3300  path(Home home, int offset, const IntVarArgs& x, IntVar s, IntVar e,
3301  IntConLevel icl=ICL_DEF);
3324  GECODE_INT_EXPORT void
3325  path(Home home,
3326  const IntArgs& c,
3327  const IntVarArgs& x, IntVar s, IntVar e, const IntVarArgs& y, IntVar z,
3328  IntConLevel icl=ICL_DEF);
3353  GECODE_INT_EXPORT void
3354  path(Home home,
3355  const IntArgs& c, int offset,
3356  const IntVarArgs& x, IntVar s, IntVar e, const IntVarArgs& y, IntVar z,
3357  IntConLevel icl=ICL_DEF);
3378  GECODE_INT_EXPORT void
3379  path(Home home,
3380  const IntArgs& c,
3381  const IntVarArgs& x, IntVar s, IntVar e, IntVar z,
3382  IntConLevel icl=ICL_DEF);
3405  GECODE_INT_EXPORT void
3406  path(Home home,
3407  const IntArgs& c, int offset,
3408  const IntVarArgs& x, IntVar s, IntVar e, IntVar z,
3409  IntConLevel icl=ICL_DEF);
3411 
3412 
3413 
3422  GECODE_INT_EXPORT void
3424  wait(Home home, IntVar x, void (*c)(Space& home),
3425  IntConLevel icl=ICL_DEF);
3427  GECODE_INT_EXPORT void
3428  wait(Home home, BoolVar x, void (*c)(Space& home),
3429  IntConLevel icl=ICL_DEF);
3431  GECODE_INT_EXPORT void
3432  wait(Home home, const IntVarArgs& x, void (*c)(Space& home),
3433  IntConLevel icl=ICL_DEF);
3435  GECODE_INT_EXPORT void
3436  wait(Home home, const BoolVarArgs& x, void (*c)(Space& home),
3437  IntConLevel icl=ICL_DEF);
3439  GECODE_INT_EXPORT void
3440  when(Home home, BoolVar x,
3441  void (*t)(Space& home), void (*e)(Space& home)= NULL,
3442  IntConLevel icl=ICL_DEF);
3444 
3445 
3470  GECODE_INT_EXPORT void
3471  unshare(Home home, IntVarArgs& x,
3472  IntConLevel icl=ICL_DEF);
3474  GECODE_INT_EXPORT void
3475  unshare(Home home, BoolVarArgs& x,
3476  IntConLevel icl=ICL_DEF);
3478 
3479 }
3480 
3481 namespace Gecode {
3482 
3496  typedef bool (*IntBranchFilter)(const Space& home, IntVar x, int i);
3505  typedef bool (*BoolBranchFilter)(const Space& home, BoolVar x, int i);
3506 
3516  typedef double (*IntBranchMerit)(const Space& home, IntVar x, int i);
3526  typedef double (*BoolBranchMerit)(const Space& home, BoolVar x, int i);
3527 
3538  typedef int (*IntBranchVal)(const Space& home, IntVar x, int i);
3549  typedef int (*BoolBranchVal)(const Space& home, BoolVar x, int i);
3550 
3562  typedef void (*IntBranchCommit)(Space& home, unsigned int a,
3563  IntVar x, int i, int n);
3575  typedef void (*BoolBranchCommit)(Space& home, unsigned int a,
3576  BoolVar x, int i, int n);
3577 }
3578 
3580 
3581 namespace Gecode {
3582 
3588  class IntAFC : public AFC {
3589  public:
3597  IntAFC(void);
3599  IntAFC(const IntAFC& a);
3601  IntAFC& operator =(const IntAFC& a);
3603  IntAFC(Home home, const IntVarArgs& x, double d=1.0);
3605  IntAFC(Home home, const BoolVarArgs& x, double d=1.0);
3613  void init(Home, const IntVarArgs& x, double d=1.0);
3621  void init(Home, const BoolVarArgs& x, double d=1.0);
3622  };
3623 
3624 }
3625 
3626 #include <gecode/int/branch/afc.hpp>
3627 
3628 namespace Gecode {
3629 
3635  class IntActivity : public Activity {
3636  public:
3644  IntActivity(void);
3646  IntActivity(const IntActivity& a);
3648  IntActivity& operator =(const IntActivity& a);
3657  IntActivity(Home home, const IntVarArgs& x, double d=1.0,
3658  IntBranchMerit bm=NULL);
3667  IntActivity(Home home, const BoolVarArgs& x, double d=1.0,
3668  BoolBranchMerit bm=NULL);
3680  GECODE_INT_EXPORT void
3681  init(Home home, const IntVarArgs& x, double d=1.0,
3682  IntBranchMerit bm=NULL);
3694  GECODE_INT_EXPORT void
3695  init(Home home, const BoolVarArgs& x, double d=1.0,
3696  BoolBranchMerit bm=NULL);
3697  };
3698 
3699 }
3700 
3702 
3703 namespace Gecode {
3704 
3706  typedef void (*IntVarValPrint)(const Space &home, const BrancherHandle& bh,
3707  unsigned int a,
3708  IntVar x, int i, const int& n,
3709  std::ostream& o);
3710 
3712  typedef void (*BoolVarValPrint)(const Space &home, const BrancherHandle& bh,
3713  unsigned int a,
3714  BoolVar x, int i, const int& n,
3715  std::ostream& o);
3716 
3717 }
3718 
3719 namespace Gecode {
3720 
3726  class IntVarBranch : public VarBranch {
3727  public:
3729  enum Select {
3730  SEL_NONE = 0,
3752 
3776  };
3777  protected:
3780  public:
3782  IntVarBranch(void);
3784  IntVarBranch(Rnd r);
3788  IntVarBranch(Select s, double d, BranchTbl t);
3796  Select select(void) const;
3798  void expand(Home home, const IntVarArgs& x);
3800  void expand(Home home, const BoolVarArgs& x);
3801  };
3802 
3808  IntVarBranch INT_VAR_NONE(void);
3825  IntVarBranch INT_VAR_AFC_MIN(double d=1.0, BranchTbl tbl=NULL);
3829  IntVarBranch INT_VAR_AFC_MAX(double d=1.0, BranchTbl tbl=NULL);
3833  IntVarBranch INT_VAR_ACTIVITY_MIN(double d=1.0, BranchTbl tbl=NULL);
3837  IntVarBranch INT_VAR_ACTIVITY_MAX(double d=1.0, BranchTbl tbl=NULL);
3857  IntVarBranch INT_VAR_AFC_SIZE_MIN(double d=1.0, BranchTbl tbl=NULL);
3861  IntVarBranch INT_VAR_AFC_SIZE_MAX(double d=1.0, BranchTbl tbl=NULL);
3897 
3898 }
3899 
3900 #include <gecode/int/branch/var.hpp>
3901 
3902 namespace Gecode {
3903 
3909  class IntValBranch : public ValBranch {
3910  public:
3912  enum Select {
3928  };
3929  protected:
3934  public:
3938  IntValBranch(Rnd r);
3944  Select select(void) const;
3946  IntSharedArray values(void) const;
3947  };
3948 
3954  IntValBranch INT_VAL_MIN(void);
3957  IntValBranch INT_VAL_MED(void);
3959  IntValBranch INT_VAL_MAX(void);
3997 
3998 }
3999 
4000 #include <gecode/int/branch/val.hpp>
4001 
4002 namespace Gecode {
4003 
4009  class IntAssign : public ValBranch {
4010  public:
4012  enum Select {
4018  };
4019  protected:
4022  public:
4026  IntAssign(Rnd r);
4030  Select select(void) const;
4031  };
4032 
4038  IntAssign INT_ASSIGN_MIN(void);
4041  IntAssign INT_ASSIGN_MED(void);
4043  IntAssign INT_ASSIGN_MAX(void);
4061 
4062 }
4063 
4065 
4066 namespace Gecode {
4072  GECODE_INT_EXPORT BrancherHandle
4073  branch(Home home, const IntVarArgs& x,
4074  IntVarBranch vars, IntValBranch vals,
4075  IntBranchFilter bf=NULL,
4076  IntVarValPrint vvp=NULL);
4082  GECODE_INT_EXPORT BrancherHandle
4083  branch(Home home, const IntVarArgs& x,
4084  TieBreak<IntVarBranch> vars, IntValBranch vals,
4085  IntBranchFilter bf=NULL,
4086  IntVarValPrint vvp=NULL);
4092  GECODE_INT_EXPORT BrancherHandle
4093  branch(Home home, IntVar x, IntValBranch vals,
4094  IntVarValPrint vvp=NULL);
4100  GECODE_INT_EXPORT BrancherHandle
4101  branch(Home home, const BoolVarArgs& x,
4102  IntVarBranch vars, IntValBranch vals,
4103  BoolBranchFilter bf=NULL,
4104  BoolVarValPrint vvp=NULL);
4110  GECODE_INT_EXPORT BrancherHandle
4111  branch(Home home, const BoolVarArgs& x,
4112  TieBreak<IntVarBranch> vars, IntValBranch vals,
4113  BoolBranchFilter bf=NULL,
4114  BoolVarValPrint vvp=NULL);
4120  GECODE_INT_EXPORT BrancherHandle
4121  branch(Home home, BoolVar x, IntValBranch vals,
4122  BoolVarValPrint vvp=NULL);
4123 
4129  GECODE_INT_EXPORT BrancherHandle
4130  assign(Home home, const IntVarArgs& x, IntAssign vals,
4131  IntBranchFilter ibf=NULL,
4132  IntVarValPrint vvp=NULL);
4138  GECODE_INT_EXPORT BrancherHandle
4139  assign(Home home, IntVar x, IntAssign vals,
4140  IntVarValPrint vvp=NULL);
4146  GECODE_INT_EXPORT BrancherHandle
4147  assign(Home home, const BoolVarArgs& x, IntAssign vals,
4148  BoolBranchFilter bbf=NULL,
4149  BoolVarValPrint vvp=NULL);
4155  GECODE_INT_EXPORT BrancherHandle
4156  assign(Home home, BoolVar x, IntAssign vals,
4157  BoolVarValPrint vvp=NULL);
4158 
4159 }
4160 
4161 namespace Gecode {
4162 
4166  template<class Char, class Traits>
4167  std::basic_ostream<Char,Traits>&
4168  operator <<(std::basic_ostream<Char,Traits>& os, const DFA& d);
4169 
4173  template<class Char, class Traits>
4174  std::basic_ostream<Char,Traits>&
4175  operator <<(std::basic_ostream<Char,Traits>& os, const TupleSet& ts);
4176 
4177 }
4178 
4179 // LDSB-related declarations.
4180 namespace Gecode {
4181 
4182  namespace Int { namespace LDSB {
4183  class SymmetryObject;
4184  }}
4185 
4192  public:
4196  void increment(void);
4198  void decrement(void);
4199  public:
4201  SymmetryHandle(void);
4205  SymmetryHandle(const SymmetryHandle& h);
4207  const SymmetryHandle& operator=(const SymmetryHandle& h);
4209  ~SymmetryHandle(void);
4210  };
4211  class Symmetries;
4213  template<>
4215  public:
4219  };
4220 
4227  class Symmetries : public ArgArray<SymmetryHandle> {};
4229  // If this is instead a typedef, strange things happen with the
4230  // overloading of the "branch" function.
4231 
4233  GECODE_INT_EXPORT SymmetryHandle VariableSymmetry(const IntVarArgs& x);
4235  GECODE_INT_EXPORT SymmetryHandle VariableSymmetry(const BoolVarArgs& x);
4237  GECODE_INT_EXPORT SymmetryHandle VariableSymmetry(const IntVarArgs& x,
4238  const IntArgs& indices);
4240  GECODE_INT_EXPORT SymmetryHandle ValueSymmetry(const IntArgs& v);
4242  GECODE_INT_EXPORT SymmetryHandle ValueSymmetry(const IntSet& v);
4244  GECODE_INT_EXPORT SymmetryHandle ValueSymmetry(IntVar vars);
4251  SymmetryHandle VariableSequenceSymmetry(const IntVarArgs& x, int ss);
4258  SymmetryHandle VariableSequenceSymmetry(const BoolVarArgs& x, int ss);
4265  SymmetryHandle ValueSequenceSymmetry(const IntArgs& v, int ss);
4266 
4268  GECODE_INT_EXPORT SymmetryHandle values_reflect(int lower, int upper);
4270  GECODE_INT_EXPORT SymmetryHandle values_reflect(IntVar x);
4272 
4284  GECODE_INT_EXPORT BrancherHandle
4285  branch(Home home, const IntVarArgs& x,
4286  IntVarBranch vars, IntValBranch vals,
4287  const Symmetries& syms,
4288  IntBranchFilter bf=NULL, IntVarValPrint vvp=NULL);
4300  GECODE_INT_EXPORT BrancherHandle
4301  branch(Home home, const IntVarArgs& x,
4302  TieBreak<IntVarBranch> vars, IntValBranch vals,
4303  const Symmetries& syms,
4304  IntBranchFilter bf=NULL, IntVarValPrint vvp=NULL);
4316  GECODE_INT_EXPORT BrancherHandle
4317  branch(Home home, const BoolVarArgs& x,
4318  IntVarBranch vars, IntValBranch vals,
4319  const Symmetries& syms,
4320  BoolBranchFilter bf=NULL, BoolVarValPrint vvp=NULL);
4332  GECODE_INT_EXPORT BrancherHandle
4333  branch(Home home, const BoolVarArgs& x,
4334  TieBreak<IntVarBranch> vars, IntValBranch vals,
4335  const Symmetries& syms,
4336  BoolBranchFilter bf=NULL, BoolVarValPrint vvp=NULL);
4337 }
4338 
4339 #endif
4340 
4341 // IFDEF: GECODE_HAS_INT_VARS
4342 // STATISTICS: int-post
4343 
Value iterator for integer variables.
Definition: int.hh:467
With smallest accumulated failure count.
Definition: int.hh:3736
IntVarBranch INT_VAR_DEGREE_SIZE_MIN(BranchTbl tbl)
Select variable with smallest degree divided by domain size.
Definition: var.hpp:222
static IntArgs create(int n, int start, int inc=1)
Allocate array with n elements such that for all .
Definition: array.hpp:72
IntVar(void)
Default constructor.
Definition: int.hpp:51
Transitions(const DFA &d)
Initialize to all transitions of DFA d.
Definition: dfa.hpp:173
int med(void) const
Return median of domain (greatest element not greater than the median)
Definition: int.hpp:70
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:98
IntVarArgs(const VarArray< IntVar > &a)
Initialize from variable array a (copy elements)
Definition: int.hh:645
void cumulative(Home home, Cap c, const TaskTypeArgs &t, const IntVarArgs &s, const IntArgs &p, const IntArgs &u, IntConLevel icl)
Definition: cumulative.cpp:48
int symbol
symbol
Definition: int.hh:1888
IntValBranch(Select s=SEL_MIN)
Initialize with selection strategy s.
Definition: val.hpp:41
Variables as interfaces to variable implementations.
Definition: var.hpp:51
NodeType t
Type of node.
Definition: bool-expr.cpp:234
IntVarBranch INT_VAR_NONE(void)
Select first unassigned variable.
Definition: var.hpp:108
IntVarArray(void)
Default constructor (array of size 0)
Definition: array.hpp:80
IntAFC(void)
Construct as not yet initialized.
Definition: afc.hpp:41
IntVarBranch INT_VAR_MERIT_MAX(IntBranchMerit bm, BranchTbl tbl)
Select variable with highest merit according to branch merit function bm.
Definition: var.hpp:130
Select s
Which variable to select.
Definition: int.hh:3779
IntConLevel
Consistency levels for integer propagators.
Definition: int.hh:935
void mult(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition: arithmetic.cpp:96
The shared handle.
Definition: core.hpp:79
int min(void) const
Minimum domain element.
Definition: tuple-set.hpp:155
void linear(Home home, const FloatVarArgs &x, FloatRelType frt, FloatNum c)
Post propagator for .
Definition: linear.cpp:45
void finalize(void)
Finalize tuple set.
Definition: tuple-set.hpp:111
NNF * l
Left subtree.
Definition: bool-expr.cpp:244
TaskType
Type of task for scheduling constraints.
Definition: int.hh:947
int med(void) const
Return median of domain (greatest element not greater than the median)
Definition: bool.hpp:71
Inverse implication for reification.
Definition: int.hh:845
ReifyMode mode(void) const
Return reification mode.
Definition: reify.hpp:60
BoolVarArray(void)
Default constructor (array of size 0)
Definition: array.hpp:96
With smallest activity divided by domain size.
Definition: int.hh:3750
void mod(Home home, IntVar x0, IntVar x1, IntVar x2, IntConLevel icl)
Post propagator for .
Definition: arithmetic.cpp:160
With largest min-regret.
Definition: int.hh:3763
int max(void) const
Return maximum of domain.
Definition: int.hpp:74
Range iterator for integer sets.
Definition: int.hh:269
BoolVarArgs(const VarArray< BoolVar > &a)
Initialize from variable array a (copy elements)
Definition: int.hh:699
Iterator for DFA symbols.
Definition: int.hh:1919
int final_fst(void) const
Return the number of the first final state.
Definition: dfa.hpp:129
IntSetValues(void)
Default constructor.
Definition: int-set-1.hpp:220
void channel(Home home, FloatVar x0, IntVar x1)
Post propagator for channeling a float and an integer variable .
Definition: arithmetic.cpp:218
BoolVar var(void) const
Return Boolean control variable.
Definition: reify.hpp:52
int o_state(void) const
Return out-state of current transition.
Definition: dfa.hpp:219
Reify(void)
Default constructor without proper initialization.
Definition: reify.hpp:46
bool in(int n) const
Return whether n is included in the set.
Definition: int-set-1.hpp:140
union Gecode::@512::NNF::@54 u
Union depending on nodetype t.
IntVarBranch INT_VAR_DEGREE_SIZE_MAX(BranchTbl tbl)
Select variable with largest degree divided by domain size.
Definition: var.hpp:227
void(* BoolVarValPrint)(const Space &home, const BrancherHandle &bh, unsigned int a, BoolVar x, int i, const int &n, std::ostream &o)
Function type for printing branching alternatives for Boolean variables.
Definition: int.hh:3712
int final_lst(void) const
Return the number of the last final state.
Definition: dfa.hpp:135
void operator++(void)
Move iterator to next range (if possible)
Definition: int-set-1.hpp:194
Select
Which value selection.
Definition: int.hh:4012
Argument array for primtive types.
Definition: array.hpp:640
int min(void) const
Return minimum of entire set.
Definition: int-set-1.hpp:149
double(* BoolBranchMerit)(const Space &home, BoolVar x, int i)
Branch merit function type for Boolean variables.
Definition: int.hh:3526
BoolOpType
Operation types for Booleans.
Definition: int.hh:914
bool zero(void) const
Test whether domain is zero.
Definition: bool.hpp:107
Which values to select for branching first.
Definition: int.hh:3909
int arity(void) const
Arity of tuple set.
Definition: tuple-set.hpp:134
With smallest degree.
Definition: int.hh:3734
BoolVarArgs(const BoolVarArgs &a)
Initialize from variable argument array a (copy elements)
Definition: int.hh:697
Symbols(const DFA &d)
Initialize to symbols of DFA d.
Definition: dfa.hpp:229
Select smallest value.
Definition: int.hh:3913
Which variable to select for branching.
Definition: int.hh:3726
With highest activity.
Definition: int.hh:3739
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition: arithmetic.cpp:57
int excess
Excess storage.
Definition: int.hh:2046
Value propagation or consistency (naive)
Definition: int.hh:936
IntVarBranch INT_VAR_REGRET_MAX_MAX(BranchTbl tbl)
Select variable with largest max-regret.
Definition: var.hpp:287
With largest accumulated failure count.
Definition: int.hh:3737
void abs(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition: arithmetic.cpp:49
IntAssign INT_ASSIGN_MED(void)
Select greatest value not greater than the median.
Definition: assign.hpp:64
Handle for brancher.
Definition: core.hpp:1157
double(* IntBranchMerit)(const Space &home, IntVar x, int i)
Branch merit function type for integer variables.
Definition: int.hh:3516
void(* IntVarValPrint)(const Space &home, const BrancherHandle &bh, unsigned int a, IntVar x, int i, const int &n, std::ostream &o)
Function type for printing branching alternatives for integer variables.
Definition: int.hh:3706
Less or equal ( )
Definition: int.hh:904
void nroot(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for $n 0$.
Definition: arithmetic.cpp:126
Make a default decision.
Definition: int.hh:1981
void(* BoolBranchCommit)(Space &home, unsigned int a, BoolVar x, int i, int n)
Branch commit function type for Boolean variables.
Definition: int.hh:3575
void pow(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for $n 0$.
Definition: arithmetic.cpp:117
void init(const IntSet &s)
Initialize with values for s.
Definition: int-set-1.hpp:229
Select value nearest to a given value, use smaller one in case of ties.
Definition: int.hh:3924
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
unsigned int size(void) const
Return size (cardinality) of domain.
Definition: bool.hpp:85
Conjunction.
Definition: int.hh:915
Select select(void) const
Return selection strategy.
Definition: assign.hpp:53
With largest accumulated failure count divided by domain size.
Definition: int.hh:3749
First unassigned.
Definition: int.hh:3730
bool operator()(void) const
Test whether iterator still at a symbol.
Definition: dfa.hpp:240
IntAssign(Select s=SEL_MIN)
Initialize with selection strategy s.
Definition: assign.hpp:41
void operator++(void)
Move iterator to next transition.
Definition: dfa.hpp:204
int * Tuple
Type of a tuple.
Definition: int.hh:2026
BoolVarArgs(const std::vector< BoolVar > &a)
Initialize from vector a.
Definition: int.hh:702
void dom(Home home, FloatVar x, FloatVal n)
Propagates .
Definition: dom.cpp:44
Collection of symmetries.
Definition: int.hh:4228
IntVarBranch INT_VAR_SIZE_MIN(BranchTbl tbl)
Select variable with smallest domain size.
Definition: var.hpp:212
IntVarBranch INT_VAR_MIN_MIN(BranchTbl tbl)
Select variable with smallest min.
Definition: var.hpp:192
IntVarBranch INT_VAR_REGRET_MAX_MIN(BranchTbl tbl)
Select variable with smallest max-regret.
Definition: var.hpp:282
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:103
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
unsigned int regret_min(void) const
Return regret of domain minimum (distance to next larger value)
Definition: int.hpp:88
IntVarArgs(InputIterator first, InputIterator last)
Initialize from InputIterator first and last.
Definition: int.hh:650
bool operator()(void) const
Test whether iterator is still at a range or done.
Definition: int-set-1.hpp:198
Implication.
Definition: int.hh:917
Integer variable array.
Definition: int.hh:739
Select the smallest range of the variable domain if it has several ranges, otherwise select values no...
Definition: int.hh:3919
Select select(void) const
Return selection strategy.
Definition: val.hpp:57
With largest activity divided by domain size.
Definition: int.hh:3751
bool range(void) const
Test whether domain is a range.
Definition: bool.hpp:98
IntVarArgs(const std::vector< IntVar > &a)
Initialize from vector a.
Definition: int.hh:647
void path(Home home, int offset, const IntVarArgs &x, IntVar s, IntVar e, IntConLevel icl)
Post propagator such that x forms a Hamiltonian path.
Definition: circuit.cpp:128
IntVarBranch INT_VAR_ACTIVITY_MAX(double d, BranchTbl tbl)
Select variable with highest activity with decay factor d.
Definition: var.hpp:182
Select s
Which value to select.
Definition: int.hh:3933
Greater ( )
Definition: int.hh:907
Select value near to a given value, decrement values first.
Definition: int.hh:3927
ArgArray< IntSet > IntSetArgs
Passing set arguments.
Definition: int.hh:596
const int max
Largest allowed integer value.
Definition: int.hh:111
unsigned int width(void) const
Return width of set (distance between maximum and minimum)
Definition: int-set-1.hpp:167
Computation spaces.
Definition: core.hpp:1325
int tuples(void) const
Number of tuples.
Definition: tuple-set.hpp:141
Greater or equal ( )
Definition: int.hh:906
Select select(void) const
Return selection strategy.
Definition: var.hpp:69
Select s
Which value to select.
Definition: int.hh:4021
void init(const IntSet &s)
Initialize with ranges for set s.
Definition: int-set-1.hpp:181
With smallest min.
Definition: int.hh:3740
int i_state
input state
Definition: int.hh:1887
Exclusive or.
Definition: int.hh:919
const int min
Smallest allowed integer value.
Definition: int.hh:113
IntVarBranch INT_VAR_REGRET_MIN_MAX(BranchTbl tbl)
Select variable with largest min-regret.
Definition: var.hpp:277
Select smallest value.
Definition: int.hh:4013
IntVarArgs(int n)
Allocate array with n elements.
Definition: int.hh:641
IntVarBranch(void)
Initialize with strategy SEL_NONE.
Definition: var.hpp:41
int val(void) const
Return assigned value.
Definition: bool.hpp:61
Range iterator for integer variables
Definition: int.hh:450
IntAssign INT_ASSIGN_MIN(void)
Select smallest value.
Definition: assign.hpp:59
IntValBranch INT_VAL_RND(Rnd r)
Select random value.
Definition: val.hpp:83
Select value nearest to a given value, use larger one in case of ties.
Definition: int.hh:3925
Gecode::IntSet d(v, 7)
bool overflow_mul(int n, int m)
Check whether multiplying n and m would overflow.
Definition: limits.hpp:111
Reify imp(BoolVar x)
Use implication for reification.
Definition: reify.hpp:77
void sequence(Home home, const IntVarArgs &x, const IntSet &s, int q, int l, int u, IntConLevel)
Post propagator for .
Definition: sequence.cpp:51
Gecode::FloatVal c(-8, 8)
void when(Home home, BoolVar x, void(*t)(Space &home), void(*e)(Space &home), IntConLevel)
Execute t (then) when x is assigned one, and e (else) otherwise.
Definition: exec.cpp:74
SymmetryHandle VariableSymmetry(const IntVarArgs &vars)
Variables in x are interchangeable.
Definition: ldsb.cpp:66
Deterministic finite automaton (DFA)
Definition: int.hh:1879
int p
Number of positive literals for node type.
Definition: bool-expr.cpp:236
With smallest max-regret.
Definition: int.hh:3769
IntVarBranch INT_VAR_AFC_MAX(double d, BranchTbl tbl)
Select variable with largest accumulated failure count with decay factor d.
Definition: var.hpp:162
bool(* BoolBranchFilter)(const Space &home, BoolVar x, int i)
Branch filter function type for Boolean variables.
Definition: int.hh:3505
Gecode::IntArgs i(4, 1, 2, 3, 4)
Class for AFC (accumulated failure count) management.
Definition: afc.hpp:44
unsigned int n_symbols(void) const
Return the number of symbols.
Definition: dfa.hpp:111
int n
Number of negative literals for node type.
Definition: bool-expr.cpp:238
Equality ( )
Definition: int.hh:902
BoolVar(void)
Default constructor.
Definition: bool.hpp:52
IntVarBranch INT_VAR_DEGREE_MAX(BranchTbl tbl)
Select variable with largest degree.
Definition: var.hpp:147
Argument array for non-primitive types.
Definition: array.hpp:727
IntVarArgs(void)
Allocate empty array.
Definition: int.hh:639
const long long int llmin
Smallest allowed long long integer value.
Definition: int.hh:119
IntArgs(void)
Allocate empty array.
Definition: array.hpp:46
Select random value.
Definition: int.hh:4016
Select all values starting from largest.
Definition: int.hh:3923
IntVarBranch INT_VAR_ACTIVITY_MIN(double d, BranchTbl tbl)
Select variable with lowest activity with decay factor d.
Definition: var.hpp:172
unsigned int regret_max(void) const
Return regret of domain maximum (distance to next smaller value)
Definition: int.hpp:92
Tuple ** last
Initial last structure.
Definition: int.hh:2052
Prefer speed over memory consumption.
Definition: int.hh:1982
With smallest min-regret.
Definition: int.hh:3757
A reference-counted pointer to a SymmetryObject.
Definition: int.hh:4191
IntAssign INT_ASSIGN_RND(Rnd r)
Select random value.
Definition: assign.hpp:74
IntRelType
Relation types for integers.
Definition: int.hh:901
bool(* IntBranchFilter)(const Space &home, IntVar x, int i)
Branch filter function type for integer variables.
Definition: int.hh:3496
IntVarValues(void)
Default constructor.
Definition: int.hpp:128
NNF * r
Right subtree.
Definition: bool-expr.cpp:246
int ranges(void) const
Return number of ranges of the specification.
Definition: int-set-1.hpp:134
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:3914
int i_state(void) const
Return in-state of current transition.
Definition: dfa.hpp:209
void sqr(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition: arithmetic.cpp:103
IntAssign INT_ASSIGN_MAX(void)
Select largest value.
Definition: assign.hpp:69
unsigned int size(void) const
Return size (cardinality) of domain.
Definition: int.hpp:84
void clause(Home home, BoolOpType o, const BoolVarArgs &x, const BoolVarArgs &y, int n, IntConLevel)
Post domain consistent propagator for Boolean clause with positive variables x and negative variables...
Definition: bool.cpp:824
bool one(void) const
Test whether domain is one.
Definition: bool.hpp:111
Recording AFC information for integer and Boolean variables.
Definition: int.hh:3588
IntValBranch INT_VAL_MIN(void)
Select smallest value.
Definition: val.hpp:68
Specification of a DFA transition.
Definition: int.hh:1885
void sqrt(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
Definition: arithmetic.cpp:110
Value iterator from range iterator.
With largest max.
Definition: int.hh:3743
unsigned int max_degree(void) const
Return maximal degree (in-degree and out-degree) of any state.
Definition: dfa.hpp:123
Reification specification.
Definition: int.hh:852
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:93
IntVarBranch INT_VAR_MAX_MAX(BranchTbl tbl)
Select variable with largest max.
Definition: var.hpp:207
void unshare(Home home, IntVarArgs &x, IntConLevel icl)
Replace multiple variable occurences in x by fresh variables.
Definition: unshare.cpp:133
unsigned int domsize
Domain size.
Definition: int.hh:2050
Range iterator for ranges of integer variable implementation.
Definition: var-imp.hpp:387
IntVarBranch INT_VAR_RND(Rnd r)
Select random variable (uniform distribution, for tie breaking)
Definition: var.hpp:113
IntVarBranch INT_VAR_AFC_MIN(double d, BranchTbl tbl)
Select variable with smallest accumulated failure count with decay factor d.
Definition: var.hpp:152
IntVarBranch INT_VAR_ACTIVITY_SIZE_MAX(double d, BranchTbl tbl)
Select variable with largest activity divided by domain size with decay factor d. ...
Definition: var.hpp:262
With largest domain size.
Definition: int.hh:3745
IntSharedArray values(void) const
Return shared array of values.
Definition: val.hpp:62
int min(void) const
Return smallest value of range.
Definition: int-set-1.hpp:203
Tuple ** tuples
Tuples index.
Definition: int.hh:2040
bool overflow_add(int n, int m)
Check whether adding n and m would overflow.
Definition: limits.hpp:83
IntVarBranch INT_VAR_MIN_MAX(BranchTbl tbl)
Select variable with largest min.
Definition: var.hpp:197
Tuple operator[](int i) const
Get tuple i.
Definition: tuple-set.hpp:148
void precede(Home home, const IntVarArgs &x, int s, int t, IntConLevel)
Post propagator that s precedes t in x.
Definition: precede.cpp:47
void init(const IntVar &x)
Initialize with ranges for integer variable x.
Definition: int.hpp:117
int min
Minimum and maximum in domain-values.
Definition: int.hh:2048
Integer set initialization.
Definition: int-set-1.hpp:57
void(* VoidFunction)(void)
Base type for any function pointer.
Definition: cast.hpp:45
int max(void) const
Return maximum of domain.
Definition: bool.hpp:75
bool in(int n) const
Test whether n is contained in domain.
Definition: bool.hpp:102
Less ( )
Definition: int.hh:905
Integer sets.
Definition: int.hh:169
int o_state
output state Default constructor
Definition: int.hh:1889
Tuple * nullpointer
Pointer to NULL-pointer.
Definition: int.hh:2054
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, IntConLevel cl)
Post propagators for the cumulatives constraint.
void element(Home home, IntSharedArray c, IntVar x0, IntVar x1, IntConLevel)
Post domain consistent propagator for .
Definition: element.cpp:45
Data stored for a Table.
Definition: int.hh:2032
IntActivity(void)
Construct as not yet initialized.
Definition: activity.hpp:41
struct Gecode::@512::NNF::@54::@55 b
For binary nodes (and, or, eqv)
ExtensionalPropKind
Extensional propagation kind.
Definition: int.hh:1980
Reify eqv(BoolVar x)
Use equivalence for reification.
Definition: reify.hpp:73
int n
Number of variables (size)
Definition: array.hpp:89
Disjunction.
Definition: int.hh:916
With largest degree divided by domain size.
Definition: int.hh:3747
IntVarArgs(const IntVarArgs &a)
Initialize from variable argument array a (copy elements)
Definition: int.hh:643
IntValBranch INT_VAL_NEAR_MIN(IntSharedArray n)
Try value nearest to a given value for a variable, in case of ties use the smaller value...
Definition: val.hpp:130
bool operator()(void) const
Test whether iterator still at a transition.
Definition: dfa.hpp:199
int * data
Tuples data.
Definition: int.hh:2044
Recording activities for integer and Boolean variables.
Definition: int.hh:3635
Select value according to user-defined functions.
Definition: int.hh:4017
Passing integer variables.
Definition: int.hh:634
unsigned int size(void) const
Return size (cardinality) of set.
Definition: int-set-1.hpp:161
SharedArray< int > IntSharedArray
Arrays of integers that can be shared among several element constraints.
Definition: int.hh:1343
void divmod(Home home, IntVar x0, IntVar x1, IntVar x2, IntVar x3, IntConLevel)
Post propagator for .
Definition: arithmetic.cpp:127
void sorted(Home home, const IntVarArgs &x, const IntVarArgs &y, const IntVarArgs &z, IntConLevel)
Post propagator that y is x sorted in increasing order.
Definition: sorted.cpp:43
void ite(Home home, BoolVar b, IntVar x, IntVar y, IntVar z, IntConLevel icl)
Post propagator for if-then-else constraint.
Definition: bool.cpp:911
Passing integer arguments.
Definition: int.hh:605
BoolVarArgs(InputIterator first, InputIterator last)
Initialize from InputIterator first and last.
Definition: int.hh:705
Passing Boolean variables.
Definition: int.hh:688
Select values greater than mean of smallest and largest value.
Definition: int.hh:3918
static const IntSet empty
Empty set.
Definition: int.hh:260
Tuple * tuple_data
Tuple index data.
Definition: int.hh:2042
int max(void) const
Maximum domain element.
Definition: tuple-set.hpp:162
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:232
With largest degree.
Definition: int.hh:3735
IntSet(void)
Initialize as empty set.
Definition: int-set-1.hpp:47
Boolean variable array.
Definition: int.hh:784
Boolean integer variables.
Definition: int.hh:489
unsigned int width(void) const
Return width of range (distance between minimum and maximum)
Definition: int-set-1.hpp:211
const int v[7]
Definition: distinct.cpp:206
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition: arithmetic.cpp:75
Class represeting a set of tuples.
Definition: int.hh:2020
BrancherHandle bh
With smallest degree divided by domain size.
Definition: int.hh:3746
TupleSet(void)
Construct empty tuple set.
Definition: tuple-set.hpp:83
void extensional(Home home, const IntVarArgs &x, DFA dfa, IntConLevel)
Post domain consistent propagator for extensional constraint described by a DFA.
Definition: extensional.cpp:45
With smallest max.
Definition: int.hh:3742
IntValBranch INT_VAL_MAX(void)
Select largest value.
Definition: val.hpp:78
Integer view for integer variables.
Definition: view.hpp:129
const int infinity
Infinity for integers.
Definition: int.hh:115
bool finalized(void) const
Is tuple set finalized.
Definition: tuple-set.hpp:127
Select the largest range of the variable domain if it has several ranges, otherwise select values gre...
Definition: int.hh:3920
void init(const IntVar &x)
Initialize with values x.
Definition: int.hpp:137
BoolVarArgs(int n)
Allocate array with n elements.
Definition: int.hh:695
Value branching information.
Definition: branch-val.hpp:44
int n_transitions(void) const
Return the number of transitions.
Definition: dfa.hpp:117
void div(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
Definition: arithmetic.cpp:135
unsigned int regret_max(void) const
Return regret of domain maximum (distance to next smaller value)
Definition: bool.hpp:93
IntValBranch INT_VALUES_MIN(void)
Try all values starting from smallest.
Definition: val.hpp:120
Variable branching information.
Definition: branch-var.hpp:55
IntAssign INT_ASSIGN(IntBranchVal v, IntBranchCommit c)
Select value as defined by the value function v and commit function c.
Definition: assign.hpp:79
BrancherHandle assign(Home home, const FloatVarArgs &x, FloatAssign fa, FloatBranchFilter bf, FloatVarValPrint vvp)
Assign all x with value selection vals.
Definition: branch.cpp:113
bool overflow_sub(int n, int m)
Check whether subtracting m from n would overflow.
Definition: limits.hpp:97
void expand(Home home, const IntVarArgs &x)
Expand decay factor into AFC or activity.
Definition: var.hpp:74
Select values not greater than mean of smallest and largest value.
Definition: int.hh:3917
Node * x
Pointer to corresponding Boolean expression node.
Definition: bool-expr.cpp:253
int max(void) const
Return largest value of range.
Definition: int-set-1.hpp:207
void count(Home home, const IntVarArgs &x, int n, IntRelType irt, int m, IntConLevel)
Post propagator for .
Definition: count.cpp:44
int(* IntBranchVal)(const Space &home, IntVar x, int i)
Branch value function type for integer variables.
Definition: int.hh:3538
IntActivity & operator=(const IntActivity &a)
Assignment operator.
Definition: activity.hpp:48
DFA(void)
Initialize for DFA accepting the empty word.
Definition: dfa.hpp:97
IntValBranch INT_VALUES_MAX(void)
Try all values starting from largest.
Definition: val.hpp:125
IntSharedArray n
Array of values for near strategies.
Definition: int.hh:3931
IntVarBranch INT_VAR_MERIT_MIN(IntBranchMerit bm, BranchTbl tbl)
Select variable with least merit according to branch merit function bm.
Definition: var.hpp:118
Integer variables.
Definition: int.hh:348
int symbol(void) const
Return symbol of current transition.
Definition: dfa.hpp:214
Select random value.
Definition: int.hh:3916
Which values to select for assignment.
Definition: int.hh:4009
int val(void) const
Return current symbol.
Definition: dfa.hpp:253
#define forceinline
Definition: config.hpp:129
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVal n)
Propagates .
Definition: rel.cpp:47
SymmetryHandle values_reflect(int lower, int upper)
The values from lower to upper (inclusive) can be reflected.
Definition: ldsb.cpp:110
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:242
The default consistency for a constraint.
Definition: int.hh:939
IntValBranch INT_VAL_NEAR_MAX(IntSharedArray n)
Try value nearest to a given value for a variable, in case of ties use the larger value...
Definition: val.hpp:135
Select
Which variable selection.
Definition: int.hh:3729
bool valid(int n)
Return whether n is in range.
Definition: limits.hpp:41
Value iterator for integer sets.
Definition: int.hh:310
int val(void) const
Return assigned value.
Definition: int.hpp:60
Equivalence.
Definition: int.hh:918
IntValBranch INT_VAL_MED(void)
Select greatest value not greater than the median.
Definition: val.hpp:73
Data stored for a DFA.
Definition: dfa.hpp:46
IntVarBranch INT_VAR_ACTIVITY_SIZE_MIN(double d, BranchTbl tbl)
Select variable with smallest activity divided by domain size with decay factor d.
Definition: var.hpp:252
Iterator for DFA transitions (sorted by symbols)
Definition: int.hh:1896
Int::LDSB::SymmetryObject * ref
Symmetry object that this handle refers to.
Definition: int.hh:4194
PrimArgArray< TaskType > TaskTypeArgs
Argument arrays for passing task type arguments.
Definition: int.hh:958
Random (uniform, for tie breaking)
Definition: int.hh:3731
int n_states(void) const
Return the number of states.
Definition: dfa.hpp:105
void distinct(Home home, const IntVarArgs &x, IntConLevel icl)
Post propagator for for all .
Definition: distinct.cpp:47
With smallest domain size.
Definition: int.hh:3744
The shared object.
Definition: core.hpp:88
void operator++(void)
Move iterator to next symbol.
Definition: dfa.hpp:245
void(* IntBranchCommit)(Space &home, unsigned int a, IntVar x, int i, int n)
Branch commit function type for integer variables.
Definition: int.hh:3562
Select
Which value selection.
Definition: int.hh:3912
int n
Number of elements.
Definition: array.hpp:524
BoolVarArgs(void)
Allocate empty array.
Definition: int.hh:693
Select greatest value not greater than the median.
Definition: int.hh:4014
double(* BranchTbl)(const Space &home, double w, double b)
Tie-break limit function.
Definition: branch-var.hpp:49
SymmetryHandle VariableSequenceSymmetry(const IntVarArgs &vars, int ss)
Variable sequences in x of size ss are interchangeable.
Definition: ldsb.cpp:94
IntVarRanges(void)
Default constructor.
Definition: int.hpp:110
IntAFC & operator=(const IntAFC &a)
Assignment operator.
Definition: afc.hpp:48
int(* BoolBranchVal)(const Space &home, BoolVar x, int i)
Branch value function type for Boolean variables.
Definition: int.hh:3549
const long long int llmax
Largest allowed long long integer value.
Definition: int.hh:117
With highest merit.
Definition: int.hh:3733
IntValBranch INT_VAL_NEAR_INC(IntSharedArray n)
Try value larger than a given value for a variable first.
Definition: val.hpp:140
Traits of arrays in Gecode.
Definition: array.hpp:68
void binpacking(Home home, const IntVarArgs &l, const IntVarArgs &b, const IntArgs &s, IntConLevel)
Post propagator for bin packing.
Definition: bin-packing.cpp:43
Bounds propagation or consistency.
Definition: int.hh:937
IntValBranch INT_VAL_SPLIT_MIN(void)
Select values not greater than mean of smallest and largest value.
Definition: val.hpp:88
int size
Number of Tuples.
Definition: int.hh:2038
Prefer little memory over speed.
Definition: int.hh:1983
void nooverlap(Home home, const IntVarArgs &x, const IntArgs &w, const IntVarArgs &y, const IntArgs &h, IntConLevel)
Post propagator for rectangle packing.
Definition: no-overlap.cpp:55
With largest min.
Definition: int.hh:3741
Argument array for variables.
Definition: array.hpp:53
bool none(void) const
Test whether domain is neither zero nor one.
Definition: bool.hpp:115
IntVarBranch INT_VAR_MAX_MIN(BranchTbl tbl)
Select variable with smallest max.
Definition: var.hpp:202
void wait(Home home, FloatVar x, void(*c)(Space &home))
Execute c when x becomes assigned.
Definition: exec.cpp:44
int min(void) const
Return minimum of domain.
Definition: int.hpp:66
Implication for reification.
Definition: int.hh:838
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:108
#define GECODE_VTABLE_EXPORT
Definition: support.hh:76
Disequality ( )
Definition: int.hh:903
BoolVar x
The Boolean control variable.
Definition: int.hh:855
int min(void) const
Return minimum of domain.
Definition: bool.hpp:67
bool in(int n) const
Test whether n is contained in domain.
Definition: int.hpp:101
BrancherHandle 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
unsigned int width(void) const
Return width of domain (distance between maximum and minimum)
Definition: int.hpp:80
unsigned int width(void) const
Return width of domain (distance between maximum and minimum)
Definition: bool.hpp:81
Random number generator.
Definition: rnd.hpp:46
Select largest value.
Definition: int.hh:3915
struct Gecode::@512::NNF::@54::@56 a
For atomic nodes.
Class for activity management.
Definition: activity.hpp:44
#define GECODE_INT_EXPORT
Definition: int.hh:76
int symbol_min(void) const
Return smallest symbol in DFA.
Definition: dfa.hpp:141
const long long int llinfinity
Infinity for long long integers.
Definition: int.hh:121
int max(void) const
Return maximum of entire set.
Definition: int-set-1.hpp:155
void add(const IntArgs &tuple)
Add tuple to tuple set.
Definition: tuple-set.hpp:98
IntSetRanges(void)
Default constructor.
Definition: int-set-1.hpp:178
int symbol_max(void) const
Return largest symbol in DFA.
Definition: dfa.hpp:148
void circuit(Home home, int offset, const IntVarArgs &x, IntConLevel icl)
Post propagator such that x forms a circuit.
Definition: circuit.cpp:45
With lowest activity.
Definition: int.hh:3738
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:717
double tbl(const Gecode::Space &, double w, double b)
Test function for tie-break limit function.
Definition: branch.cpp:65
bool range(void) const
Test whether domain is a range.
Definition: int.hpp:97
unsigned int regret_min(void) const
Return regret of domain minimum (distance to next larger value)
Definition: bool.hpp:89
ReifyMode
Mode for reification.
Definition: int.hh:824
void init(Home, const IntVarArgs &x, double d=1.0)
Initialize for integer variables x with decay factor d.
Definition: afc.hpp:63
Select value according to user-defined functions.
Definition: int.hh:3921
void nvalues(Home home, const IntVarArgs &x, IntRelType irt, int y, IntConLevel)
Post propagator for .
Definition: nvalues.cpp:44
ReifyMode rm
The reification mode.
Definition: int.hh:857
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
With largest max-regret.
Definition: int.hh:3775
void member(Home home, const IntVarArgs &x, IntVar y, IntConLevel)
Post domain consistent propagator for .
Definition: member.cpp:43
IntValBranch INT_VAL_NEAR_DEC(IntSharedArray n)
Try value smaller than a given value for a variable first.
Definition: val.hpp:145
Domain propagation or consistency.
Definition: int.hh:938
TupleSetI * implementation(void)
Get implementation.
Definition: tuple-set.hpp:91
void init(Home home, const IntVarArgs &x, double d=1.0, IntBranchMerit bm=NULL)
Initialize for integer variables x with decay factor d.
Definition: activity.cpp:55
IntVarBranch INT_VAR_SIZE_MAX(BranchTbl tbl)
Select variable with largest domain size.
Definition: var.hpp:217
Select largest value.
Definition: int.hh:4015
void unary(Home home, const IntVarArgs &s, const IntArgs &p, IntConLevel icl)
Post propagators for scheduling tasks on unary resources.
Definition: unary.cpp:48
Select value near to a given value, increment values first.
Definition: int.hh:3926
IntVarBranch INT_VAR_REGRET_MIN_MIN(BranchTbl tbl)
Select variable with smallest min-regret.
Definition: var.hpp:272
Select all values starting from smallest.
Definition: int.hh:3922
IntVarBranch INT_VAR_DEGREE_MIN(BranchTbl tbl)
Select variable with smallest degree.
Definition: var.hpp:142
T * a
Element array.
Definition: array.hpp:528
With smallest accumulated failure count divided by domain size.
Definition: int.hh:3748
Equivalence for reification (default)
Definition: int.hh:831
Reify pmi(BoolVar x)
Use reverse implication for reification.
Definition: reify.hpp:81
Boolean view for Boolean variables.
Definition: view.hpp:1315
Rnd r
Random number generator.
Definition: branch-val.hpp:47