Generated on Sat May 25 2013 18:00:35 for Gecode by doxygen 1.8.3.1
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-03-08 02:29:47 +0100 (Fri, 08 Mar 2013) $ by $Author: mears $
19  * $Revision: 13473 $
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 
209  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 
234  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 
246  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 
262  };
263 
269  class IntSetRanges {
270  private:
272  const IntSet::Range* i;
274  const IntSet::Range* e;
275  public:
277 
278 
279  IntSetRanges(void);
281  IntSetRanges(const IntSet& s);
283  void init(const IntSet& s);
285 
287 
288 
289  bool operator ()(void) const;
291  void operator ++(void);
293 
295 
296 
297  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 
315  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 
371  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 
405  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 
432  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 
455  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 
472  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 
505  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 
527  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 
554  bool range(void) const;
556  bool in(int n) const;
558 
560 
561 
562  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 
597 
598 }
599 
601 
602 namespace Gecode {
603 
605  class IntArgs : public PrimArgArray<int> {
606  public:
608 
609 
610  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 
639  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 
693  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 
744  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 
789  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 
978  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);
1275 
1276 
1288  GECODE_INT_EXPORT void
1289  precede(Home home, const IntVarArgs& x, int s, int t,
1298  GECODE_INT_EXPORT void
1299  precede(Home home, const IntVarArgs& x, const IntArgs& c,
1301 
1302 
1308 
1309  GECODE_INT_EXPORT void
1310  member(Home home, const IntVarArgs& x, IntVar y,
1311  IntConLevel icl=ICL_DEF);
1313  GECODE_INT_EXPORT void
1314  member(Home home, const BoolVarArgs& x, BoolVar y,
1315  IntConLevel icl=ICL_DEF);
1317  GECODE_INT_EXPORT void
1318  member(Home home, const IntVarArgs& x, IntVar y, Reify r,
1319  IntConLevel icl=ICL_DEF);
1321  GECODE_INT_EXPORT void
1322  member(Home home, const BoolVarArgs& x, BoolVar y, Reify r,
1323  IntConLevel icl=ICL_DEF);
1325 
1326 
1333 
1340  GECODE_INT_EXPORT void
1341  element(Home home, IntSharedArray n, IntVar x0, IntVar x1,
1342  IntConLevel icl=ICL_DEF);
1348  GECODE_INT_EXPORT void
1349  element(Home home, IntSharedArray n, IntVar x0, BoolVar x1,
1350  IntConLevel icl=ICL_DEF);
1356  GECODE_INT_EXPORT void
1357  element(Home home, IntSharedArray n, IntVar x0, int x1,
1358  IntConLevel icl=ICL_DEF);
1364  GECODE_INT_EXPORT void
1365  element(Home home, const IntVarArgs& x, IntVar y0, IntVar y1,
1366  IntConLevel icl=ICL_DEF);
1372  GECODE_INT_EXPORT void
1373  element(Home home, const IntVarArgs& x, IntVar y0, int y1,
1374  IntConLevel icl=ICL_DEF);
1376  GECODE_INT_EXPORT void
1377  element(Home home, const BoolVarArgs& x, IntVar y0, BoolVar y1,
1378  IntConLevel icl=ICL_DEF);
1380  GECODE_INT_EXPORT void
1381  element(Home home, const BoolVarArgs& x, IntVar y0, int y1,
1382  IntConLevel icl=ICL_DEF);
1383 
1396  GECODE_INT_EXPORT void
1397  element(Home home, IntSharedArray a,
1398  IntVar x, int w, IntVar y, int h, IntVar z,
1399  IntConLevel icl=ICL_DEF);
1412  GECODE_INT_EXPORT void
1413  element(Home home, IntSharedArray a,
1414  IntVar x, int w, IntVar y, int h, BoolVar z,
1415  IntConLevel icl=ICL_DEF);
1431  GECODE_INT_EXPORT void
1432  element(Home home, const IntVarArgs& a,
1433  IntVar x, int w, IntVar y, int h, IntVar z,
1434  IntConLevel icl=ICL_DEF);
1447  GECODE_INT_EXPORT void
1448  element(Home home, const BoolVarArgs& a,
1449  IntVar x, int w, IntVar y, int h, BoolVar z,
1450  IntConLevel icl=ICL_DEF);
1452 
1453 
1468  GECODE_INT_EXPORT void
1469  distinct(Home home, const IntVarArgs& x,
1470  IntConLevel icl=ICL_DEF);
1483  GECODE_INT_EXPORT void
1484  distinct(Home home, const IntArgs& n, const IntVarArgs& x,
1485  IntConLevel icl=ICL_DEF);
1487 
1488 
1506  GECODE_INT_EXPORT void
1507  channel(Home home, const IntVarArgs& x, const IntVarArgs& y,
1508  IntConLevel icl=ICL_DEF);
1509 
1523  GECODE_INT_EXPORT void
1524  channel(Home home, const IntVarArgs& x, int xoff,
1525  const IntVarArgs& y, int yoff,
1526  IntConLevel icl=ICL_DEF);
1527 
1529  GECODE_INT_EXPORT void
1530  channel(Home home, BoolVar x0, IntVar x1,
1531  IntConLevel icl=ICL_DEF);
1533  forceinline void
1534  channel(Home home, IntVar x0, BoolVar x1,
1535  IntConLevel icl=ICL_DEF) {
1536  channel(home,x1,x0,icl);
1537  }
1543  GECODE_INT_EXPORT void
1544  channel(Home home, const BoolVarArgs& x, IntVar y, int o=0,
1545  IntConLevel icl=ICL_DEF);
1547 
1548 
1565  GECODE_INT_EXPORT void
1566  sorted(Home home, const IntVarArgs& x, const IntVarArgs& y,
1567  IntConLevel icl=ICL_DEF);
1568 
1580  GECODE_INT_EXPORT void
1581  sorted(Home home, const IntVarArgs& x, const IntVarArgs& y,
1582  const IntVarArgs& z,
1583  IntConLevel icl=ICL_DEF);
1585 
1586 
1605  GECODE_INT_EXPORT void
1606  count(Home home, const IntVarArgs& x, int n, IntRelType irt, int m,
1607  IntConLevel icl=ICL_DEF);
1612  GECODE_INT_EXPORT void
1613  count(Home home, const IntVarArgs& x, const IntSet& y, IntRelType irt, int m,
1614  IntConLevel icl=ICL_DEF);
1622  GECODE_INT_EXPORT void
1623  count(Home home, const IntVarArgs& x, IntVar y, IntRelType irt, int m,
1624  IntConLevel icl=ICL_DEF);
1632  GECODE_INT_EXPORT void
1633  count(Home home, const IntVarArgs& x, const IntArgs& y, IntRelType irt, int m,
1634  IntConLevel icl=ICL_DEF);
1639  GECODE_INT_EXPORT void
1640  count(Home home, const IntVarArgs& x, int n, IntRelType irt, IntVar z,
1641  IntConLevel icl=ICL_DEF);
1646  GECODE_INT_EXPORT void
1647  count(Home home, const IntVarArgs& x, const IntSet& y, IntRelType irt, IntVar z,
1648  IntConLevel icl=ICL_DEF);
1656  GECODE_INT_EXPORT void
1657  count(Home home, const IntVarArgs& x, IntVar y, IntRelType irt, IntVar z,
1658  IntConLevel icl=ICL_DEF);
1666  GECODE_INT_EXPORT void
1667  count(Home home, const IntVarArgs& x, const IntArgs& y, IntRelType irt, IntVar z,
1668  IntConLevel icl=ICL_DEF);
1669 
1683  GECODE_INT_EXPORT void
1684  count(Home home, const IntVarArgs& x, const IntVarArgs& c,
1685  IntConLevel icl=ICL_DEF);
1686 
1700  GECODE_INT_EXPORT void
1701  count(Home home, const IntVarArgs& x, const IntSetArgs& c,
1702  IntConLevel icl=ICL_DEF);
1703 
1720  GECODE_INT_EXPORT void
1721  count(Home home, const IntVarArgs& x,
1722  const IntVarArgs& c, const IntArgs& v,
1723  IntConLevel icl=ICL_DEF);
1724 
1741  GECODE_INT_EXPORT void
1742  count(Home home, const IntVarArgs& x,
1743  const IntSetArgs& c, const IntArgs& v,
1744  IntConLevel icl=ICL_DEF);
1745 
1762  GECODE_INT_EXPORT void
1763  count(Home home, const IntVarArgs& x,
1764  const IntSet& c, const IntArgs& v,
1765  IntConLevel icl=ICL_DEF);
1766 
1768 
1783  GECODE_INT_EXPORT void
1784  nvalues(Home home, const IntVarArgs& x, IntRelType irt, int y,
1785  IntConLevel icl=ICL_DEF);
1789  GECODE_INT_EXPORT void
1790  nvalues(Home home, const IntVarArgs& x, IntRelType irt, IntVar y,
1791  IntConLevel icl=ICL_DEF);
1795  GECODE_INT_EXPORT void
1796  nvalues(Home home, const BoolVarArgs& x, IntRelType irt, int y,
1797  IntConLevel icl=ICL_DEF);
1801  GECODE_INT_EXPORT void
1802  nvalues(Home home, const BoolVarArgs& x, IntRelType irt, IntVar y,
1803  IntConLevel icl=ICL_DEF);
1805 
1826  GECODE_INT_EXPORT void
1827  sequence(Home home, const IntVarArgs& x, const IntSet& s,
1828  int q, int l, int u, IntConLevel icl=ICL_DEF);
1829 
1844  GECODE_INT_EXPORT void
1845  sequence(Home home, const BoolVarArgs& x, const IntSet& s,
1846  int q, int l, int u, IntConLevel icl=ICL_DEF);
1847 
1849 
1862 
1870  class DFA : public SharedHandle {
1871  private:
1873  class DFAI;
1874  public:
1876  class Transition {
1877  public:
1878  int i_state;
1879  int symbol;
1880  int o_state;
1881 
1882  Transition();
1884  Transition(int i_state0, int symbol0, int o_state0);
1885  };
1887  class Transitions {
1888  private:
1890  const Transition* c_trans;
1892  const Transition* e_trans;
1893  public:
1895  Transitions(const DFA& d);
1897  Transitions(const DFA& d, int n);
1899  bool operator ()(void) const;
1901  void operator ++(void);
1903  int i_state(void) const;
1905  int symbol(void) const;
1907  int o_state(void) const;
1908  };
1910  class Symbols {
1911  private:
1913  const Transition* c_trans;
1915  const Transition* e_trans;
1916  public:
1918  Symbols(const DFA& d);
1920  bool operator ()(void) const;
1922  void operator ++(void);
1924  int val(void) const;
1925  };
1926  public:
1927  friend class Transitions;
1929  DFA(void);
1942  DFA(int s, Transition t[], int f[], bool minimize=true);
1944  DFA(const DFA& d);
1946  int n_states(void) const;
1948  int n_transitions(void) const;
1950  unsigned int n_symbols(void) const;
1952  unsigned int max_degree(void) const;
1954  int final_fst(void) const;
1956  int final_lst(void) const;
1958  int symbol_min(void) const;
1960  int symbol_max(void) const;
1961  };
1962 
1963 
1975  };
1976 
1987  GECODE_INT_EXPORT void
1988  extensional(Home home, const IntVarArgs& x, DFA d,
1989  IntConLevel icl=ICL_DEF);
1990 
2001  GECODE_INT_EXPORT void
2002  extensional(Home home, const BoolVarArgs& x, DFA d,
2003  IntConLevel icl=ICL_DEF);
2004 
2011  class TupleSet : public SharedHandle {
2012  public:
2017  typedef int* Tuple;
2018 
2024  : public SharedHandle::Object {
2025  public:
2027  int arity;
2029  int size;
2035  int* data;
2037  int excess;
2039  int min, max;
2041  unsigned int domsize;
2046 
2048  template<class T>
2049  void add(T t);
2051  GECODE_INT_EXPORT void finalize(void);
2053  GECODE_INT_EXPORT void resize(void);
2055  bool finalized(void) const;
2057  TupleSetI(void);
2059  GECODE_INT_EXPORT virtual ~TupleSetI(void);
2061  GECODE_INT_EXPORT virtual SharedHandle::Object* copy(void) const;
2062  };
2063 
2065  TupleSetI* implementation(void);
2066 
2068  TupleSet(void);
2070  TupleSet(const TupleSet& d);
2071 
2073  void add(const IntArgs& tuple);
2075  void finalize(void);
2077  bool finalized(void) const;
2079  int arity(void) const;
2081  int tuples(void) const;
2083  Tuple operator [](int i) const;
2085  int min(void) const;
2087  int max(void) const;
2088  };
2089 
2108  GECODE_INT_EXPORT void
2109  extensional(Home home, const IntVarArgs& x, const TupleSet& t,
2111 
2122  GECODE_INT_EXPORT void
2123  extensional(Home home, const BoolVarArgs& x, const TupleSet& t,
2126 
2127 }
2128 
2131 
2132 namespace Gecode {
2133 
2145  GECODE_INT_EXPORT void
2146  min(Home home, IntVar x0, IntVar x1, IntVar x2,
2147  IntConLevel icl=ICL_DEF);
2155  GECODE_INT_EXPORT void
2156  min(Home home, const IntVarArgs& x, IntVar y,
2157  IntConLevel icl=ICL_DEF);
2163  GECODE_INT_EXPORT void
2164  max(Home home, IntVar x0, IntVar x1, IntVar x2,
2165  IntConLevel icl=ICL_DEF);
2173  GECODE_INT_EXPORT void
2174  max(Home home, const IntVarArgs& x, IntVar y,
2175  IntConLevel icl=ICL_DEF);
2176 
2182  GECODE_INT_EXPORT void
2183  abs(Home home, IntVar x0, IntVar x1,
2184  IntConLevel icl=ICL_DEF);
2185 
2191  GECODE_INT_EXPORT void
2192  mult(Home home, IntVar x0, IntVar x1, IntVar x2,
2193  IntConLevel icl=ICL_DEF);
2194 
2199  GECODE_INT_EXPORT void
2200  divmod(Home home, IntVar x0, IntVar x1, IntVar x2, IntVar x3,
2201  IntConLevel icl=ICL_DEF);
2202 
2207  GECODE_INT_EXPORT void
2208  div(Home home, IntVar x0, IntVar x1, IntVar x2,
2209  IntConLevel icl=ICL_DEF);
2210 
2215  GECODE_INT_EXPORT void
2216  mod(Home home, IntVar x0, IntVar x1, IntVar x2,
2217  IntConLevel icl=ICL_DEF);
2218 
2224  GECODE_INT_EXPORT void
2225  sqr(Home home, IntVar x0, IntVar x1,
2226  IntConLevel icl=ICL_DEF);
2227 
2233  GECODE_INT_EXPORT void
2234  sqrt(Home home, IntVar x0, IntVar x1,
2235  IntConLevel icl=ICL_DEF);
2236 
2245  GECODE_INT_EXPORT void
2246  pow(Home home, IntVar x0, int n, IntVar x1,
2247  IntConLevel icl=ICL_DEF);
2248 
2257  GECODE_INT_EXPORT void
2258  nroot(Home home, IntVar x0, int n, IntVar x1,
2259  IntConLevel icl=ICL_DEF);
2260 
2262 
2294  GECODE_INT_EXPORT void
2295  linear(Home home, const IntVarArgs& x,
2296  IntRelType irt, int c,
2297  IntConLevel icl=ICL_DEF);
2301  GECODE_INT_EXPORT void
2302  linear(Home home, const IntVarArgs& x,
2303  IntRelType irt, IntVar y,
2304  IntConLevel icl=ICL_DEF);
2308  GECODE_INT_EXPORT void
2309  linear(Home home, const IntVarArgs& x,
2310  IntRelType irt, int c, Reify r,
2311  IntConLevel icl=ICL_DEF);
2315  GECODE_INT_EXPORT void
2316  linear(Home home, const IntVarArgs& x,
2317  IntRelType irt, IntVar y, Reify r,
2318  IntConLevel icl=ICL_DEF);
2325  GECODE_INT_EXPORT void
2326  linear(Home home, const IntArgs& a, const IntVarArgs& x,
2327  IntRelType irt, int c,
2328  IntConLevel icl=ICL_DEF);
2335  GECODE_INT_EXPORT void
2336  linear(Home home, const IntArgs& a, const IntVarArgs& x,
2337  IntRelType irt, IntVar y,
2338  IntConLevel icl=ICL_DEF);
2345  GECODE_INT_EXPORT void
2346  linear(Home home, const IntArgs& a, const IntVarArgs& x,
2347  IntRelType irt, int c, Reify r,
2348  IntConLevel icl=ICL_DEF);
2355  GECODE_INT_EXPORT void
2356  linear(Home home, const IntArgs& a, const IntVarArgs& x,
2357  IntRelType irt, IntVar y, Reify r,
2358  IntConLevel icl=ICL_DEF);
2359 
2360 
2388  GECODE_INT_EXPORT void
2389  linear(Home home, const BoolVarArgs& x,
2390  IntRelType irt, int c,
2391  IntConLevel icl=ICL_DEF);
2395  GECODE_INT_EXPORT void
2396  linear(Home home, const BoolVarArgs& x,
2397  IntRelType irt, int c, Reify r,
2398  IntConLevel icl=ICL_DEF);
2402  GECODE_INT_EXPORT void
2403  linear(Home home, const BoolVarArgs& x,
2404  IntRelType irt, IntVar y,
2405  IntConLevel icl=ICL_DEF);
2409  GECODE_INT_EXPORT void
2410  linear(Home home, const BoolVarArgs& x,
2411  IntRelType irt, IntVar y, Reify r,
2412  IntConLevel icl=ICL_DEF);
2419  GECODE_INT_EXPORT void
2420  linear(Home home, const IntArgs& a, const BoolVarArgs& x,
2421  IntRelType irt, int c,
2422  IntConLevel icl=ICL_DEF);
2429  GECODE_INT_EXPORT void
2430  linear(Home home, const IntArgs& a, const BoolVarArgs& x,
2431  IntRelType irt, int c, Reify r,
2432  IntConLevel icl=ICL_DEF);
2439  GECODE_INT_EXPORT void
2440  linear(Home home, const IntArgs& a, const BoolVarArgs& x,
2441  IntRelType irt, IntVar y,
2442  IntConLevel icl=ICL_DEF);
2449  GECODE_INT_EXPORT void
2450  linear(Home home, const IntArgs& a, const BoolVarArgs& x,
2451  IntRelType irt, IntVar y, Reify r,
2452  IntConLevel icl=ICL_DEF);
2453 
2454 
2481  GECODE_INT_EXPORT void
2482  binpacking(Home home,
2483  const IntVarArgs& l,
2484  const IntVarArgs& b, const IntArgs& s,
2485  IntConLevel icl=ICL_DEF);
2504  GECODE_INT_EXPORT void
2505  nooverlap(Home home,
2506  const IntVarArgs& x, const IntArgs& w,
2507  const IntVarArgs& y, const IntArgs& h,
2508  IntConLevel icl=ICL_DEF);
2522  GECODE_INT_EXPORT void
2523  nooverlap(Home home,
2524  const IntVarArgs& x, const IntArgs& w,
2525  const IntVarArgs& y, const IntArgs& h,
2526  const BoolVarArgs& o,
2527  IntConLevel icl=ICL_DEF);
2544  GECODE_INT_EXPORT void
2545  nooverlap(Home home,
2546  const IntVarArgs& x0, const IntVarArgs& w, const IntVarArgs& x1,
2547  const IntVarArgs& y0, const IntVarArgs& h, const IntVarArgs& y1,
2548  IntConLevel icl=ICL_DEF);
2566  GECODE_INT_EXPORT void
2567  nooverlap(Home home,
2568  const IntVarArgs& x0, const IntVarArgs& w, const IntVarArgs& x1,
2569  const IntVarArgs& y0, const IntVarArgs& h, const IntVarArgs& y1,
2570  const BoolVarArgs& o,
2571  IntConLevel icl=ICL_DEF);
2572 
2573 
2579 
2622  GECODE_INT_EXPORT void
2623  cumulatives(Home home, const IntVarArgs& m,
2624  const IntVarArgs& s, const IntVarArgs& p,
2625  const IntVarArgs& e, const IntVarArgs& u,
2626  const IntArgs& c, bool at_most,
2627  IntConLevel icl=ICL_DEF);
2632  GECODE_INT_EXPORT void
2633  cumulatives(Home home, const IntArgs& m,
2634  const IntVarArgs& s, const IntVarArgs& p,
2635  const IntVarArgs& e, const IntVarArgs& u,
2636  const IntArgs& c, bool at_most,
2637  IntConLevel icl=ICL_DEF);
2642  GECODE_INT_EXPORT void
2643  cumulatives(Home home, const IntVarArgs& m,
2644  const IntVarArgs& s, const IntArgs& p,
2645  const IntVarArgs& e, const IntVarArgs& u,
2646  const IntArgs& c, bool at_most,
2647  IntConLevel icl=ICL_DEF);
2652  GECODE_INT_EXPORT void
2653  cumulatives(Home home, const IntArgs& m,
2654  const IntVarArgs& s, const IntArgs& p,
2655  const IntVarArgs& e, const IntVarArgs& u,
2656  const IntArgs& c, bool at_most,
2657  IntConLevel icl=ICL_DEF);
2662  GECODE_INT_EXPORT void
2663  cumulatives(Home home, const IntVarArgs& m,
2664  const IntVarArgs& s, const IntVarArgs& p,
2665  const IntVarArgs& e, const IntArgs& u,
2666  const IntArgs& c, bool at_most,
2667  IntConLevel icl=ICL_DEF);
2672  GECODE_INT_EXPORT void
2673  cumulatives(Home home, const IntArgs& m,
2674  const IntVarArgs& s, const IntVarArgs& p,
2675  const IntVarArgs& e, const IntArgs& u,
2676  const IntArgs& c, bool at_most,
2677  IntConLevel icl=ICL_DEF);
2682  GECODE_INT_EXPORT void
2683  cumulatives(Home home, const IntVarArgs& m,
2684  const IntVarArgs& s, const IntArgs& p,
2685  const IntVarArgs& e, const IntArgs& u,
2686  const IntArgs& c, bool at_most,
2687  IntConLevel icl=ICL_DEF);
2692  GECODE_INT_EXPORT void
2693  cumulatives(Home home, const IntArgs& m,
2694  const IntVarArgs& s, const IntArgs& p,
2695  const IntVarArgs& e, const IntArgs& u,
2696  const IntArgs& c, bool at_most,
2697  IntConLevel icl=ICL_DEF);
2698 
2717  GECODE_INT_EXPORT void
2718  unary(Home home, const IntVarArgs& s, const IntArgs& p,
2719  IntConLevel icl=ICL_DEF);
2720 
2741  GECODE_INT_EXPORT void
2742  unary(Home home, const IntVarArgs& s, const IntArgs& p,
2743  const BoolVarArgs& m, IntConLevel icl=ICL_DEF);
2744 
2773  GECODE_INT_EXPORT void
2774  unary(Home home, const TaskTypeArgs& t,
2775  const IntVarArgs& flex, const IntArgs& fix, IntConLevel icl=ICL_DEF);
2776 
2807  GECODE_INT_EXPORT void
2808  unary(Home home, const TaskTypeArgs& t,
2809  const IntVarArgs& flex, const IntArgs& fix,
2810  const BoolVarArgs& m, IntConLevel icl=ICL_DEF);
2811 
2831  GECODE_INT_EXPORT void
2832  unary(Home home, const IntVarArgs& s, const IntVarArgs& p,
2833  const IntVarArgs& e, IntConLevel icl=ICL_DEF);
2834 
2856  GECODE_INT_EXPORT void
2857  unary(Home home, const IntVarArgs& s, const IntVarArgs& p,
2858  const IntVarArgs& e, const BoolVarArgs& m, IntConLevel icl=ICL_DEF);
2859 
2894  GECODE_INT_EXPORT void
2895  cumulative(Home home, int c, const TaskTypeArgs& t,
2896  const IntVarArgs& flex, const IntArgs& fix, const IntArgs& u,
2897  IntConLevel icl=ICL_DEF);
2898 
2899 
2904  GECODE_INT_EXPORT void
2905  cumulative(Home home, IntVar c, const TaskTypeArgs& t,
2906  const IntVarArgs& flex, const IntArgs& fix, const IntArgs& u,
2907  IntConLevel icl=ICL_DEF);
2908 
2945  GECODE_INT_EXPORT void
2946  cumulative(Home home, int c, const TaskTypeArgs& t,
2947  const IntVarArgs& flex, const IntArgs& fix, const IntArgs& u,
2948  const BoolVarArgs& m, IntConLevel icl=ICL_DEF);
2949 
2953  GECODE_INT_EXPORT void
2954  cumulative(Home home, IntVar c, const TaskTypeArgs& t,
2955  const IntVarArgs& flex, const IntArgs& fix, const IntArgs& u,
2956  const BoolVarArgs& m, IntConLevel icl=ICL_DEF);
2957 
2982  GECODE_INT_EXPORT void
2983  cumulative(Home home, int c, const IntVarArgs& s, const IntArgs& p,
2984  const IntArgs& u, IntConLevel icl=ICL_DEF);
2985 
2989  GECODE_INT_EXPORT void
2990  cumulative(Home home, IntVar c, const IntVarArgs& s, const IntArgs& p,
2991  const IntArgs& u, IntConLevel icl=ICL_DEF);
2992 
3019  GECODE_INT_EXPORT void
3020  cumulative(Home home, int c, const IntVarArgs& s, const IntArgs& p,
3021  const IntArgs& u, const BoolVarArgs& m, IntConLevel icl=ICL_DEF);
3022 
3026  GECODE_INT_EXPORT void
3027  cumulative(Home home, IntVar c, const IntVarArgs& s, const IntArgs& p,
3028  const IntArgs& u, const BoolVarArgs& m, IntConLevel icl=ICL_DEF);
3029 
3058  GECODE_INT_EXPORT void
3059  cumulative(Home home, int c, const IntVarArgs& s, const IntVarArgs& p,
3060  const IntVarArgs& e, const IntArgs& u, IntConLevel icl=ICL_DEF);
3061 
3065  GECODE_INT_EXPORT void
3066  cumulative(Home home, IntVar c, const IntVarArgs& s, const IntVarArgs& p,
3067  const IntVarArgs& e, const IntArgs& u, IntConLevel icl=ICL_DEF);
3068 
3099  GECODE_INT_EXPORT void
3100  cumulative(Home home, int c, const IntVarArgs& s, const IntVarArgs& p,
3101  const IntVarArgs& e, const IntArgs& u, const BoolVarArgs& m,
3102  IntConLevel icl=ICL_DEF);
3103 
3107  GECODE_INT_EXPORT void
3108  cumulative(Home home, IntVar c, const IntVarArgs& s, const IntVarArgs& p,
3109  const IntVarArgs& e, const IntArgs& u, const BoolVarArgs& m,
3110  IntConLevel icl=ICL_DEF);
3112 
3113 
3133  GECODE_INT_EXPORT void
3134  circuit(Home home, const IntVarArgs& x,
3135  IntConLevel icl=ICL_DEF);
3151  GECODE_INT_EXPORT void
3152  circuit(Home home, int offset, const IntVarArgs& x,
3153  IntConLevel icl=ICL_DEF);
3175  GECODE_INT_EXPORT void
3176  circuit(Home home,
3177  const IntArgs& c,
3178  const IntVarArgs& x, const IntVarArgs& y, IntVar z,
3179  IntConLevel icl=ICL_DEF);
3202  GECODE_INT_EXPORT void
3203  circuit(Home home,
3204  const IntArgs& c, int offset,
3205  const IntVarArgs& x, const IntVarArgs& y, IntVar z,
3206  IntConLevel icl=ICL_DEF);
3225  GECODE_INT_EXPORT void
3226  circuit(Home home,
3227  const IntArgs& c,
3228  const IntVarArgs& x, IntVar z,
3229  IntConLevel icl=ICL_DEF);
3250  GECODE_INT_EXPORT void
3251  circuit(Home home,
3252  const IntArgs& c, int offset,
3253  const IntVarArgs& x, IntVar z,
3254  IntConLevel icl=ICL_DEF);
3270  GECODE_INT_EXPORT void
3271  path(Home home, const IntVarArgs& x, IntVar s, IntVar e,
3272  IntConLevel icl=ICL_DEF);
3290  GECODE_INT_EXPORT void
3291  path(Home home, int offset, const IntVarArgs& x, IntVar s, IntVar e,
3292  IntConLevel icl=ICL_DEF);
3315  GECODE_INT_EXPORT void
3316  path(Home home,
3317  const IntArgs& c,
3318  const IntVarArgs& x, IntVar s, IntVar e, const IntVarArgs& y, IntVar z,
3319  IntConLevel icl=ICL_DEF);
3344  GECODE_INT_EXPORT void
3345  path(Home home,
3346  const IntArgs& c, int offset,
3347  const IntVarArgs& x, IntVar s, IntVar e, const IntVarArgs& y, IntVar z,
3348  IntConLevel icl=ICL_DEF);
3369  GECODE_INT_EXPORT void
3370  path(Home home,
3371  const IntArgs& c,
3372  const IntVarArgs& x, IntVar s, IntVar e, IntVar z,
3373  IntConLevel icl=ICL_DEF);
3396  GECODE_INT_EXPORT void
3397  path(Home home,
3398  const IntArgs& c, int offset,
3399  const IntVarArgs& x, IntVar s, IntVar e, IntVar z,
3400  IntConLevel icl=ICL_DEF);
3402 
3403 
3404 
3413 
3414  GECODE_INT_EXPORT void
3415  wait(Home home, IntVar x, void (*c)(Space& home),
3416  IntConLevel icl=ICL_DEF);
3418  GECODE_INT_EXPORT void
3419  wait(Home home, BoolVar x, void (*c)(Space& home),
3420  IntConLevel icl=ICL_DEF);
3422  GECODE_INT_EXPORT void
3423  wait(Home home, const IntVarArgs& x, void (*c)(Space& home),
3424  IntConLevel icl=ICL_DEF);
3426  GECODE_INT_EXPORT void
3427  wait(Home home, const BoolVarArgs& x, void (*c)(Space& home),
3428  IntConLevel icl=ICL_DEF);
3430  GECODE_INT_EXPORT void
3431  when(Home home, BoolVar x,
3432  void (*t)(Space& home), void (*e)(Space& home)= NULL,
3433  IntConLevel icl=ICL_DEF);
3435 
3436 
3461  GECODE_INT_EXPORT void
3462  unshare(Home home, IntVarArgs& x,
3463  IntConLevel icl=ICL_DEF);
3465  GECODE_INT_EXPORT void
3466  unshare(Home home, BoolVarArgs& x,
3467  IntConLevel icl=ICL_DEF);
3469 
3470 }
3471 
3472 namespace Gecode {
3473 
3487  typedef bool (*IntBranchFilter)(const Space& home, IntVar x, int i);
3496  typedef bool (*BoolBranchFilter)(const Space& home, BoolVar x, int i);
3497 
3507  typedef double (*IntBranchMerit)(const Space& home, IntVar x, int i);
3517  typedef double (*BoolBranchMerit)(const Space& home, BoolVar x, int i);
3518 
3529  typedef int (*IntBranchVal)(const Space& home, IntVar x, int i);
3540  typedef int (*BoolBranchVal)(const Space& home, BoolVar x, int i);
3541 
3553  typedef void (*IntBranchCommit)(Space& home, unsigned int a,
3554  IntVar x, int i, int n);
3566  typedef void (*BoolBranchCommit)(Space& home, unsigned int a,
3567  BoolVar x, int i, int n);
3568 
3569 }
3570 
3572 
3573 namespace Gecode {
3574 
3580  class IntAFC : public AFC {
3581  public:
3589  IntAFC(void);
3591  IntAFC(const IntAFC& a);
3593  IntAFC& operator =(const IntAFC& a);
3595  IntAFC(Home home, const IntVarArgs& x, double d=1.0);
3597  IntAFC(Home home, const BoolVarArgs& x, double d=1.0);
3605  void init(Home, const IntVarArgs& x, double d=1.0);
3613  void init(Home, const BoolVarArgs& x, double d=1.0);
3614  };
3615 
3616 }
3617 
3618 #include <gecode/int/branch/afc.hpp>
3619 
3620 namespace Gecode {
3621 
3627  class IntActivity : public Activity {
3628  public:
3636  IntActivity(void);
3638  IntActivity(const IntActivity& a);
3640  IntActivity& operator =(const IntActivity& a);
3643  IntActivity(Home home, const IntVarArgs& x, double d=1.0);
3646  IntActivity(Home home, const BoolVarArgs& x, double d=1.0);
3654  GECODE_INT_EXPORT void
3655  init(Home, const IntVarArgs& x, double d=1.0);
3663  GECODE_INT_EXPORT void
3664  init(Home, const BoolVarArgs& x, double d=1.0);
3665  };
3666 
3667 }
3668 
3670 
3671 namespace Gecode {
3672 
3678  class IntVarBranch : public VarBranch {
3679  public:
3681  enum Select {
3682  SEL_NONE = 0,
3704 
3728  };
3729  protected:
3732  public:
3734  IntVarBranch(void);
3736  IntVarBranch(Rnd r);
3740  IntVarBranch(Select s, double d, BranchTbl t);
3748  Select select(void) const;
3750  void expand(Home home, const IntVarArgs& x);
3752  void expand(Home home, const BoolVarArgs& x);
3753  };
3754 
3760 
3761  IntVarBranch INT_VAR_NONE(void);
3777  IntVarBranch INT_VAR_AFC_MIN(double d=1.0, BranchTbl tbl=NULL);
3781  IntVarBranch INT_VAR_AFC_MAX(double d=1.0, BranchTbl tbl=NULL);
3785  IntVarBranch INT_VAR_ACTIVITY_MIN(double d=1.0, BranchTbl tbl=NULL);
3789  IntVarBranch INT_VAR_ACTIVITY_MAX(double d=1.0, BranchTbl tbl=NULL);
3809  IntVarBranch INT_VAR_AFC_SIZE_MIN(double d=1.0, BranchTbl tbl=NULL);
3813  IntVarBranch INT_VAR_AFC_SIZE_MAX(double d=1.0, BranchTbl tbl=NULL);
3849 
3850 }
3851 
3852 #include <gecode/int/branch/var.hpp>
3853 
3854 namespace Gecode {
3855 
3861  class IntValBranch : public ValBranch {
3862  public:
3864  enum Select {
3880  };
3881  protected:
3886  public:
3890  IntValBranch(Rnd r);
3896  Select select(void) const;
3898  IntSharedArray values(void) const;
3899  };
3900 
3906 
3907  IntValBranch INT_VAL_MIN(void);
3909  IntValBranch INT_VAL_MED(void);
3911  IntValBranch INT_VAL_MAX(void);
3949 
3950 }
3951 
3952 #include <gecode/int/branch/val.hpp>
3953 
3954 namespace Gecode {
3955 
3961  class IntAssign : public ValBranch {
3962  public:
3964  enum Select {
3970  };
3971  protected:
3974  public:
3978  IntAssign(Rnd r);
3982  Select select(void) const;
3983  };
3984 
3990 
3991  IntAssign INT_ASSIGN_MIN(void);
3993  IntAssign INT_ASSIGN_MED(void);
3995  IntAssign INT_ASSIGN_MAX(void);
4013 
4014 }
4015 
4017 
4018 namespace Gecode {
4024  GECODE_INT_EXPORT BrancherHandle
4025  branch(Home home, const IntVarArgs& x,
4026  IntVarBranch vars, IntValBranch vals,
4027  IntBranchFilter bf=NULL);
4033  GECODE_INT_EXPORT BrancherHandle
4034  branch(Home home, const IntVarArgs& x,
4035  TieBreak<IntVarBranch> vars, IntValBranch vals,
4036  IntBranchFilter bf=NULL);
4042  GECODE_INT_EXPORT BrancherHandle
4043  branch(Home home, IntVar x, IntValBranch vals);
4049  GECODE_INT_EXPORT BrancherHandle
4050  branch(Home home, const BoolVarArgs& x,
4051  IntVarBranch vars, IntValBranch vals,
4052  BoolBranchFilter bf=NULL);
4058  GECODE_INT_EXPORT BrancherHandle
4059  branch(Home home, const BoolVarArgs& x,
4060  TieBreak<IntVarBranch> vars, IntValBranch vals,
4061  BoolBranchFilter bf=NULL);
4067  GECODE_INT_EXPORT BrancherHandle
4068  branch(Home home, BoolVar x, IntValBranch vals);
4069 
4075  GECODE_INT_EXPORT BrancherHandle
4076  assign(Home home, const IntVarArgs& x, IntAssign vals,
4077  IntBranchFilter ibf=NULL);
4083  GECODE_INT_EXPORT BrancherHandle
4084  assign(Home home, IntVar x, IntAssign vals);
4090  GECODE_INT_EXPORT BrancherHandle
4091  assign(Home home, const BoolVarArgs& x, IntAssign vals,
4092  BoolBranchFilter bbf=NULL);
4098  GECODE_INT_EXPORT BrancherHandle
4099  assign(Home home, BoolVar x, IntAssign vals);
4100 
4101 }
4102 
4103 namespace Gecode {
4104 
4108  template<class Char, class Traits>
4109  std::basic_ostream<Char,Traits>&
4110  operator <<(std::basic_ostream<Char,Traits>& os, const DFA& d);
4111 
4115  template<class Char, class Traits>
4116  std::basic_ostream<Char,Traits>&
4117  operator <<(std::basic_ostream<Char,Traits>& os, const TupleSet& ts);
4118 
4119 }
4120 
4121 // LDSB-related declarations.
4122 namespace Gecode {
4123 
4124  namespace Int { namespace LDSB {
4125  class SymmetryObject;
4126  }}
4127 
4134  public:
4138  void increment(void);
4140  void decrement(void);
4141  public:
4143  SymmetryHandle(void);
4147  SymmetryHandle(const SymmetryHandle& h);
4149  const SymmetryHandle& operator=(const SymmetryHandle& h);
4151  ~SymmetryHandle(void);
4152  };
4153  class Symmetries;
4155  template<>
4157  public:
4161  };
4162 
4169 
4170  class Symmetries : public ArgArray<SymmetryHandle> {};
4171  // If this is instead a typedef, strange things happen with the
4172  // overloading of the "branch" function.
4173 
4180  const IntArgs& indices);
4208 
4210  GECODE_INT_EXPORT SymmetryHandle values_reflect(int lower, int upper);
4214 
4227  branch(Home home, const IntVarArgs& x,
4228  IntVarBranch vars, IntValBranch vals,
4229  const Symmetries& syms, IntBranchFilter bf=NULL);
4242  branch(Home home, const IntVarArgs& x,
4244  const Symmetries& syms, IntBranchFilter bf=NULL);
4257  branch(Home home, const BoolVarArgs& x,
4258  IntVarBranch vars, IntValBranch vals,
4259  const Symmetries& syms, BoolBranchFilter bf=NULL);
4272  branch(Home home, const BoolVarArgs& x,
4274  const Symmetries& syms, BoolBranchFilter bf=NULL);
4275 }
4276 
4277 #endif
4278 
4279 // IFDEF: GECODE_HAS_INT_VARS
4280 // STATISTICS: int-post
4281