Generated on Sat Nov 9 2013 19:18:27 for Gecode by doxygen 1.8.4
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