00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048 #ifndef __GECODE_INT_HH__
00049 #define __GECODE_INT_HH__
00050
00051 #include <climits>
00052 #include <cfloat>
00053 #include <iostream>
00054
00055 #include <vector>
00056
00057 #include <functional>
00058
00059 #include <gecode/kernel.hh>
00060 #include <gecode/search.hh>
00061 #include <gecode/iter.hh>
00062
00063
00064
00065
00066
00067 #if !defined(GECODE_STATIC_LIBS) && \
00068 (defined(__CYGWIN__) || defined(__MINGW32__) || defined(_MSC_VER))
00069
00070 #ifdef GECODE_BUILD_INT
00071 #define GECODE_INT_EXPORT __declspec( dllexport )
00072 #else
00073 #define GECODE_INT_EXPORT __declspec( dllimport )
00074 #endif
00075
00076 #else
00077
00078 #ifdef GECODE_GCC_HAS_CLASS_VISIBILITY
00079 #define GECODE_INT_EXPORT __attribute__ ((visibility("default")))
00080 #else
00081 #define GECODE_INT_EXPORT
00082 #endif
00083
00084 #endif
00085
00086
00087 #ifndef GECODE_BUILD_INT
00088 #define GECODE_LIBRARY_NAME "Int"
00089 #include <gecode/support/auto-link.hpp>
00090 #endif
00091
00103 #include <gecode/int/exception.hpp>
00104
00105 namespace Gecode { namespace Int {
00106
00114 namespace Limits {
00116 const int max = INT_MAX - 1;
00118 const int min = -max;
00120 const int infinity = max + 1;
00122 const long long int llmax = LLONG_MAX - 1;
00124 const long long int llmin = -llmax;
00126 const long long int llinfinity = llmax + 1;
00128 bool valid(int n);
00130 bool valid(long long int n);
00132 void check(int n, const char* l);
00134 void check(long long int n, const char* l);
00136 void positive(int n, const char* l);
00138 void positive(long long int n, const char* l);
00140 void nonnegative(int n, const char* l);
00142 void nonnegative(long long int n, const char* l);
00144 bool overflow_add(int n, int m);
00146 bool overflow_add(long long int n, long long int m);
00148 bool overflow_sub(int n, int m);
00150 bool overflow_sub(long long int n, long long int m);
00152 bool overflow_mul(int n, int m);
00154 bool overflow_mul(long long int n, long long int m);
00155 }
00156
00157 }}
00158
00159 #include <gecode/int/limits.hpp>
00160
00161 namespace Gecode {
00162
00163 class IntSetRanges;
00164
00165 template<class I> class IntSetInit;
00166
00174 class IntSet : public SharedHandle {
00175 friend class IntSetRanges;
00176 template<class I> friend class IntSetInit;
00177 private:
00179 class Range {
00180 public:
00181 int min, max;
00182 };
00183 class IntSetObject : public SharedHandle::Object {
00184 public:
00186 unsigned int size;
00188 int n;
00190 Range* r;
00192 GECODE_INT_EXPORT static IntSetObject* allocate(int m);
00194 GECODE_INT_EXPORT SharedHandle::Object* copy(void) const;
00196 GECODE_INT_EXPORT bool in(int n) const;
00198 GECODE_INT_EXPORT virtual ~IntSetObject(void);
00199 };
00201 class MinInc;
00203 GECODE_INT_EXPORT void normalize(Range* r, int n);
00205 GECODE_INT_EXPORT void init(int n, int m);
00207 GECODE_INT_EXPORT void init(const int r[], int n);
00209 GECODE_INT_EXPORT void init(const int r[][2], int n);
00210 public:
00212
00213
00214 IntSet(void);
00219 IntSet(int n, int m);
00221 IntSet(const int r[], int n);
00227 IntSet(const int r[][2], int n);
00229 template<class I>
00230 explicit IntSet(I& i);
00232 template<class I>
00233 explicit IntSet(const I& i);
00235
00237
00238
00239 int ranges(void) const;
00241 int min(int i) const;
00243 int max(int i) const;
00245 unsigned int width(int i) const;
00247
00249
00250
00251 bool in(int n) const;
00253 unsigned int size(void) const;
00255 unsigned int width(void) const;
00257 int min(void) const;
00259 int max(void) const;
00261
00263
00264
00265 GECODE_INT_EXPORT static const IntSet empty;
00267 };
00268
00274 class IntSetRanges {
00275 private:
00277 const IntSet::Range* i;
00279 const IntSet::Range* e;
00280 public:
00282
00283
00284 IntSetRanges(void);
00286 IntSetRanges(const IntSet& s);
00288 void init(const IntSet& s);
00290
00292
00293
00294 bool operator ()(void) const;
00296 void operator ++(void);
00298
00300
00301
00302 int min(void) const;
00304 int max(void) const;
00306 unsigned int width(void) const;
00308 };
00309
00315 class IntSetValues : public Iter::Ranges::ToValues<IntSetRanges> {
00316 public:
00318
00319
00320 IntSetValues(void);
00322 IntSetValues(const IntSet& s);
00324 void init(const IntSet& s);
00326 };
00327
00332 template<class Char, class Traits>
00333 std::basic_ostream<Char,Traits>&
00334 operator <<(std::basic_ostream<Char,Traits>& os, const IntSet& s);
00335
00336 }
00337
00338 #include <gecode/int/int-set-1.hpp>
00339
00340 #include <gecode/int/var-imp.hpp>
00341
00342 namespace Gecode {
00343
00344 namespace Int {
00345 class IntView;
00346 }
00347
00353 class IntVar : public VarImpVar<Int::IntVarImp> {
00354 friend class IntVarArray;
00355 friend class IntVarArgs;
00356 private:
00357 using VarImpVar<Int::IntVarImp>::x;
00364 void _init(Space& home, int min, int max);
00371 void _init(Space& home, const IntSet& d);
00372 public:
00374
00375
00376 IntVar(void);
00378 IntVar(const IntVar& y);
00380 IntVar(const Int::IntView& y);
00392 GECODE_INT_EXPORT IntVar(Space& home, int min, int max);
00404 GECODE_INT_EXPORT IntVar(Space& home, const IntSet& d);
00406
00408
00409
00410 int min(void) const;
00412 int max(void) const;
00414 int med(void) const;
00422 int val(void) const;
00423
00425 unsigned int size(void) const;
00427 unsigned int width(void) const;
00429 unsigned int regret_min(void) const;
00431 unsigned int regret_max(void) const;
00433
00435
00436
00437 bool range(void) const;
00439 bool in(int n) const;
00441 };
00442
00447 template<class Char, class Traits>
00448 std::basic_ostream<Char,Traits>&
00449 operator <<(std::basic_ostream<Char,Traits>& os, const IntVar& x);
00450
00455 class IntVarRanges : public Int::IntVarImpFwd {
00456 public:
00458
00459
00460 IntVarRanges(void);
00462 IntVarRanges(const IntVar& x);
00464 void init(const IntVar& x);
00466 };
00467
00472 class IntVarValues : public Iter::Ranges::ToValues<IntVarRanges> {
00473 public:
00475
00476
00477 IntVarValues(void);
00479 IntVarValues(const IntVar& x);
00481 void init(const IntVar& x);
00483 };
00484
00485 namespace Int {
00486 class BoolView;
00487 }
00488
00494 class BoolVar : public VarImpVar<Int::BoolVarImp> {
00495 friend class BoolVarArray;
00496 friend class BoolVarArgs;
00497 private:
00498 using VarImpVar<Int::BoolVarImp>::x;
00505 void _init(Space& home, int min, int max);
00506 public:
00508
00509
00510 BoolVar(void);
00512 BoolVar(const BoolVar& y);
00514 BoolVar(const Int::BoolView& y);
00526 GECODE_INT_EXPORT BoolVar(Space& home, int min, int max);
00528
00530
00531
00532 int min(void) const;
00534 int max(void) const;
00536 int med(void) const;
00544 int val(void) const;
00545
00547 unsigned int size(void) const;
00549 unsigned int width(void) const;
00551 unsigned int regret_min(void) const;
00553 unsigned int regret_max(void) const;
00555
00557
00558
00559 bool range(void) const;
00561 bool in(int n) const;
00563
00565
00566
00567 bool zero(void) const;
00569 bool one(void) const;
00571 bool none(void) const;
00573 };
00574
00579 template<class Char, class Traits>
00580 std::basic_ostream<Char,Traits>&
00581 operator <<(std::basic_ostream<Char,Traits>& os, const BoolVar& x);
00582
00583 }
00584
00585
00586 #include <gecode/int/view.hpp>
00587 #include <gecode/int/propagator.hpp>
00588
00589 namespace Gecode {
00590
00600
00601 typedef ArgArray<IntSet> IntSetArgs;
00602
00603 }
00604
00605 #include <gecode/int/array-traits.hpp>
00606
00607 namespace Gecode {
00608
00610 class IntArgs : public PrimArgArray<int> {
00611 public:
00613
00614
00615 IntArgs(void);
00617 explicit IntArgs(int n);
00619 IntArgs(const SharedArray<int>& x);
00621 IntArgs(const std::vector<int>& x);
00623 template<class InputIterator>
00624 IntArgs(InputIterator first, InputIterator last);
00626 GECODE_INT_EXPORT
00627 IntArgs(int n, int e0, ...);
00629 IntArgs(int n, const int* e);
00631 IntArgs(const PrimArgArray<int>& a);
00632
00634 static IntArgs create(int n, int start, int inc=1);
00636 };
00637
00639 class IntVarArgs : public VarArgArray<IntVar> {
00640 public:
00642
00643
00644 IntVarArgs(void) {}
00646 explicit IntVarArgs(int n) : VarArgArray<IntVar>(n) {}
00648 IntVarArgs(const IntVarArgs& a) : VarArgArray<IntVar>(a) {}
00650 IntVarArgs(const VarArray<IntVar>& a) : VarArgArray<IntVar>(a) {}
00652 IntVarArgs(const std::vector<IntVar>& a) : VarArgArray<IntVar>(a) {}
00654 template<class InputIterator>
00655 IntVarArgs(InputIterator first, InputIterator last)
00656 : VarArgArray<IntVar>(first,last) {}
00668 GECODE_INT_EXPORT
00669 IntVarArgs(Space& home, int n, int min, int max);
00681 GECODE_INT_EXPORT
00682 IntVarArgs(Space& home, int n, const IntSet& s);
00684 };
00693 class BoolVarArgs : public VarArgArray<BoolVar> {
00694 public:
00696
00697
00698 BoolVarArgs(void) {}
00700 explicit BoolVarArgs(int n) : VarArgArray<BoolVar>(n) {}
00702 BoolVarArgs(const BoolVarArgs& a) : VarArgArray<BoolVar>(a) {}
00704 BoolVarArgs(const VarArray<BoolVar>& a)
00705 : VarArgArray<BoolVar>(a) {}
00707 BoolVarArgs(const std::vector<BoolVar>& a) : VarArgArray<BoolVar>(a) {}
00709 template<class InputIterator>
00710 BoolVarArgs(InputIterator first, InputIterator last)
00711 : VarArgArray<BoolVar>(first,last) {}
00723 GECODE_INT_EXPORT
00724 BoolVarArgs(Space& home, int n, int min, int max);
00726 };
00728
00744 class IntVarArray : public VarArray<IntVar> {
00745 public:
00747
00748
00749 IntVarArray(void);
00751 IntVarArray(Space& home, int n);
00753 IntVarArray(const IntVarArray& a);
00755 IntVarArray(Space& home, const IntVarArgs& a);
00767 GECODE_INT_EXPORT
00768 IntVarArray(Space& home, int n, int min, int max);
00780 GECODE_INT_EXPORT
00781 IntVarArray(Space& home, int n, const IntSet& s);
00783 };
00784
00789 class BoolVarArray : public VarArray<BoolVar> {
00790 public:
00792
00793
00794 BoolVarArray(void);
00796 BoolVarArray(Space& home, int n);
00798 BoolVarArray(const BoolVarArray& a);
00800 BoolVarArray(Space& home, const BoolVarArgs& a);
00812 GECODE_INT_EXPORT
00813 BoolVarArray(Space& home, int n, int min, int max);
00815 };
00816
00817 }
00818
00819 #include <gecode/int/int-set-2.hpp>
00820
00821 #include <gecode/int/array.hpp>
00822
00823 namespace Gecode {
00824
00829 enum ReifyMode {
00836 RM_EQV,
00843 RM_IMP,
00850 RM_PMI
00851 };
00852
00857 class Reify {
00858 protected:
00860 BoolVar x;
00862 ReifyMode rm;
00863 public:
00865 Reify(void);
00867 Reify(BoolVar x, ReifyMode rm=RM_EQV);
00869 BoolVar var(void) const;
00871 ReifyMode mode(void) const;
00873 void var(BoolVar x);
00875 void mode(ReifyMode rm);
00876 };
00877
00882 Reify eqv(BoolVar x);
00883
00888 Reify imp(BoolVar x);
00889
00894 Reify pmi(BoolVar x);
00895
00896 }
00897
00898 #include <gecode/int/reify.hpp>
00899
00900 namespace Gecode {
00901
00906 enum IntRelType {
00907 IRT_EQ,
00908 IRT_NQ,
00909 IRT_LQ,
00910 IRT_LE,
00911 IRT_GQ,
00912 IRT_GR
00913 };
00914
00916 IntRelType swap(IntRelType irt);
00917
00919 IntRelType neg(IntRelType irt);
00920
00921 }
00922
00923 #include <gecode/int/irt.hpp>
00924
00925 namespace Gecode {
00926
00931 enum BoolOpType {
00932 BOT_AND,
00933 BOT_OR,
00934 BOT_IMP,
00935 BOT_EQV,
00936 BOT_XOR
00937 };
00938
00955 enum IntPropLevel {
00957 IPL_DEF = 0,
00958 IPL_VAL = 1,
00959 IPL_BND = 2,
00960 IPL_DOM = 3,
00961
00962 IPL_SPEED = 4,
00963 IPL_MEMORY = 8,
00964
00965 IPL_BASIC = 16,
00966 IPL_ADVANCED = 32,
00967 IPL_BASIC_ADVANCED = IPL_BASIC | IPL_ADVANCED
00968 };
00969
00971 IntPropLevel vbd(IntPropLevel ipl);
00972
00974 IntPropLevel sm(IntPropLevel ipl);
00975
00977 IntPropLevel ba(IntPropLevel ipl);
00978
00979 }
00980
00981 #include <gecode/int/ipl.hpp>
00982
00983 namespace Gecode {
00984
00990 enum TaskType {
00991 TT_FIXP,
00992 TT_FIXS,
00993 TT_FIXE
00994 };
00995
01001 typedef PrimArgArray<TaskType> TaskTypeArgs;
01002
01004 template<>
01005 class ArrayTraits<PrimArgArray<TaskType> > {
01006 public:
01007 typedef TaskTypeArgs StorageType;
01008 typedef TaskType ValueType;
01009 typedef TaskTypeArgs ArgsType;
01010 };
01011
01012
01020
01021 GECODE_INT_EXPORT void
01022 dom(Home home, IntVar x, int n,
01023 IntPropLevel ipl=IPL_DEF);
01025 GECODE_INT_EXPORT void
01026 dom(Home home, const IntVarArgs& x, int n,
01027 IntPropLevel ipl=IPL_DEF);
01028
01030 GECODE_INT_EXPORT void
01031 dom(Home home, IntVar x, int l, int m,
01032 IntPropLevel ipl=IPL_DEF);
01034 GECODE_INT_EXPORT void
01035 dom(Home home, const IntVarArgs& x, int l, int m,
01036 IntPropLevel ipl=IPL_DEF);
01037
01039 GECODE_INT_EXPORT void
01040 dom(Home home, IntVar x, const IntSet& s,
01041 IntPropLevel ipl=IPL_DEF);
01043 GECODE_INT_EXPORT void
01044 dom(Home home, const IntVarArgs& x, const IntSet& s,
01045 IntPropLevel ipl=IPL_DEF);
01046
01048 GECODE_INT_EXPORT void
01049 dom(Home home, IntVar x, int n, Reify r,
01050 IntPropLevel ipl=IPL_DEF);
01052 GECODE_INT_EXPORT void
01053 dom(Home home, IntVar x, int l, int m, Reify r,
01054 IntPropLevel ipl=IPL_DEF);
01056 GECODE_INT_EXPORT void
01057 dom(Home home, IntVar x, const IntSet& s, Reify r,
01058 IntPropLevel ipl=IPL_DEF);
01059
01061 GECODE_INT_EXPORT void
01062 dom(Home home, IntVar x, IntVar d,
01063 IntPropLevel ipl=IPL_DEF);
01065 GECODE_INT_EXPORT void
01066 dom(Home home, BoolVar x, BoolVar d,
01067 IntPropLevel ipl=IPL_DEF);
01069 GECODE_INT_EXPORT void
01070 dom(Home home, const IntVarArgs& x, const IntVarArgs& d,
01071 IntPropLevel ipl=IPL_DEF);
01073 GECODE_INT_EXPORT void
01074 dom(Home home, const BoolVarArgs& x, const BoolVarArgs& d,
01075 IntPropLevel ipl=IPL_DEF);
01077
01078
01089 GECODE_INT_EXPORT void
01090 rel(Home home, IntVar x0, IntRelType irt, IntVar x1,
01091 IntPropLevel ipl=IPL_DEF);
01098 GECODE_INT_EXPORT void
01099 rel(Home home, const IntVarArgs& x, IntRelType irt, IntVar y,
01100 IntPropLevel ipl=IPL_DEF);
01104 GECODE_INT_EXPORT void
01105 rel(Home home, IntVar x, IntRelType irt, int c,
01106 IntPropLevel ipl=IPL_DEF);
01110 GECODE_INT_EXPORT void
01111 rel(Home home, const IntVarArgs& x, IntRelType irt, int c,
01112 IntPropLevel ipl=IPL_DEF);
01119 GECODE_INT_EXPORT void
01120 rel(Home home, IntVar x0, IntRelType irt, IntVar x1, Reify r,
01121 IntPropLevel ipl=IPL_DEF);
01128 GECODE_INT_EXPORT void
01129 rel(Home home, IntVar x, IntRelType irt, int c, Reify r,
01130 IntPropLevel ipl=IPL_DEF);
01145 GECODE_INT_EXPORT void
01146 rel(Home home, const IntVarArgs& x, IntRelType irt,
01147 IntPropLevel ipl=IPL_DEF);
01162 GECODE_INT_EXPORT void
01163 rel(Home home, const IntVarArgs& x, IntRelType irt, const IntVarArgs& y,
01164 IntPropLevel ipl=IPL_DEF);
01178 GECODE_INT_EXPORT void
01179 rel(Home home, const IntVarArgs& x, IntRelType irt, const IntArgs& y,
01180 IntPropLevel ipl=IPL_DEF);
01194 GECODE_INT_EXPORT void
01195 rel(Home home, const IntArgs& x, IntRelType irt, const IntVarArgs& y,
01196 IntPropLevel ipl=IPL_DEF);
01197
01205 GECODE_INT_EXPORT void
01206 rel(Home home, BoolVar x0, IntRelType irt, BoolVar x1,
01207 IntPropLevel ipl=IPL_DEF);
01211 GECODE_INT_EXPORT void
01212 rel(Home home, BoolVar x0, IntRelType irt, BoolVar x1, Reify r,
01213 IntPropLevel ipl=IPL_DEF);
01217 GECODE_INT_EXPORT void
01218 rel(Home home, const BoolVarArgs& x, IntRelType irt, BoolVar y,
01219 IntPropLevel ipl=IPL_DEF);
01227 GECODE_INT_EXPORT void
01228 rel(Home home, BoolVar x, IntRelType irt, int n,
01229 IntPropLevel ipl=IPL_DEF);
01237 GECODE_INT_EXPORT void
01238 rel(Home home, BoolVar x, IntRelType irt, int n, Reify r,
01239 IntPropLevel ipl=IPL_DEF);
01247 GECODE_INT_EXPORT void
01248 rel(Home home, const BoolVarArgs& x, IntRelType irt, int n,
01249 IntPropLevel ipl=IPL_DEF);
01262 GECODE_INT_EXPORT void
01263 rel(Home home, const BoolVarArgs& x, IntRelType irt, const BoolVarArgs& y,
01264 IntPropLevel ipl=IPL_DEF);
01277 GECODE_INT_EXPORT void
01278 rel(Home home, const BoolVarArgs& x, IntRelType irt, const IntArgs& y,
01279 IntPropLevel ipl=IPL_DEF);
01292 GECODE_INT_EXPORT void
01293 rel(Home home, const IntArgs& x, IntRelType irt, const BoolVarArgs& y,
01294 IntPropLevel ipl=IPL_DEF);
01305 GECODE_INT_EXPORT void
01306 rel(Home home, const BoolVarArgs& x, IntRelType irt,
01307 IntPropLevel ipl=IPL_DEF);
01313 GECODE_INT_EXPORT void
01314 rel(Home home, BoolVar x0, BoolOpType o, BoolVar x1, BoolVar x2,
01315 IntPropLevel ipl=IPL_DEF);
01324 GECODE_INT_EXPORT void
01325 rel(Home home, BoolVar x0, BoolOpType o, BoolVar x1, int n,
01326 IntPropLevel ipl=IPL_DEF);
01336 GECODE_INT_EXPORT void
01337 rel(Home home, BoolOpType o, const BoolVarArgs& x, BoolVar y,
01338 IntPropLevel ipl=IPL_DEF);
01351 GECODE_INT_EXPORT void
01352 rel(Home home, BoolOpType o, const BoolVarArgs& x, int n,
01353 IntPropLevel ipl=IPL_DEF);
01364 GECODE_INT_EXPORT void
01365 clause(Home home, BoolOpType o, const BoolVarArgs& x, const BoolVarArgs& y,
01366 BoolVar z, IntPropLevel ipl=IPL_DEF);
01380 GECODE_INT_EXPORT void
01381 clause(Home home, BoolOpType o, const BoolVarArgs& x, const BoolVarArgs& y,
01382 int n, IntPropLevel ipl=IPL_DEF);
01392 GECODE_INT_EXPORT void
01393 ite(Home home, BoolVar b, IntVar x, IntVar y, IntVar z,
01394 IntPropLevel ipl=IPL_DEF);
01401 GECODE_INT_EXPORT void
01402 ite(Home home, BoolVar b, BoolVar x, BoolVar y, BoolVar z,
01403 IntPropLevel ipl=IPL_DEF);
01404
01405
01417 GECODE_INT_EXPORT void
01418 precede(Home home, const IntVarArgs& x, int s, int t,
01419 IntPropLevel=IPL_DEF);
01427 GECODE_INT_EXPORT void
01428 precede(Home home, const IntVarArgs& x, const IntArgs& c,
01429 IntPropLevel=IPL_DEF);
01430
01431
01437
01438 GECODE_INT_EXPORT void
01439 member(Home home, const IntVarArgs& x, IntVar y,
01440 IntPropLevel ipl=IPL_DEF);
01442 GECODE_INT_EXPORT void
01443 member(Home home, const BoolVarArgs& x, BoolVar y,
01444 IntPropLevel ipl=IPL_DEF);
01446 GECODE_INT_EXPORT void
01447 member(Home home, const IntVarArgs& x, IntVar y, Reify r,
01448 IntPropLevel ipl=IPL_DEF);
01450 GECODE_INT_EXPORT void
01451 member(Home home, const BoolVarArgs& x, BoolVar y, Reify r,
01452 IntPropLevel ipl=IPL_DEF);
01454
01455
01462
01463 typedef SharedArray<int> IntSharedArray;
01469 GECODE_INT_EXPORT void
01470 element(Home home, IntSharedArray n, IntVar x0, IntVar x1,
01471 IntPropLevel ipl=IPL_DEF);
01477 GECODE_INT_EXPORT void
01478 element(Home home, IntSharedArray n, IntVar x0, BoolVar x1,
01479 IntPropLevel ipl=IPL_DEF);
01485 GECODE_INT_EXPORT void
01486 element(Home home, IntSharedArray n, IntVar x0, int x1,
01487 IntPropLevel ipl=IPL_DEF);
01493 GECODE_INT_EXPORT void
01494 element(Home home, const IntVarArgs& x, IntVar y0, IntVar y1,
01495 IntPropLevel ipl=IPL_DEF);
01501 GECODE_INT_EXPORT void
01502 element(Home home, const IntVarArgs& x, IntVar y0, int y1,
01503 IntPropLevel ipl=IPL_DEF);
01505 GECODE_INT_EXPORT void
01506 element(Home home, const BoolVarArgs& x, IntVar y0, BoolVar y1,
01507 IntPropLevel ipl=IPL_DEF);
01509 GECODE_INT_EXPORT void
01510 element(Home home, const BoolVarArgs& x, IntVar y0, int y1,
01511 IntPropLevel ipl=IPL_DEF);
01512
01525 GECODE_INT_EXPORT void
01526 element(Home home, IntSharedArray a,
01527 IntVar x, int w, IntVar y, int h, IntVar z,
01528 IntPropLevel ipl=IPL_DEF);
01541 GECODE_INT_EXPORT void
01542 element(Home home, IntSharedArray a,
01543 IntVar x, int w, IntVar y, int h, BoolVar z,
01544 IntPropLevel ipl=IPL_DEF);
01560 GECODE_INT_EXPORT void
01561 element(Home home, const IntVarArgs& a,
01562 IntVar x, int w, IntVar y, int h, IntVar z,
01563 IntPropLevel ipl=IPL_DEF);
01576 GECODE_INT_EXPORT void
01577 element(Home home, const BoolVarArgs& a,
01578 IntVar x, int w, IntVar y, int h, BoolVar z,
01579 IntPropLevel ipl=IPL_DEF);
01581
01582
01597 GECODE_INT_EXPORT void
01598 distinct(Home home, const IntVarArgs& x,
01599 IntPropLevel ipl=IPL_DEF);
01612 GECODE_INT_EXPORT void
01613 distinct(Home home, const IntArgs& n, const IntVarArgs& x,
01614 IntPropLevel ipl=IPL_DEF);
01629 GECODE_INT_EXPORT void
01630 distinct(Home home, const BoolVarArgs& b, const IntVarArgs& x,
01631 IntPropLevel ipl=IPL_DEF);
01644 GECODE_INT_EXPORT void
01645 distinct(Home home, const IntVarArgs& x, int c,
01646 IntPropLevel ipl=IPL_DEF);
01648
01649
01667 GECODE_INT_EXPORT void
01668 channel(Home home, const IntVarArgs& x, const IntVarArgs& y,
01669 IntPropLevel ipl=IPL_DEF);
01670
01684 GECODE_INT_EXPORT void
01685 channel(Home home, const IntVarArgs& x, int xoff,
01686 const IntVarArgs& y, int yoff,
01687 IntPropLevel ipl=IPL_DEF);
01688
01690 GECODE_INT_EXPORT void
01691 channel(Home home, BoolVar x0, IntVar x1,
01692 IntPropLevel ipl=IPL_DEF);
01694 void
01695 channel(Home home, IntVar x0, BoolVar x1,
01696 IntPropLevel ipl=IPL_DEF);
01702 GECODE_INT_EXPORT void
01703 channel(Home home, const BoolVarArgs& x, IntVar y, int o=0,
01704 IntPropLevel ipl=IPL_DEF);
01706
01707 }
01708
01709 #include <gecode/int/channel.hpp>
01710
01711 namespace Gecode {
01712
01729 GECODE_INT_EXPORT void
01730 sorted(Home home, const IntVarArgs& x, const IntVarArgs& y,
01731 IntPropLevel ipl=IPL_DEF);
01732
01744 GECODE_INT_EXPORT void
01745 sorted(Home home, const IntVarArgs& x, const IntVarArgs& y,
01746 const IntVarArgs& z,
01747 IntPropLevel ipl=IPL_DEF);
01749
01750
01769 GECODE_INT_EXPORT void
01770 count(Home home, const IntVarArgs& x, int n, IntRelType irt, int m,
01771 IntPropLevel ipl=IPL_DEF);
01776 GECODE_INT_EXPORT void
01777 count(Home home, const IntVarArgs& x, const IntSet& y, IntRelType irt, int m,
01778 IntPropLevel ipl=IPL_DEF);
01786 GECODE_INT_EXPORT void
01787 count(Home home, const IntVarArgs& x, IntVar y, IntRelType irt, int m,
01788 IntPropLevel ipl=IPL_DEF);
01796 GECODE_INT_EXPORT void
01797 count(Home home, const IntVarArgs& x, const IntArgs& y, IntRelType irt, int m,
01798 IntPropLevel ipl=IPL_DEF);
01803 GECODE_INT_EXPORT void
01804 count(Home home, const IntVarArgs& x, int n, IntRelType irt, IntVar z,
01805 IntPropLevel ipl=IPL_DEF);
01810 GECODE_INT_EXPORT void
01811 count(Home home, const IntVarArgs& x, const IntSet& y, IntRelType irt, IntVar z,
01812 IntPropLevel ipl=IPL_DEF);
01820 GECODE_INT_EXPORT void
01821 count(Home home, const IntVarArgs& x, IntVar y, IntRelType irt, IntVar z,
01822 IntPropLevel ipl=IPL_DEF);
01830 GECODE_INT_EXPORT void
01831 count(Home home, const IntVarArgs& x, const IntArgs& y, IntRelType irt, IntVar z,
01832 IntPropLevel ipl=IPL_DEF);
01833
01847 GECODE_INT_EXPORT void
01848 count(Home home, const IntVarArgs& x, const IntVarArgs& c,
01849 IntPropLevel ipl=IPL_DEF);
01850
01864 GECODE_INT_EXPORT void
01865 count(Home home, const IntVarArgs& x, const IntSetArgs& c,
01866 IntPropLevel ipl=IPL_DEF);
01867
01884 GECODE_INT_EXPORT void
01885 count(Home home, const IntVarArgs& x,
01886 const IntVarArgs& c, const IntArgs& v,
01887 IntPropLevel ipl=IPL_DEF);
01888
01905 GECODE_INT_EXPORT void
01906 count(Home home, const IntVarArgs& x,
01907 const IntSetArgs& c, const IntArgs& v,
01908 IntPropLevel ipl=IPL_DEF);
01909
01926 GECODE_INT_EXPORT void
01927 count(Home home, const IntVarArgs& x,
01928 const IntSet& c, const IntArgs& v,
01929 IntPropLevel ipl=IPL_DEF);
01930
01932
01947 GECODE_INT_EXPORT void
01948 nvalues(Home home, const IntVarArgs& x, IntRelType irt, int y,
01949 IntPropLevel ipl=IPL_DEF);
01953 GECODE_INT_EXPORT void
01954 nvalues(Home home, const IntVarArgs& x, IntRelType irt, IntVar y,
01955 IntPropLevel ipl=IPL_DEF);
01959 GECODE_INT_EXPORT void
01960 nvalues(Home home, const BoolVarArgs& x, IntRelType irt, int y,
01961 IntPropLevel ipl=IPL_DEF);
01965 GECODE_INT_EXPORT void
01966 nvalues(Home home, const BoolVarArgs& x, IntRelType irt, IntVar y,
01967 IntPropLevel ipl=IPL_DEF);
01969
01990 GECODE_INT_EXPORT void
01991 sequence(Home home, const IntVarArgs& x, const IntSet& s,
01992 int q, int l, int u, IntPropLevel ipl=IPL_DEF);
01993
02008 GECODE_INT_EXPORT void
02009 sequence(Home home, const BoolVarArgs& x, const IntSet& s,
02010 int q, int l, int u, IntPropLevel ipl=IPL_DEF);
02011
02013
02026
02034 class DFA : public SharedHandle {
02035 private:
02037 class DFAI;
02038 public:
02040 class Transition {
02041 public:
02042 int i_state;
02043 int symbol;
02044 int o_state;
02045
02046 Transition();
02048 Transition(int i_state0, int symbol0, int o_state0);
02049 };
02051 class Transitions {
02052 private:
02054 const Transition* c_trans;
02056 const Transition* e_trans;
02057 public:
02059 Transitions(const DFA& d);
02061 Transitions(const DFA& d, int n);
02063 bool operator ()(void) const;
02065 void operator ++(void);
02067 int i_state(void) const;
02069 int symbol(void) const;
02071 int o_state(void) const;
02072 };
02074 class Symbols {
02075 private:
02077 const Transition* c_trans;
02079 const Transition* e_trans;
02080 public:
02082 Symbols(const DFA& d);
02084 bool operator ()(void) const;
02086 void operator ++(void);
02088 int val(void) const;
02089 };
02090 public:
02091 friend class Transitions;
02093 DFA(void);
02105 GECODE_INT_EXPORT
02106 DFA(int s, Transition t[], int f[], bool minimize=true);
02108 DFA(const DFA& d);
02110 int n_states(void) const;
02112 int n_transitions(void) const;
02114 unsigned int n_symbols(void) const;
02116 unsigned int max_degree(void) const;
02118 int final_fst(void) const;
02120 int final_lst(void) const;
02122 int symbol_min(void) const;
02124 int symbol_max(void) const;
02125 };
02126
02137 GECODE_INT_EXPORT void
02138 extensional(Home home, const IntVarArgs& x, DFA d,
02139 IntPropLevel ipl=IPL_DEF);
02140
02151 GECODE_INT_EXPORT void
02152 extensional(Home home, const BoolVarArgs& x, DFA d,
02153 IntPropLevel ipl=IPL_DEF);
02154
02161 class TupleSet : public SharedHandle {
02162 public:
02167 typedef int* Tuple;
02168
02173 class GECODE_VTABLE_EXPORT TupleSetI
02174 : public SharedHandle::Object {
02175 public:
02177 int arity;
02179 int size;
02181 Tuple** tuples;
02183 Tuple* tuple_data;
02185 int* data;
02187 int excess;
02189 int min, max;
02191 unsigned int domsize;
02193 Tuple** last;
02195 Tuple* nullpointer;
02196
02198 template<class T>
02199 void add(T t);
02201 GECODE_INT_EXPORT void finalize(void);
02203 GECODE_INT_EXPORT void resize(void);
02205 bool finalized(void) const;
02207 TupleSetI(void);
02209 GECODE_INT_EXPORT virtual ~TupleSetI(void);
02211 GECODE_INT_EXPORT virtual SharedHandle::Object* copy(void) const;
02212 };
02213
02215 TupleSetI* implementation(void);
02216
02218 TupleSet(void);
02220 TupleSet(const TupleSet& d);
02221
02223 void add(const IntArgs& tuple);
02225 void finalize(void);
02227 bool finalized(void) const;
02229 int arity(void) const;
02231 int tuples(void) const;
02233 Tuple operator [](int i) const;
02235 int min(void) const;
02237 int max(void) const;
02238 };
02239
02260 GECODE_INT_EXPORT void
02261 extensional(Home home, const IntVarArgs& x, const TupleSet& t,
02262 IntPropLevel ipl=IPL_DEF);
02263
02276 GECODE_INT_EXPORT void
02277 extensional(Home home, const BoolVarArgs& x, const TupleSet& t,
02278 IntPropLevel ipl=IPL_DEF);
02280
02281 }
02282
02283 #include <gecode/int/extensional/dfa.hpp>
02284 #include <gecode/int/extensional/tuple-set.hpp>
02285
02286 namespace Gecode {
02287
02299 GECODE_INT_EXPORT void
02300 min(Home home, IntVar x0, IntVar x1, IntVar x2,
02301 IntPropLevel ipl=IPL_DEF);
02309 GECODE_INT_EXPORT void
02310 min(Home home, const IntVarArgs& x, IntVar y,
02311 IntPropLevel ipl=IPL_DEF);
02317 GECODE_INT_EXPORT void
02318 max(Home home, IntVar x0, IntVar x1, IntVar x2,
02319 IntPropLevel ipl=IPL_DEF);
02327 GECODE_INT_EXPORT void
02328 max(Home home, const IntVarArgs& x, IntVar y,
02329 IntPropLevel ipl=IPL_DEF);
02330
02340 GECODE_INT_EXPORT void
02341 argmin(Home home, const IntVarArgs& x, IntVar y, bool tiebreak=true,
02342 IntPropLevel ipl=IPL_DEF);
02352 GECODE_INT_EXPORT void
02353 argmin(Home home, const IntVarArgs& x, int o, IntVar y, bool tiebreak=true,
02354 IntPropLevel ipl=IPL_DEF);
02364 GECODE_INT_EXPORT void
02365 argmax(Home home, const IntVarArgs& x, IntVar y, bool tiebreak=true,
02366 IntPropLevel ipl=IPL_DEF);
02376 GECODE_INT_EXPORT void
02377 argmax(Home home, const IntVarArgs& x, int o, IntVar y, bool tiebreak=true,
02378 IntPropLevel ipl=IPL_DEF);
02379
02385 GECODE_INT_EXPORT void
02386 abs(Home home, IntVar x0, IntVar x1,
02387 IntPropLevel ipl=IPL_DEF);
02388
02394 GECODE_INT_EXPORT void
02395 mult(Home home, IntVar x0, IntVar x1, IntVar x2,
02396 IntPropLevel ipl=IPL_DEF);
02397
02402 GECODE_INT_EXPORT void
02403 divmod(Home home, IntVar x0, IntVar x1, IntVar x2, IntVar x3,
02404 IntPropLevel ipl=IPL_DEF);
02405
02410 GECODE_INT_EXPORT void
02411 div(Home home, IntVar x0, IntVar x1, IntVar x2,
02412 IntPropLevel ipl=IPL_DEF);
02413
02418 GECODE_INT_EXPORT void
02419 mod(Home home, IntVar x0, IntVar x1, IntVar x2,
02420 IntPropLevel ipl=IPL_DEF);
02421
02427 GECODE_INT_EXPORT void
02428 sqr(Home home, IntVar x0, IntVar x1,
02429 IntPropLevel ipl=IPL_DEF);
02430
02436 GECODE_INT_EXPORT void
02437 sqrt(Home home, IntVar x0, IntVar x1,
02438 IntPropLevel ipl=IPL_DEF);
02439
02448 GECODE_INT_EXPORT void
02449 pow(Home home, IntVar x0, int n, IntVar x1,
02450 IntPropLevel ipl=IPL_DEF);
02451
02460 GECODE_INT_EXPORT void
02461 nroot(Home home, IntVar x0, int n, IntVar x1,
02462 IntPropLevel ipl=IPL_DEF);
02463
02465
02501 GECODE_INT_EXPORT void
02502 linear(Home home, const IntVarArgs& x,
02503 IntRelType irt, int c,
02504 IntPropLevel ipl=IPL_DEF);
02508 GECODE_INT_EXPORT void
02509 linear(Home home, const IntVarArgs& x,
02510 IntRelType irt, IntVar y,
02511 IntPropLevel ipl=IPL_DEF);
02515 GECODE_INT_EXPORT void
02516 linear(Home home, const IntVarArgs& x,
02517 IntRelType irt, int c, Reify r,
02518 IntPropLevel ipl=IPL_DEF);
02522 GECODE_INT_EXPORT void
02523 linear(Home home, const IntVarArgs& x,
02524 IntRelType irt, IntVar y, Reify r,
02525 IntPropLevel ipl=IPL_DEF);
02532 GECODE_INT_EXPORT void
02533 linear(Home home, const IntArgs& a, const IntVarArgs& x,
02534 IntRelType irt, int c,
02535 IntPropLevel ipl=IPL_DEF);
02542 GECODE_INT_EXPORT void
02543 linear(Home home, const IntArgs& a, const IntVarArgs& x,
02544 IntRelType irt, IntVar y,
02545 IntPropLevel ipl=IPL_DEF);
02552 GECODE_INT_EXPORT void
02553 linear(Home home, const IntArgs& a, const IntVarArgs& x,
02554 IntRelType irt, int c, Reify r,
02555 IntPropLevel ipl=IPL_DEF);
02562 GECODE_INT_EXPORT void
02563 linear(Home home, const IntArgs& a, const IntVarArgs& x,
02564 IntRelType irt, IntVar y, Reify r,
02565 IntPropLevel ipl=IPL_DEF);
02566
02567
02595 GECODE_INT_EXPORT void
02596 linear(Home home, const BoolVarArgs& x,
02597 IntRelType irt, int c,
02598 IntPropLevel ipl=IPL_DEF);
02602 GECODE_INT_EXPORT void
02603 linear(Home home, const BoolVarArgs& x,
02604 IntRelType irt, int c, Reify r,
02605 IntPropLevel ipl=IPL_DEF);
02609 GECODE_INT_EXPORT void
02610 linear(Home home, const BoolVarArgs& x,
02611 IntRelType irt, IntVar y,
02612 IntPropLevel ipl=IPL_DEF);
02616 GECODE_INT_EXPORT void
02617 linear(Home home, const BoolVarArgs& x,
02618 IntRelType irt, IntVar y, Reify r,
02619 IntPropLevel ipl=IPL_DEF);
02626 GECODE_INT_EXPORT void
02627 linear(Home home, const IntArgs& a, const BoolVarArgs& x,
02628 IntRelType irt, int c,
02629 IntPropLevel ipl=IPL_DEF);
02636 GECODE_INT_EXPORT void
02637 linear(Home home, const IntArgs& a, const BoolVarArgs& x,
02638 IntRelType irt, int c, Reify r,
02639 IntPropLevel ipl=IPL_DEF);
02646 GECODE_INT_EXPORT void
02647 linear(Home home, const IntArgs& a, const BoolVarArgs& x,
02648 IntRelType irt, IntVar y,
02649 IntPropLevel ipl=IPL_DEF);
02656 GECODE_INT_EXPORT void
02657 linear(Home home, const IntArgs& a, const BoolVarArgs& x,
02658 IntRelType irt, IntVar y, Reify r,
02659 IntPropLevel ipl=IPL_DEF);
02660
02661
02688 GECODE_INT_EXPORT void
02689 binpacking(Home home,
02690 const IntVarArgs& l,
02691 const IntVarArgs& b, const IntArgs& s,
02692 IntPropLevel ipl=IPL_DEF);
02693
02694
02695
02696
02697
02698
02699
02700
02701
02702
02703
02704
02705
02706
02707
02708
02709
02710
02711
02712
02713
02714
02715
02716
02717
02718
02719
02720
02721
02722
02723
02724
02725
02726
02727
02728
02729
02730
02731 GECODE_INT_EXPORT IntSet
02732 binpacking(Home home, int d,
02733 const IntVarArgs& l, const IntVarArgs& b,
02734 const IntArgs& s, const IntArgs& c,
02735 IntPropLevel ipl=IPL_DEF);
02736
02737
02756 GECODE_INT_EXPORT void
02757 nooverlap(Home home,
02758 const IntVarArgs& x, const IntArgs& w,
02759 const IntVarArgs& y, const IntArgs& h,
02760 IntPropLevel ipl=IPL_DEF);
02774 GECODE_INT_EXPORT void
02775 nooverlap(Home home,
02776 const IntVarArgs& x, const IntArgs& w,
02777 const IntVarArgs& y, const IntArgs& h,
02778 const BoolVarArgs& o,
02779 IntPropLevel ipl=IPL_DEF);
02796 GECODE_INT_EXPORT void
02797 nooverlap(Home home,
02798 const IntVarArgs& x0, const IntVarArgs& w, const IntVarArgs& x1,
02799 const IntVarArgs& y0, const IntVarArgs& h, const IntVarArgs& y1,
02800 IntPropLevel ipl=IPL_DEF);
02818 GECODE_INT_EXPORT void
02819 nooverlap(Home home,
02820 const IntVarArgs& x0, const IntVarArgs& w, const IntVarArgs& x1,
02821 const IntVarArgs& y0, const IntVarArgs& h, const IntVarArgs& y1,
02822 const BoolVarArgs& o,
02823 IntPropLevel ipl=IPL_DEF);
02824
02825
02831
02874 GECODE_INT_EXPORT void
02875 cumulatives(Home home, const IntVarArgs& m,
02876 const IntVarArgs& s, const IntVarArgs& p,
02877 const IntVarArgs& e, const IntVarArgs& u,
02878 const IntArgs& c, bool at_most,
02879 IntPropLevel ipl=IPL_DEF);
02884 GECODE_INT_EXPORT void
02885 cumulatives(Home home, const IntArgs& m,
02886 const IntVarArgs& s, const IntVarArgs& p,
02887 const IntVarArgs& e, const IntVarArgs& u,
02888 const IntArgs& c, bool at_most,
02889 IntPropLevel ipl=IPL_DEF);
02894 GECODE_INT_EXPORT void
02895 cumulatives(Home home, const IntVarArgs& m,
02896 const IntVarArgs& s, const IntArgs& p,
02897 const IntVarArgs& e, const IntVarArgs& u,
02898 const IntArgs& c, bool at_most,
02899 IntPropLevel ipl=IPL_DEF);
02904 GECODE_INT_EXPORT void
02905 cumulatives(Home home, const IntArgs& m,
02906 const IntVarArgs& s, const IntArgs& p,
02907 const IntVarArgs& e, const IntVarArgs& u,
02908 const IntArgs& c, bool at_most,
02909 IntPropLevel ipl=IPL_DEF);
02914 GECODE_INT_EXPORT void
02915 cumulatives(Home home, const IntVarArgs& m,
02916 const IntVarArgs& s, const IntVarArgs& p,
02917 const IntVarArgs& e, const IntArgs& u,
02918 const IntArgs& c, bool at_most,
02919 IntPropLevel ipl=IPL_DEF);
02924 GECODE_INT_EXPORT void
02925 cumulatives(Home home, const IntArgs& m,
02926 const IntVarArgs& s, const IntVarArgs& p,
02927 const IntVarArgs& e, const IntArgs& u,
02928 const IntArgs& c, bool at_most,
02929 IntPropLevel ipl=IPL_DEF);
02934 GECODE_INT_EXPORT void
02935 cumulatives(Home home, const IntVarArgs& m,
02936 const IntVarArgs& s, const IntArgs& p,
02937 const IntVarArgs& e, const IntArgs& u,
02938 const IntArgs& c, bool at_most,
02939 IntPropLevel ipl=IPL_DEF);
02944 GECODE_INT_EXPORT void
02945 cumulatives(Home home, const IntArgs& m,
02946 const IntVarArgs& s, const IntArgs& p,
02947 const IntVarArgs& e, const IntArgs& u,
02948 const IntArgs& c, bool at_most,
02949 IntPropLevel ipl=IPL_DEF);
02950
02977 GECODE_INT_EXPORT void
02978 unary(Home home, const IntVarArgs& s, const IntArgs& p,
02979 IntPropLevel ipl=IPL_DEF);
02980
03009 GECODE_INT_EXPORT void
03010 unary(Home home, const IntVarArgs& s, const IntArgs& p,
03011 const BoolVarArgs& m, IntPropLevel ipl=IPL_DEF);
03012
03049 GECODE_INT_EXPORT void
03050 unary(Home home, const TaskTypeArgs& t,
03051 const IntVarArgs& flex, const IntArgs& fix, IntPropLevel ipl=IPL_DEF);
03052
03091 GECODE_INT_EXPORT void
03092 unary(Home home, const TaskTypeArgs& t,
03093 const IntVarArgs& flex, const IntArgs& fix,
03094 const BoolVarArgs& m, IntPropLevel ipl=IPL_DEF);
03095
03122 GECODE_INT_EXPORT void
03123 unary(Home home, const IntVarArgs& s, const IntVarArgs& p,
03124 const IntVarArgs& e, IntPropLevel ipl=IPL_DEF);
03125
03154 GECODE_INT_EXPORT void
03155 unary(Home home, const IntVarArgs& s, const IntVarArgs& p,
03156 const IntVarArgs& e, const BoolVarArgs& m, IntPropLevel ipl=IPL_DEF);
03157
03158
03159
03202 GECODE_INT_EXPORT void
03203 cumulative(Home home, int c, const TaskTypeArgs& t,
03204 const IntVarArgs& flex, const IntArgs& fix, const IntArgs& u,
03205 IntPropLevel ipl=IPL_DEF);
03206
03207
03212 GECODE_INT_EXPORT void
03213 cumulative(Home home, IntVar c, const TaskTypeArgs& t,
03214 const IntVarArgs& flex, const IntArgs& fix, const IntArgs& u,
03215 IntPropLevel ipl=IPL_DEF);
03216
03261 GECODE_INT_EXPORT void
03262 cumulative(Home home, int c, const TaskTypeArgs& t,
03263 const IntVarArgs& flex, const IntArgs& fix, const IntArgs& u,
03264 const BoolVarArgs& m, IntPropLevel ipl=IPL_DEF);
03265
03269 GECODE_INT_EXPORT void
03270 cumulative(Home home, IntVar c, const TaskTypeArgs& t,
03271 const IntVarArgs& flex, const IntArgs& fix, const IntArgs& u,
03272 const BoolVarArgs& m, IntPropLevel ipl=IPL_DEF);
03273
03306 GECODE_INT_EXPORT void
03307 cumulative(Home home, int c, const IntVarArgs& s, const IntArgs& p,
03308 const IntArgs& u, IntPropLevel ipl=IPL_DEF);
03309
03313 GECODE_INT_EXPORT void
03314 cumulative(Home home, IntVar c, const IntVarArgs& s, const IntArgs& p,
03315 const IntArgs& u, IntPropLevel ipl=IPL_DEF);
03316
03351 GECODE_INT_EXPORT void
03352 cumulative(Home home, int c, const IntVarArgs& s, const IntArgs& p,
03353 const IntArgs& u, const BoolVarArgs& m, IntPropLevel ipl=IPL_DEF);
03354
03358 GECODE_INT_EXPORT void
03359 cumulative(Home home, IntVar c, const IntVarArgs& s, const IntArgs& p,
03360 const IntArgs& u, const BoolVarArgs& m, IntPropLevel ipl=IPL_DEF);
03361
03398 GECODE_INT_EXPORT void
03399 cumulative(Home home, int c, const IntVarArgs& s, const IntVarArgs& p,
03400 const IntVarArgs& e, const IntArgs& u, IntPropLevel ipl=IPL_DEF);
03401
03405 GECODE_INT_EXPORT void
03406 cumulative(Home home, IntVar c, const IntVarArgs& s, const IntVarArgs& p,
03407 const IntVarArgs& e, const IntArgs& u, IntPropLevel ipl=IPL_DEF);
03408
03447 GECODE_INT_EXPORT void
03448 cumulative(Home home, int c, const IntVarArgs& s, const IntVarArgs& p,
03449 const IntVarArgs& e, const IntArgs& u, const BoolVarArgs& m,
03450 IntPropLevel ipl=IPL_DEF);
03451
03455 GECODE_INT_EXPORT void
03456 cumulative(Home home, IntVar c, const IntVarArgs& s, const IntVarArgs& p,
03457 const IntVarArgs& e, const IntArgs& u, const BoolVarArgs& m,
03458 IntPropLevel ipl=IPL_DEF);
03460
03461
03481 GECODE_INT_EXPORT void
03482 circuit(Home home, const IntVarArgs& x,
03483 IntPropLevel ipl=IPL_DEF);
03499 GECODE_INT_EXPORT void
03500 circuit(Home home, int offset, const IntVarArgs& x,
03501 IntPropLevel ipl=IPL_DEF);
03523 GECODE_INT_EXPORT void
03524 circuit(Home home,
03525 const IntArgs& c,
03526 const IntVarArgs& x, const IntVarArgs& y, IntVar z,
03527 IntPropLevel ipl=IPL_DEF);
03550 GECODE_INT_EXPORT void
03551 circuit(Home home,
03552 const IntArgs& c, int offset,
03553 const IntVarArgs& x, const IntVarArgs& y, IntVar z,
03554 IntPropLevel ipl=IPL_DEF);
03573 GECODE_INT_EXPORT void
03574 circuit(Home home,
03575 const IntArgs& c,
03576 const IntVarArgs& x, IntVar z,
03577 IntPropLevel ipl=IPL_DEF);
03598 GECODE_INT_EXPORT void
03599 circuit(Home home,
03600 const IntArgs& c, int offset,
03601 const IntVarArgs& x, IntVar z,
03602 IntPropLevel ipl=IPL_DEF);
03618 GECODE_INT_EXPORT void
03619 path(Home home, const IntVarArgs& x, IntVar s, IntVar e,
03620 IntPropLevel ipl=IPL_DEF);
03638 GECODE_INT_EXPORT void
03639 path(Home home, int offset, const IntVarArgs& x, IntVar s, IntVar e,
03640 IntPropLevel ipl=IPL_DEF);
03663 GECODE_INT_EXPORT void
03664 path(Home home,
03665 const IntArgs& c,
03666 const IntVarArgs& x, IntVar s, IntVar e, const IntVarArgs& y, IntVar z,
03667 IntPropLevel ipl=IPL_DEF);
03692 GECODE_INT_EXPORT void
03693 path(Home home,
03694 const IntArgs& c, int offset,
03695 const IntVarArgs& x, IntVar s, IntVar e, const IntVarArgs& y, IntVar z,
03696 IntPropLevel ipl=IPL_DEF);
03717 GECODE_INT_EXPORT void
03718 path(Home home,
03719 const IntArgs& c,
03720 const IntVarArgs& x, IntVar s, IntVar e, IntVar z,
03721 IntPropLevel ipl=IPL_DEF);
03744 GECODE_INT_EXPORT void
03745 path(Home home,
03746 const IntArgs& c, int offset,
03747 const IntVarArgs& x, IntVar s, IntVar e, IntVar z,
03748 IntPropLevel ipl=IPL_DEF);
03750
03751
03752
03761
03762 GECODE_INT_EXPORT void
03763 wait(Home home, IntVar x, std::function<void(Space& home)> c,
03764 IntPropLevel ipl=IPL_DEF);
03766 GECODE_INT_EXPORT void
03767 wait(Home home, BoolVar x, std::function<void(Space& home)> c,
03768 IntPropLevel ipl=IPL_DEF);
03770 GECODE_INT_EXPORT void
03771 wait(Home home, const IntVarArgs& x, std::function<void(Space& home)> c,
03772 IntPropLevel ipl=IPL_DEF);
03774 GECODE_INT_EXPORT void
03775 wait(Home home, const BoolVarArgs& x,
03776 std::function<void(Space& home)> c,
03777 IntPropLevel ipl=IPL_DEF);
03779 GECODE_INT_EXPORT void
03780 when(Home home, BoolVar x,
03781 std::function<void(Space& home)> t,
03782 std::function<void(Space& home)> e,
03783 IntPropLevel ipl=IPL_DEF);
03785 GECODE_INT_EXPORT void
03786 when(Home home, BoolVar x,
03787 std::function<void(Space& home)> t,
03788 IntPropLevel ipl=IPL_DEF);
03790
03791
03816 GECODE_INT_EXPORT void
03817 unshare(Home home, IntVarArgs& x,
03818 IntPropLevel ipl=IPL_DEF);
03820 GECODE_INT_EXPORT void
03821 unshare(Home home, BoolVarArgs& x,
03822 IntPropLevel ipl=IPL_DEF);
03824
03825 }
03826
03827 namespace Gecode {
03828
03842 typedef std::function<bool(const Space& home, IntVar x, int i)>
03843 IntBranchFilter;
03852 typedef std::function<bool(const Space& home, BoolVar x, int i)>
03853 BoolBranchFilter;
03854
03864 typedef std::function<double(const Space& home, IntVar x, int i)>
03865 IntBranchMerit;
03875 typedef std::function<double(const Space& home, BoolVar x, int i)>
03876 BoolBranchMerit;
03877
03888 typedef std::function<int(const Space& home, IntVar x, int i)>
03889 IntBranchVal;
03900 typedef std::function<int(const Space& home, BoolVar x, int i)>
03901 BoolBranchVal;
03902
03914 typedef std::function<void(Space& home, unsigned int a,
03915 IntVar x, int i, int n)>
03916 IntBranchCommit;
03928 typedef std::function<void(Space& home, unsigned int a,
03929 BoolVar x, int i, int n)>
03930 BoolBranchCommit;
03931
03932 }
03933
03934 #include <gecode/int/branch/traits.hpp>
03935
03936 namespace Gecode {
03937
03943 class IntAFC : public AFC {
03944 public:
03952 IntAFC(void);
03954 IntAFC(const IntAFC& a);
03956 IntAFC& operator =(const IntAFC& a);
03958 IntAFC(Home home, const IntVarArgs& x, double d=1.0);
03966 void init(Home home, const IntVarArgs& x, double d=1.0);
03967 };
03968
03974 class BoolAFC : public AFC {
03975 public:
03983 BoolAFC(void);
03985 BoolAFC(const BoolAFC& a);
03987 BoolAFC& operator =(const BoolAFC& a);
03989 BoolAFC(Home home, const BoolVarArgs& x, double d=1.0);
03997 void init(Home home, const BoolVarArgs& x, double d=1.0);
03998 };
03999
04000 }
04001
04002 #include <gecode/int/branch/afc.hpp>
04003
04004 namespace Gecode {
04005
04011 class IntAction : public Action {
04012 public:
04020 IntAction(void);
04022 IntAction(const IntAction& a);
04024 IntAction& operator =(const IntAction& a);
04032 GECODE_INT_EXPORT
04033 IntAction(Home home, const IntVarArgs& x, double d=1.0,
04034 IntBranchMerit bm=nullptr);
04046 GECODE_INT_EXPORT void
04047 init(Home home, const IntVarArgs& x, double d=1.0,
04048 IntBranchMerit bm=nullptr);
04049 };
04050
04056 class BoolAction : public Action {
04057 public:
04065 BoolAction(void);
04067 BoolAction(const BoolAction& a);
04069 BoolAction& operator =(const BoolAction& a);
04077 GECODE_INT_EXPORT
04078 BoolAction(Home home, const BoolVarArgs& x, double d=1.0,
04079 BoolBranchMerit bm=nullptr);
04091 GECODE_INT_EXPORT void
04092 init(Home home, const BoolVarArgs& x, double d=1.0,
04093 BoolBranchMerit bm=nullptr);
04094 };
04095
04096 }
04097
04098 #include <gecode/int/branch/action.hpp>
04099
04100 namespace Gecode {
04101
04107 class IntCHB : public CHB {
04108 public:
04116 IntCHB(void);
04118 IntCHB(const IntCHB& chb);
04120 IntCHB& operator =(const IntCHB& chb);
04129 GECODE_INT_EXPORT
04130 IntCHB(Home home, const IntVarArgs& x, IntBranchMerit bm=nullptr);
04142 GECODE_INT_EXPORT void
04143 init(Home home, const IntVarArgs& x, IntBranchMerit bm=nullptr);
04144 };
04145
04151 class BoolCHB : public CHB {
04152 public:
04160 BoolCHB(void);
04162 BoolCHB(const BoolCHB& chb);
04164 BoolCHB& operator =(const BoolCHB& chb);
04173 GECODE_INT_EXPORT
04174 BoolCHB(Home home, const BoolVarArgs& x, BoolBranchMerit bm=nullptr);
04186 GECODE_INT_EXPORT void
04187 init(Home home, const BoolVarArgs& x, BoolBranchMerit bm=nullptr);
04188 };
04189
04190 }
04191
04192 #include <gecode/int/branch/chb.hpp>
04193
04194 namespace Gecode {
04195
04197 typedef std::function<void(const Space &home, const Brancher& b,
04198 unsigned int a,
04199 IntVar x, int i, const int& n,
04200 std::ostream& o)>
04201 IntVarValPrint;
04202
04204 typedef std::function<void(const Space &home, const Brancher& b,
04205 unsigned int a,
04206 BoolVar x, int i, const int& n,
04207 std::ostream& o)>
04208 BoolVarValPrint;
04209
04210 }
04211
04212 namespace Gecode {
04213
04219 class IntVarBranch : public VarBranch<IntVar> {
04220 public:
04222 enum Select {
04223 SEL_NONE = 0,
04224 SEL_RND,
04225 SEL_MERIT_MIN,
04226 SEL_MERIT_MAX,
04227 SEL_DEGREE_MIN,
04228 SEL_DEGREE_MAX,
04229 SEL_AFC_MIN,
04230 SEL_AFC_MAX,
04231 SEL_ACTION_MIN,
04232 SEL_ACTION_MAX,
04233 SEL_CHB_MIN,
04234 SEL_CHB_MAX,
04235 SEL_MIN_MIN,
04236 SEL_MIN_MAX,
04237 SEL_MAX_MIN,
04238 SEL_MAX_MAX,
04239 SEL_SIZE_MIN,
04240 SEL_SIZE_MAX,
04241 SEL_DEGREE_SIZE_MIN,
04242 SEL_DEGREE_SIZE_MAX,
04243 SEL_AFC_SIZE_MIN,
04244 SEL_AFC_SIZE_MAX,
04245 SEL_ACTION_SIZE_MIN,
04246 SEL_ACTION_SIZE_MAX,
04247 SEL_CHB_SIZE_MIN,
04248 SEL_CHB_SIZE_MAX,
04249
04254 SEL_REGRET_MIN_MIN,
04260 SEL_REGRET_MIN_MAX,
04266 SEL_REGRET_MAX_MIN,
04272 SEL_REGRET_MAX_MAX
04273 };
04274 protected:
04276 Select s;
04277 public:
04279 IntVarBranch(void);
04281 IntVarBranch(Rnd r);
04283 IntVarBranch(Select s, BranchTbl t);
04285 IntVarBranch(Select s, double d, BranchTbl t);
04287 IntVarBranch(Select s, IntAFC a, BranchTbl t);
04289 IntVarBranch(Select s, IntAction a, BranchTbl t);
04291 IntVarBranch(Select s, IntCHB c, BranchTbl t);
04293 IntVarBranch(Select s, IntBranchMerit mf, BranchTbl t);
04295 Select select(void) const;
04297 void expand(Home home, const IntVarArgs& x);
04298 };
04299
04305 class BoolVarBranch : public VarBranch<BoolVar> {
04306 public:
04308 enum Select {
04309 SEL_NONE = 0,
04310 SEL_RND,
04311 SEL_MERIT_MIN,
04312 SEL_MERIT_MAX,
04313 SEL_DEGREE_MIN,
04314 SEL_DEGREE_MAX,
04315 SEL_AFC_MIN,
04316 SEL_AFC_MAX,
04317 SEL_ACTION_MIN,
04318 SEL_ACTION_MAX,
04319 SEL_CHB_MIN,
04320 SEL_CHB_MAX
04321 };
04322 protected:
04324 Select s;
04325 public:
04327 BoolVarBranch(void);
04329 BoolVarBranch(Rnd r);
04331 BoolVarBranch(Select s, BranchTbl t);
04333 BoolVarBranch(Select s, double d, BranchTbl t);
04335 BoolVarBranch(Select s, BoolAFC a, BranchTbl t);
04337 BoolVarBranch(Select s, BoolAction a, BranchTbl t);
04339 BoolVarBranch(Select s, BoolCHB c, BranchTbl t);
04341 BoolVarBranch(Select s, BoolBranchMerit mf, BranchTbl t);
04343 Select select(void) const;
04345 void expand(Home home, const BoolVarArgs& x);
04346 };
04347
04353
04354 IntVarBranch INT_VAR_NONE(void);
04356 IntVarBranch INT_VAR_RND(Rnd r);
04358 IntVarBranch INT_VAR_MERIT_MIN(IntBranchMerit bm, BranchTbl tbl=nullptr);
04360 IntVarBranch INT_VAR_MERIT_MAX(IntBranchMerit bm, BranchTbl tbl=nullptr);
04362 IntVarBranch INT_VAR_DEGREE_MIN(BranchTbl tbl=nullptr);
04364 IntVarBranch INT_VAR_DEGREE_MAX(BranchTbl tbl=nullptr);
04366 IntVarBranch INT_VAR_AFC_MIN(double d=1.0, BranchTbl tbl=nullptr);
04368 IntVarBranch INT_VAR_AFC_MIN(IntAFC a, BranchTbl tbl=nullptr);
04370 IntVarBranch INT_VAR_AFC_MAX(double d=1.0, BranchTbl tbl=nullptr);
04372 IntVarBranch INT_VAR_AFC_MAX(IntAFC a, BranchTbl tbl=nullptr);
04374 IntVarBranch INT_VAR_ACTION_MIN(double d=1.0, BranchTbl tbl=nullptr);
04376 IntVarBranch INT_VAR_ACTION_MIN(IntAction a, BranchTbl tbl=nullptr);
04378 IntVarBranch INT_VAR_ACTION_MAX(double d=1.0, BranchTbl tbl=nullptr);
04380 IntVarBranch INT_VAR_ACTION_MAX(IntAction a, BranchTbl tbl=nullptr);
04382 IntVarBranch INT_VAR_CHB_MIN(IntCHB c, BranchTbl tbl=nullptr);
04384 IntVarBranch INT_VAR_CHB_MIN(BranchTbl tbl=nullptr);
04386 IntVarBranch INT_VAR_CHB_MAX(IntCHB c, BranchTbl tbl=nullptr);
04388 IntVarBranch INT_VAR_CHB_MAX(BranchTbl tbl=nullptr);
04390 IntVarBranch INT_VAR_MIN_MIN(BranchTbl tbl=nullptr);
04392 IntVarBranch INT_VAR_MIN_MAX(BranchTbl tbl=nullptr);
04394 IntVarBranch INT_VAR_MAX_MIN(BranchTbl tbl=nullptr);
04396 IntVarBranch INT_VAR_MAX_MAX(BranchTbl tbl=nullptr);
04398 IntVarBranch INT_VAR_SIZE_MIN(BranchTbl tbl=nullptr);
04400 IntVarBranch INT_VAR_SIZE_MAX(BranchTbl tbl=nullptr);
04402 IntVarBranch INT_VAR_DEGREE_SIZE_MIN(BranchTbl tbl=nullptr);
04404 IntVarBranch INT_VAR_DEGREE_SIZE_MAX(BranchTbl tbl=nullptr);
04406 IntVarBranch INT_VAR_AFC_SIZE_MIN(double d=1.0, BranchTbl tbl=nullptr);
04408 IntVarBranch INT_VAR_AFC_SIZE_MIN(IntAFC a, BranchTbl tbl=nullptr);
04410 IntVarBranch INT_VAR_AFC_SIZE_MAX(double d=1.0, BranchTbl tbl=nullptr);
04412 IntVarBranch INT_VAR_AFC_SIZE_MAX(IntAFC a, BranchTbl tbl=nullptr);
04414 IntVarBranch INT_VAR_ACTION_SIZE_MIN(double d=1.0, BranchTbl tbl=nullptr);
04416 IntVarBranch INT_VAR_ACTION_SIZE_MIN(IntAction a, BranchTbl tbl=nullptr);
04418 IntVarBranch INT_VAR_ACTION_SIZE_MAX(double d=1.0, BranchTbl tbl=nullptr);
04420 IntVarBranch INT_VAR_ACTION_SIZE_MAX(IntAction a, BranchTbl tbl=nullptr);
04422 IntVarBranch INT_VAR_CHB_SIZE_MIN(IntCHB c, BranchTbl tbl=nullptr);
04424 IntVarBranch INT_VAR_CHB_SIZE_MIN(BranchTbl tbl=nullptr);
04426 IntVarBranch INT_VAR_CHB_SIZE_MAX(IntCHB c, BranchTbl tbl=nullptr);
04428 IntVarBranch INT_VAR_CHB_SIZE_MAX(BranchTbl tbl=nullptr);
04434 IntVarBranch INT_VAR_REGRET_MIN_MIN(BranchTbl tbl=nullptr);
04440 IntVarBranch INT_VAR_REGRET_MIN_MAX(BranchTbl tbl=nullptr);
04446 IntVarBranch INT_VAR_REGRET_MAX_MIN(BranchTbl tbl=nullptr);
04452 IntVarBranch INT_VAR_REGRET_MAX_MAX(BranchTbl tbl=nullptr);
04453
04455 BoolVarBranch BOOL_VAR_NONE(void);
04457 BoolVarBranch BOOL_VAR_RND(Rnd r);
04459 BoolVarBranch BOOL_VAR_MERIT_MIN(BoolBranchMerit bm, BranchTbl tbl=nullptr);
04461 BoolVarBranch BOOL_VAR_MERIT_MAX(BoolBranchMerit bm, BranchTbl tbl=nullptr);
04463 BoolVarBranch BOOL_VAR_DEGREE_MIN(BranchTbl tbl=nullptr);
04465 BoolVarBranch BOOL_VAR_DEGREE_MAX(BranchTbl tbl=nullptr);
04467 BoolVarBranch BOOL_VAR_AFC_MIN(double d=1.0, BranchTbl tbl=nullptr);
04469 BoolVarBranch BOOL_VAR_AFC_MIN(BoolAFC a, BranchTbl tbl=nullptr);
04471 BoolVarBranch BOOL_VAR_AFC_MAX(double d=1.0, BranchTbl tbl=nullptr);
04473 BoolVarBranch BOOL_VAR_AFC_MAX(BoolAFC a, BranchTbl tbl=nullptr);
04475 BoolVarBranch BOOL_VAR_ACTION_MIN(double d=1.0, BranchTbl tbl=nullptr);
04477 BoolVarBranch BOOL_VAR_ACTION_MIN(BoolAction a, BranchTbl tbl=nullptr);
04479 BoolVarBranch BOOL_VAR_ACTION_MAX(double d=1.0, BranchTbl tbl=nullptr);
04481 BoolVarBranch BOOL_VAR_ACTION_MAX(BoolAction a, BranchTbl tbl=nullptr);
04483 BoolVarBranch BOOL_VAR_CHB_MIN(BoolCHB c, BranchTbl tbl=nullptr);
04485 BoolVarBranch BOOL_VAR_CHB_MIN(BranchTbl tbl=nullptr);
04487 BoolVarBranch BOOL_VAR_CHB_MAX(BoolCHB c, BranchTbl tbl=nullptr);
04489 BoolVarBranch BOOL_VAR_CHB_MAX(BranchTbl tbl=nullptr);
04491
04492 }
04493
04494 #include <gecode/int/branch/var.hpp>
04495
04496 namespace Gecode {
04497
04503 class IntValBranch : public ValBranch<IntVar> {
04504 public:
04506 enum Select {
04507 SEL_MIN,
04508 SEL_MED,
04509 SEL_MAX,
04510 SEL_RND,
04511 SEL_SPLIT_MIN,
04512 SEL_SPLIT_MAX,
04513 SEL_RANGE_MIN,
04514 SEL_RANGE_MAX,
04515 SEL_VAL_COMMIT,
04516 SEL_VALUES_MIN,
04517 SEL_VALUES_MAX
04518 };
04519 protected:
04521 Select s;
04522 public:
04524 IntValBranch(Select s = SEL_MIN);
04526 IntValBranch(Rnd r);
04528 IntValBranch(IntBranchVal v, IntBranchCommit c);
04530 Select select(void) const;
04531 };
04532
04538 class BoolValBranch : public ValBranch<BoolVar> {
04539 public:
04541 enum Select {
04542 SEL_MIN,
04543 SEL_MAX,
04544 SEL_RND,
04545 SEL_VAL_COMMIT
04546 };
04547 protected:
04549 Select s;
04550 public:
04552 BoolValBranch(Select s = SEL_MIN);
04554 BoolValBranch(Rnd r);
04556 BoolValBranch(BoolBranchVal v, BoolBranchCommit c);
04558 Select select(void) const;
04559 };
04560
04566
04567 IntValBranch INT_VAL_MIN(void);
04569 IntValBranch INT_VAL_MED(void);
04571 IntValBranch INT_VAL_MAX(void);
04573 IntValBranch INT_VAL_RND(Rnd r);
04575 IntValBranch INT_VAL_SPLIT_MIN(void);
04577 IntValBranch INT_VAL_SPLIT_MAX(void);
04579 IntValBranch INT_VAL_RANGE_MIN(void);
04581 IntValBranch INT_VAL_RANGE_MAX(void);
04588 IntValBranch INT_VAL(IntBranchVal v, IntBranchCommit c=nullptr);
04590 IntValBranch INT_VALUES_MIN(void);
04592 IntValBranch INT_VALUES_MAX(void);
04593
04595 BoolValBranch BOOL_VAL_MIN(void);
04597 BoolValBranch BOOL_VAL_MAX(void);
04599 BoolValBranch BOOL_VAL_RND(Rnd r);
04606 BoolValBranch BOOL_VAL(BoolBranchVal v, BoolBranchCommit c=nullptr);
04608
04609 }
04610
04611 #include <gecode/int/branch/val.hpp>
04612
04613 namespace Gecode {
04614
04620 class IntAssign : public ValBranch<IntVar> {
04621 public:
04623 enum Select {
04624 SEL_MIN,
04625 SEL_MED,
04626 SEL_MAX,
04627 SEL_RND,
04628 SEL_VAL_COMMIT
04629 };
04630 protected:
04632 Select s;
04633 public:
04635 IntAssign(Select s = SEL_MIN);
04637 IntAssign(Rnd r);
04639 IntAssign(IntBranchVal v, IntBranchCommit c);
04641 Select select(void) const;
04642 };
04643
04649 class BoolAssign : public ValBranch<BoolVar> {
04650 public:
04652 enum Select {
04653 SEL_MIN,
04654 SEL_MAX,
04655 SEL_RND,
04656 SEL_VAL_COMMIT
04657 };
04658 protected:
04660 Select s;
04661 public:
04663 BoolAssign(Select s = SEL_MIN);
04665 BoolAssign(Rnd r);
04667 BoolAssign(BoolBranchVal v, BoolBranchCommit c);
04669 Select select(void) const;
04670 };
04671
04677
04678 IntAssign INT_ASSIGN_MIN(void);
04680 IntAssign INT_ASSIGN_MED(void);
04682 IntAssign INT_ASSIGN_MAX(void);
04684 IntAssign INT_ASSIGN_RND(Rnd r);
04691 IntAssign INT_ASSIGN(IntBranchVal v, IntBranchCommit c=nullptr);
04692
04694 BoolAssign BOOL_ASSIGN_MIN(void);
04696 BoolAssign BOOL_ASSIGN_MAX(void);
04698 BoolAssign BOOL_ASSIGN_RND(Rnd r);
04705 BoolAssign BOOL_ASSIGN(BoolBranchVal v, BoolBranchCommit c=nullptr);
04707
04708 }
04709
04710 #include <gecode/int/branch/assign.hpp>
04711
04712 namespace Gecode {
04718 GECODE_INT_EXPORT void
04719 branch(Home home, const IntVarArgs& x,
04720 IntVarBranch vars, IntValBranch vals,
04721 IntBranchFilter bf=nullptr,
04722 IntVarValPrint vvp=nullptr);
04728 GECODE_INT_EXPORT void
04729 branch(Home home, const IntVarArgs& x,
04730 TieBreak<IntVarBranch> vars, IntValBranch vals,
04731 IntBranchFilter bf=nullptr,
04732 IntVarValPrint vvp=nullptr);
04738 GECODE_INT_EXPORT void
04739 branch(Home home, IntVar x, IntValBranch vals,
04740 IntVarValPrint vvp=nullptr);
04746 GECODE_INT_EXPORT void
04747 branch(Home home, const BoolVarArgs& x,
04748 BoolVarBranch vars, BoolValBranch vals,
04749 BoolBranchFilter bf=nullptr,
04750 BoolVarValPrint vvp=nullptr);
04756 GECODE_INT_EXPORT void
04757 branch(Home home, const BoolVarArgs& x,
04758 TieBreak<BoolVarBranch> vars, BoolValBranch vals,
04759 BoolBranchFilter bf=nullptr,
04760 BoolVarValPrint vvp=nullptr);
04766 GECODE_INT_EXPORT void
04767 branch(Home home, BoolVar x, BoolValBranch vals,
04768 BoolVarValPrint vvp=nullptr);
04769
04775 GECODE_INT_EXPORT void
04776 assign(Home home, const IntVarArgs& x, IntAssign vals,
04777 IntBranchFilter bf=nullptr,
04778 IntVarValPrint vvp=nullptr);
04784 GECODE_INT_EXPORT void
04785 assign(Home home, IntVar x, IntAssign vals,
04786 IntVarValPrint vvp=nullptr);
04792 GECODE_INT_EXPORT void
04793 assign(Home home, const BoolVarArgs& x, BoolAssign vals,
04794 BoolBranchFilter bf=nullptr,
04795 BoolVarValPrint vvp=nullptr);
04801 GECODE_INT_EXPORT void
04802 assign(Home home, BoolVar x, BoolAssign vals,
04803 BoolVarValPrint vvp=nullptr);
04804
04805 }
04806
04807 namespace Gecode {
04808
04812 template<class Char, class Traits>
04813 std::basic_ostream<Char,Traits>&
04814 operator <<(std::basic_ostream<Char,Traits>& os, const DFA& d);
04815
04819 template<class Char, class Traits>
04820 std::basic_ostream<Char,Traits>&
04821 operator <<(std::basic_ostream<Char,Traits>& os, const TupleSet& ts);
04822
04823 }
04824
04825
04826 namespace Gecode {
04827
04828 namespace Int { namespace LDSB {
04829 class SymmetryObject;
04830 }}
04831
04837 class GECODE_INT_EXPORT SymmetryHandle {
04838 public:
04840 Int::LDSB::SymmetryObject* ref;
04842 void increment(void);
04844 void decrement(void);
04845 public:
04847 SymmetryHandle(void);
04849 SymmetryHandle(Int::LDSB::SymmetryObject* o);
04851 SymmetryHandle(const SymmetryHandle& h);
04853 const SymmetryHandle& operator=(const SymmetryHandle& h);
04855 ~SymmetryHandle(void);
04856 };
04857 class Symmetries;
04859 template<>
04860 class ArrayTraits<ArgArray<SymmetryHandle> > {
04861 public:
04862 typedef Symmetries StorageType;
04863 typedef SymmetryHandle ValueType;
04864 typedef Symmetries ArgsType;
04865 };
04866
04873
04874 class Symmetries : public ArgArray<SymmetryHandle> {};
04875
04876
04877
04879 GECODE_INT_EXPORT SymmetryHandle VariableSymmetry(const IntVarArgs& x);
04881 GECODE_INT_EXPORT SymmetryHandle VariableSymmetry(const BoolVarArgs& x);
04883 GECODE_INT_EXPORT SymmetryHandle VariableSymmetry(const IntVarArgs& x,
04884 const IntArgs& indices);
04886 GECODE_INT_EXPORT SymmetryHandle ValueSymmetry(const IntArgs& v);
04888 GECODE_INT_EXPORT SymmetryHandle ValueSymmetry(const IntSet& v);
04890 GECODE_INT_EXPORT SymmetryHandle ValueSymmetry(IntVar vars);
04896 GECODE_INT_EXPORT
04897 SymmetryHandle VariableSequenceSymmetry(const IntVarArgs& x, int ss);
04903 GECODE_INT_EXPORT
04904 SymmetryHandle VariableSequenceSymmetry(const BoolVarArgs& x, int ss);
04910 GECODE_INT_EXPORT
04911 SymmetryHandle ValueSequenceSymmetry(const IntArgs& v, int ss);
04912
04914 GECODE_INT_EXPORT SymmetryHandle values_reflect(int lower, int upper);
04916 GECODE_INT_EXPORT SymmetryHandle values_reflect(IntVar x);
04918
04930 GECODE_INT_EXPORT void
04931 branch(Home home, const IntVarArgs& x,
04932 IntVarBranch vars, IntValBranch vals,
04933 const Symmetries& syms,
04934 IntBranchFilter bf=nullptr,
04935 IntVarValPrint vvp=nullptr);
04947 GECODE_INT_EXPORT void
04948 branch(Home home, const IntVarArgs& x,
04949 TieBreak<IntVarBranch> vars, IntValBranch vals,
04950 const Symmetries& syms,
04951 IntBranchFilter bf=nullptr,
04952 IntVarValPrint vvp=nullptr);
04964 GECODE_INT_EXPORT void
04965 branch(Home home, const BoolVarArgs& x,
04966 BoolVarBranch vars, BoolValBranch vals,
04967 const Symmetries& syms,
04968 BoolBranchFilter bf=nullptr,
04969 BoolVarValPrint vvp=nullptr);
04981 GECODE_INT_EXPORT void
04982 branch(Home home, const BoolVarArgs& x,
04983 TieBreak<BoolVarBranch> vars, BoolValBranch vals,
04984 const Symmetries& syms,
04985 BoolBranchFilter bf=nullptr,
04986 BoolVarValPrint vvp=nullptr);
04987 }
04988
04989 namespace Gecode {
04990
04991
04992
04993
04994
04995
04996
04997
04998
04999
05000
05001
05002
05003
05004
05005
05006
05007
05008
05009
05010
05011
05012 GECODE_INT_EXPORT void
05013 relax(Home home, const IntVarArgs& x, const IntVarArgs& sx,
05014 Rnd r, double p);
05015
05016
05017
05018
05019
05020
05021
05022
05023
05024
05025
05026
05027
05028
05029
05030
05031
05032
05033
05034
05035
05036
05037 GECODE_INT_EXPORT void
05038 relax(Home home, const BoolVarArgs& x, const BoolVarArgs& sx,
05039 Rnd r, double p);
05040
05041 }
05042
05043
05044 #include <gecode/int/trace/int-trace-view.hpp>
05045 #include <gecode/int/trace/bool-trace-view.hpp>
05046
05047 namespace Gecode {
05048
05058 class IntTraceDelta
05059 : public Iter::Ranges::Diff<Iter::Ranges::RangeList,
05060 Int::ViewRanges<Int::IntView> > {
05061 protected:
05063 Int::ViewRanges<Int::IntView> rn;
05065 Iter::Ranges::RangeList ro;
05066 public:
05068
05069
05070 IntTraceDelta(Int::IntTraceView o, Int::IntView n, const Delta& d);
05072 };
05073
05078 class BoolTraceDelta {
05079 protected:
05081 int delta;
05082 public:
05084
05085
05086 BoolTraceDelta(Int::BoolTraceView o, Int::BoolView n, const Delta& d);
05088
05089
05090
05091 bool operator ()(void) const;
05093 void operator ++(void);
05095
05097
05098
05099 int min(void) const;
05101 int max(void) const;
05103 unsigned int width(void) const;
05105 };
05106
05107 }
05108
05109 #include <gecode/int/trace/int-delta.hpp>
05110 #include <gecode/int/trace/bool-delta.hpp>
05111
05112 #include <gecode/int/trace/traits.hpp>
05113
05114 namespace Gecode {
05115
05120 typedef ViewTracer<Int::IntView> IntTracer;
05125 typedef ViewTraceRecorder<Int::IntView> IntTraceRecorder;
05126
05131 class GECODE_INT_EXPORT StdIntTracer : public IntTracer {
05132 protected:
05134 std::ostream& os;
05135 public:
05137 StdIntTracer(std::ostream& os0 = std::cerr);
05139 virtual void init(const Space& home, const IntTraceRecorder& t);
05141 virtual void prune(const Space& home, const IntTraceRecorder& t,
05142 const ViewTraceInfo& vti, int i, IntTraceDelta& d);
05144 virtual void fix(const Space& home, const IntTraceRecorder& t);
05146 virtual void fail(const Space& home, const IntTraceRecorder& t);
05148 virtual void done(const Space& home, const IntTraceRecorder& t);
05150 static StdIntTracer def;
05151 };
05152
05153
05158 typedef ViewTracer<Int::BoolView> BoolTracer;
05163 typedef ViewTraceRecorder<Int::BoolView> BoolTraceRecorder;
05164
05169 class GECODE_INT_EXPORT StdBoolTracer : public BoolTracer {
05170 protected:
05172 std::ostream& os;
05173 public:
05175 StdBoolTracer(std::ostream& os0 = std::cerr);
05177 virtual void init(const Space& home, const BoolTraceRecorder& t);
05179 virtual void prune(const Space& home, const BoolTraceRecorder& t,
05180 const ViewTraceInfo& vti, int i, BoolTraceDelta& d);
05182 virtual void fix(const Space& home, const BoolTraceRecorder& t);
05184 virtual void fail(const Space& home, const BoolTraceRecorder& t);
05186 virtual void done(const Space& home, const BoolTraceRecorder& t);
05188 static StdBoolTracer def;
05189 };
05190
05195 GECODE_INT_EXPORT void
05196 trace(Home home, const IntVarArgs& x,
05197 TraceFilter tf,
05198 int te = (TE_INIT | TE_PRUNE | TE_FIX | TE_FAIL | TE_DONE),
05199 IntTracer& t = StdIntTracer::def);
05204 void
05205 trace(Home home, const IntVarArgs& x,
05206 int te = (TE_INIT | TE_PRUNE | TE_FIX | TE_FAIL | TE_DONE),
05207 IntTracer& t = StdIntTracer::def);
05208
05213 GECODE_INT_EXPORT void
05214 trace(Home home, const BoolVarArgs& x,
05215 TraceFilter tf,
05216 int te = (TE_INIT | TE_PRUNE | TE_FIX | TE_FAIL | TE_DONE),
05217 BoolTracer& t = StdBoolTracer::def);
05222 void
05223 trace(Home home, const BoolVarArgs& x,
05224 int te = (TE_INIT | TE_PRUNE | TE_FIX | TE_FAIL | TE_DONE),
05225 BoolTracer& t = StdBoolTracer::def);
05226
05227 }
05228
05229 #include <gecode/int/trace.hpp>
05230
05231 #endif
05232
05233
05234
05235