46 #ifndef __GECODE_INT_HH__
47 #define __GECODE_INT_HH__
62 #if !defined(GECODE_STATIC_LIBS) && \
63 (defined(__CYGWIN__) || defined(__MINGW32__) || defined(_MSC_VER))
65 #ifdef GECODE_BUILD_INT
66 #define GECODE_INT_EXPORT __declspec( dllexport )
68 #define GECODE_INT_EXPORT __declspec( dllimport )
73 #ifdef GECODE_GCC_HAS_CLASS_VISIBILITY
74 #define GECODE_INT_EXPORT __attribute__ ((visibility("default")))
76 #define GECODE_INT_EXPORT
82 #ifndef GECODE_BUILD_INT
83 #define GECODE_LIBRARY_NAME "Int"
100 namespace Gecode {
namespace Int {
111 const int max = INT_MAX - 1;
117 const long long int llmax = LLONG_MAX - 1;
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);
133 void positive(
long long int n,
const char*
l);
160 template<
class I>
class IntSetInit;
236 int min(
int i)
const;
238 int max(
int i)
const;
240 unsigned int width(
int i)
const;
245 bool in(
int n)
const;
248 unsigned int size(
void)
const;
250 unsigned int width(
void)
const;
272 const IntSet::Range* i;
274 const IntSet::Range* e;
301 unsigned int width(
void)
const;
327 template<
class Char,
class Traits>
328 std::basic_ostream<Char,Traits>&
329 operator <<(std::basic_ostream<Char,Traits>& os,
const IntSet& s);
420 unsigned int size(
void)
const;
422 unsigned int width(
void)
const;
431 bool range(
void)
const;
434 bool in(
int n)
const;
442 template<
class Char,
class Traits>
443 std::basic_ostream<Char,Traits>&
444 operator <<(std::basic_ostream<Char,Traits>& os,
const IntVar&
x);
542 unsigned int size(
void)
const;
544 unsigned int width(
void)
const;
553 bool range(
void)
const;
556 bool in(
int n)
const;
561 bool zero(
void)
const;
564 bool one(
void)
const;
566 bool none(
void)
const;
574 template<
class Char,
class Traits>
575 std::basic_ostream<Char,Traits>&
576 operator <<(std::basic_ostream<Char,Traits>& os,
const BoolVar&
x);
616 IntArgs(
const std::vector<int>& x);
618 template<
class InputIterator>
619 IntArgs(InputIterator first, InputIterator last);
629 static IntArgs
create(
int n,
int start,
int inc=1);
649 template<
class InputIterator>
704 template<
class InputIterator>
1553 channel(Home home,
const BoolVarArgs&
x, IntVar y,
int o=0,
1575 sorted(Home home,
const IntVarArgs&
x,
const IntVarArgs& y,
1590 sorted(Home home,
const IntVarArgs&
x,
const IntVarArgs& y,
1591 const IntVarArgs& z,
1622 count(Home home,
const IntVarArgs&
x,
const IntSet& y,
IntRelType irt,
int m,
1642 count(Home home,
const IntVarArgs&
x,
const IntArgs& y,
IntRelType irt,
int m,
1656 count(Home home,
const IntVarArgs&
x,
const IntSet& y,
IntRelType irt, IntVar z,
1676 count(Home home,
const IntVarArgs&
x,
const IntArgs& y,
IntRelType irt, IntVar z,
1693 count(Home home,
const IntVarArgs&
x,
const IntVarArgs&
c,
1730 count(Home home,
const IntVarArgs&
x,
1731 const IntVarArgs&
c,
const IntArgs&
v,
1751 count(Home home,
const IntVarArgs&
x,
1772 count(Home home,
const IntVarArgs&
x,
1773 const IntSet&
c,
const IntArgs&
v,
1836 sequence(Home home,
const IntVarArgs&
x,
const IntSet& s,
1854 sequence(Home home,
const BoolVarArgs&
x,
const IntSet& s,
1893 Transition(
int i_state0,
int symbol0,
int o_state0);
1933 int val(
void)
const;
2088 int arity(
void)
const;
2094 int min(
void)
const;
2096 int max(
void)
const;
2155 min(Home home, IntVar x0, IntVar x1, IntVar x2,
2165 min(Home home,
const IntVarArgs&
x, IntVar y,
2173 max(Home home, IntVar x0, IntVar x1, IntVar x2,
2183 max(Home home,
const IntVarArgs&
x, IntVar y,
2192 abs(Home home, IntVar x0, IntVar x1,
2201 mult(Home home, IntVar x0, IntVar x1, IntVar x2,
2209 divmod(Home home, IntVar x0, IntVar x1, IntVar x2, IntVar x3,
2217 div(Home home, IntVar x0, IntVar x1, IntVar x2,
2225 mod(Home home, IntVar x0, IntVar x1, IntVar x2,
2234 sqr(Home home, IntVar x0, IntVar x1,
2243 sqrt(Home home, IntVar x0, IntVar x1,
2255 pow(Home home, IntVar x0,
int n, IntVar x1,
2267 nroot(Home home, IntVar x0,
int n, IntVar x1,
2304 linear(Home home,
const IntVarArgs&
x,
2311 linear(Home home,
const IntVarArgs&
x,
2318 linear(Home home,
const IntVarArgs&
x,
2325 linear(Home home,
const IntVarArgs&
x,
2335 linear(Home home,
const IntArgs&
a,
const IntVarArgs&
x,
2345 linear(Home home,
const IntArgs&
a,
const IntVarArgs&
x,
2355 linear(Home home,
const IntArgs&
a,
const IntVarArgs&
x,
2365 linear(Home home,
const IntArgs&
a,
const IntVarArgs&
x,
2398 linear(Home home,
const BoolVarArgs&
x,
2405 linear(Home home,
const BoolVarArgs&
x,
2412 linear(Home home,
const BoolVarArgs&
x,
2419 linear(Home home,
const BoolVarArgs&
x,
2429 linear(Home home,
const IntArgs&
a,
const BoolVarArgs&
x,
2439 linear(Home home,
const IntArgs&
a,
const BoolVarArgs&
x,
2449 linear(Home home,
const IntArgs&
a,
const BoolVarArgs&
x,
2459 linear(Home home,
const IntArgs&
a,
const BoolVarArgs&
x,
2492 const IntVarArgs&
l,
2493 const IntVarArgs&
b,
const IntArgs& s,
2515 const IntVarArgs&
x,
const IntArgs& w,
2516 const IntVarArgs& y,
const IntArgs& h,
2533 const IntVarArgs&
x,
const IntArgs& w,
2534 const IntVarArgs& y,
const IntArgs& h,
2535 const BoolVarArgs& o,
2555 const IntVarArgs& x0,
const IntVarArgs& w,
const IntVarArgs& x1,
2556 const IntVarArgs& y0,
const IntVarArgs& h,
const IntVarArgs& y1,
2577 const IntVarArgs& x0,
const IntVarArgs& w,
const IntVarArgs& x1,
2578 const IntVarArgs& y0,
const IntVarArgs& h,
const IntVarArgs& y1,
2579 const BoolVarArgs& o,
2633 const IntVarArgs& s,
const IntVarArgs&
p,
2634 const IntVarArgs& e,
const IntVarArgs&
u,
2635 const IntArgs&
c,
bool at_most,
2643 const IntVarArgs& s,
const IntVarArgs&
p,
2644 const IntVarArgs& e,
const IntVarArgs&
u,
2645 const IntArgs&
c,
bool at_most,
2653 const IntVarArgs& s,
const IntArgs&
p,
2654 const IntVarArgs& e,
const IntVarArgs&
u,
2655 const IntArgs&
c,
bool at_most,
2663 const IntVarArgs& s,
const IntArgs&
p,
2664 const IntVarArgs& e,
const IntVarArgs&
u,
2665 const IntArgs&
c,
bool at_most,
2673 const IntVarArgs& s,
const IntVarArgs&
p,
2674 const IntVarArgs& e,
const IntArgs&
u,
2675 const IntArgs&
c,
bool at_most,
2683 const IntVarArgs& s,
const IntVarArgs&
p,
2684 const IntVarArgs& e,
const IntArgs&
u,
2685 const IntArgs&
c,
bool at_most,
2693 const IntVarArgs& s,
const IntArgs&
p,
2694 const IntVarArgs& e,
const IntArgs&
u,
2695 const IntArgs&
c,
bool at_most,
2703 const IntVarArgs& s,
const IntArgs&
p,
2704 const IntVarArgs& e,
const IntArgs&
u,
2705 const IntArgs&
c,
bool at_most,
2727 unary(Home home,
const IntVarArgs& s,
const IntArgs&
p,
2751 unary(Home home,
const IntVarArgs& s,
const IntArgs&
p,
2818 const IntVarArgs& flex,
const IntArgs& fix,
2841 unary(Home home,
const IntVarArgs& s,
const IntVarArgs&
p,
2866 unary(Home home,
const IntVarArgs& s,
const IntVarArgs&
p,
2905 const IntVarArgs& flex,
const IntArgs& fix,
const IntArgs&
u,
2915 const IntVarArgs& flex,
const IntArgs& fix,
const IntArgs&
u,
2956 const IntVarArgs& flex,
const IntArgs& fix,
const IntArgs&
u,
2964 const IntVarArgs& flex,
const IntArgs& fix,
const IntArgs&
u,
2992 cumulative(Home home,
int c,
const IntVarArgs& s,
const IntArgs&
p,
2999 cumulative(Home home, IntVar
c,
const IntVarArgs& s,
const IntArgs&
p,
3029 cumulative(Home home,
int c,
const IntVarArgs& s,
const IntArgs&
p,
3036 cumulative(Home home, IntVar
c,
const IntVarArgs& s,
const IntArgs&
p,
3068 cumulative(Home home,
int c,
const IntVarArgs& s,
const IntVarArgs&
p,
3075 cumulative(Home home, IntVar
c,
const IntVarArgs& s,
const IntVarArgs&
p,
3109 cumulative(Home home,
int c,
const IntVarArgs& s,
const IntVarArgs&
p,
3110 const IntVarArgs& e,
const IntArgs&
u,
const BoolVarArgs& m,
3117 cumulative(Home home, IntVar
c,
const IntVarArgs& s,
const IntVarArgs&
p,
3118 const IntVarArgs& e,
const IntArgs&
u,
const BoolVarArgs& m,
3143 circuit(Home home,
const IntVarArgs&
x,
3161 circuit(Home home,
int offset,
const IntVarArgs&
x,
3187 const IntVarArgs&
x,
const IntVarArgs& y, IntVar z,
3213 const IntArgs&
c,
int offset,
3214 const IntVarArgs&
x,
const IntVarArgs& y, IntVar z,
3237 const IntVarArgs&
x, IntVar z,
3261 const IntArgs&
c,
int offset,
3262 const IntVarArgs&
x, IntVar z,
3280 path(Home home,
const IntVarArgs&
x, IntVar s, IntVar e,
3300 path(Home home,
int offset,
const IntVarArgs&
x, IntVar s, IntVar e,
3327 const IntVarArgs&
x, IntVar s, IntVar e,
const IntVarArgs& y, IntVar z,
3355 const IntArgs&
c,
int offset,
3356 const IntVarArgs&
x, IntVar s, IntVar e,
const IntVarArgs& y, IntVar z,
3381 const IntVarArgs&
x, IntVar s, IntVar e, IntVar z,
3407 const IntArgs&
c,
int offset,
3408 const IntVarArgs&
x, IntVar s, IntVar e, IntVar z,
3424 wait(Home home, IntVar
x,
void (*
c)(Space& home),
3428 wait(Home home, BoolVar x,
void (*
c)(Space& home),
3432 wait(Home home,
const IntVarArgs& x,
void (*
c)(Space& home),
3436 wait(Home home,
const BoolVarArgs& x,
void (*
c)(Space& home),
3440 when(Home home, BoolVar x,
3441 void (*
t)(Space& home),
void (*e)(Space& home)= NULL,
3471 unshare(Home home, IntVarArgs& x,
3475 unshare(Home home, BoolVarArgs& x,
4049 branch(Home home,
const IntVarArgs& x,
4050 IntVarBranch vars, IntValBranch vals,
4059 branch(Home home,
const IntVarArgs& x,
4060 TieBreak<IntVarBranch> vars, IntValBranch vals,
4069 branch(Home home, IntVar x, IntValBranch vals,
4077 branch(Home home,
const BoolVarArgs& x,
4078 IntVarBranch vars, IntValBranch vals,
4087 branch(Home home,
const BoolVarArgs& x,
4088 TieBreak<IntVarBranch> vars, IntValBranch vals,
4097 branch(Home home, BoolVar x, IntValBranch vals,
4106 assign(Home home,
const IntVarArgs& x, IntAssign vals,
4115 assign(Home home, IntVar x, IntAssign vals,
4123 assign(Home home,
const BoolVarArgs& x, IntAssign vals,
4132 assign(Home home, BoolVar x, IntAssign vals,
4142 template<
class Char,
class Traits>
4143 std::basic_ostream<Char,Traits>&
4144 operator <<(std::basic_ostream<Char,Traits>& os,
const DFA&
d);
4149 template<
class Char,
class Traits>
4150 std::basic_ostream<Char,Traits>&
4151 operator <<(std::basic_ostream<Char,Traits>& os,
const TupleSet& ts);
4158 namespace Int {
namespace LDSB {
4159 class SymmetryObject;
4172 void increment(
void);
4174 void decrement(
void);
4214 const IntArgs& indices);
4261 branch(Home home,
const IntVarArgs& x,
4262 IntVarBranch vars, IntValBranch vals,
4263 const Symmetries& syms,
4277 branch(Home home,
const IntVarArgs& x,
4278 TieBreak<IntVarBranch> vars, IntValBranch vals,
4279 const Symmetries& syms,
4293 branch(Home home,
const BoolVarArgs& x,
4294 IntVarBranch vars, IntValBranch vals,
4295 const Symmetries& syms,
4309 branch(Home home,
const BoolVarArgs& x,
4310 TieBreak<IntVarBranch> vars, IntValBranch vals,
4311 const Symmetries& syms,