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;
119 bool valid(
double n);
121 void check(
int n,
const char* l);
123 void check(
double n,
const char* l);
125 void positive(
int n,
const char* l);
127 void positive(
double n,
const char* l);
150 template<
class I>
class IntSetInit;
212 IntSet(
const int r[][2],
int n);
223 int min(
int i)
const;
225 int max(
int i)
const;
227 unsigned int width(
int i)
const;
233 bool in(
int n)
const;
235 unsigned int size(
void)
const;
237 unsigned int width(
void)
const;
259 const IntSet::Range* i;
261 const IntSet::Range* e;
288 unsigned int width(
void)
const;
314 template<
class Char,
class Traits>
315 std::basic_ostream<Char,Traits>&
316 operator <<(std::basic_ostream<Char,Traits>& os,
const IntSet& s);
407 unsigned int size(
void)
const;
409 unsigned int width(
void)
const;
419 bool range(
void)
const;
421 bool in(
int n)
const;
429 template<
class Char,
class Traits>
430 std::basic_ostream<Char,Traits>&
431 operator <<(std::basic_ostream<Char,Traits>& os,
const IntVar& x);
529 unsigned int size(
void)
const;
531 unsigned int width(
void)
const;
541 bool range(
void)
const;
543 bool in(
int n)
const;
549 bool zero(
void)
const;
551 bool one(
void)
const;
553 bool none(
void)
const;
561 template<
class Char,
class Traits>
562 std::basic_ostream<Char,Traits>&
563 operator <<(std::basic_ostream<Char,Traits>& os,
const BoolVar& x);
603 IntArgs(
const std::vector<int>& x);
613 static IntArgs
create(
int n,
int start,
int inc=1);
1422 channel(Home home,
const BoolVarArgs& x, IntVar y,
int o=0,
1444 sorted(Home home,
const IntVarArgs& x,
const IntVarArgs& y,
1459 sorted(Home home,
const IntVarArgs& x,
const IntVarArgs& y,
1460 const IntVarArgs& z,
1525 count(Home home,
const IntVarArgs& x,
const IntSet& y,
IntRelType r, IntVar z,
1545 count(Home home,
const IntVarArgs& x,
const IntArgs& y,
IntRelType r, IntVar z,
1562 count(Home home,
const IntVarArgs& x,
const IntVarArgs&
c,
1599 count(Home home,
const IntVarArgs& x,
1600 const IntVarArgs&
c,
const IntArgs&
v,
1620 count(Home home,
const IntVarArgs& x,
1641 count(Home home,
const IntVarArgs& x,
1642 const IntSet&
c,
const IntArgs&
v,
1705 sequence(Home home,
const IntVarArgs& x,
const IntSet& s,
1723 sequence(Home home,
const BoolVarArgs& x,
const IntSet& s,
1798 int val(
void)
const;
1953 int arity(
void)
const;
1959 int min(
void)
const;
1961 int max(
void)
const;
2020 min(Home home, IntVar x0, IntVar x1, IntVar x2,
2030 min(Home home,
const IntVarArgs& x, IntVar y,
2038 max(Home home, IntVar x0, IntVar x1, IntVar x2,
2048 max(Home home,
const IntVarArgs& x, IntVar y,
2057 abs(Home home, IntVar x0, IntVar x1,
2066 mult(Home home, IntVar x0, IntVar x1, IntVar x2,
2075 sqr(Home home, IntVar x0, IntVar x1,
2084 sqrt(Home home, IntVar x0, IntVar x1,
2092 divmod(Home home, IntVar x0, IntVar x1, IntVar x2, IntVar x3,
2100 div(Home home, IntVar x0, IntVar x1, IntVar x2,
2108 mod(Home home, IntVar x0, IntVar x1, IntVar x2,
2144 linear(Home home,
const IntVarArgs& x,
2151 linear(Home home,
const IntVarArgs& x,
2158 linear(Home home,
const IntVarArgs& x,
2165 linear(Home home,
const IntVarArgs& x,
2175 linear(Home home,
const IntArgs&
a,
const IntVarArgs& x,
2185 linear(Home home,
const IntArgs&
a,
const IntVarArgs& x,
2195 linear(Home home,
const IntArgs&
a,
const IntVarArgs& x,
2205 linear(Home home,
const IntArgs&
a,
const IntVarArgs& x,
2238 linear(Home home,
const BoolVarArgs& x,
2245 linear(Home home,
const BoolVarArgs& x,
2252 linear(Home home,
const BoolVarArgs& x,
2259 linear(Home home,
const BoolVarArgs& x,
2269 linear(Home home,
const IntArgs&
a,
const BoolVarArgs& x,
2279 linear(Home home,
const IntArgs&
a,
const BoolVarArgs& x,
2289 linear(Home home,
const IntArgs&
a,
const BoolVarArgs& x,
2299 linear(Home home,
const IntArgs&
a,
const BoolVarArgs& x,
2332 const IntVarArgs& l,
2333 const IntVarArgs&
b,
const IntArgs& s,
2356 const IntVarArgs& x,
const IntArgs& w,
2357 const IntVarArgs& y,
const IntArgs& h,
2376 const IntVarArgs& x,
const IntArgs& w,
2377 const IntVarArgs& y,
const IntArgs& h,
2378 const BoolVarArgs& o,
2400 const IntVarArgs& x0,
const IntVarArgs& w,
const IntVarArgs& x1,
2401 const IntVarArgs& y0,
const IntVarArgs& h,
const IntVarArgs& y1,
2424 const IntVarArgs& x0,
const IntVarArgs& w,
const IntVarArgs& x1,
2425 const IntVarArgs& y0,
const IntVarArgs& h,
const IntVarArgs& y1,
2426 const BoolVarArgs& o,
2480 const IntVarArgs& s,
const IntVarArgs& p,
2481 const IntVarArgs& e,
const IntVarArgs& u,
2482 const IntArgs&
c,
bool at_most,
2490 const IntVarArgs& s,
const IntVarArgs& p,
2491 const IntVarArgs& e,
const IntVarArgs& u,
2492 const IntArgs&
c,
bool at_most,
2500 const IntVarArgs& s,
const IntArgs& p,
2501 const IntVarArgs& e,
const IntVarArgs& u,
2502 const IntArgs&
c,
bool at_most,
2510 const IntVarArgs& s,
const IntArgs& p,
2511 const IntVarArgs& e,
const IntVarArgs& u,
2512 const IntArgs&
c,
bool at_most,
2520 const IntVarArgs& s,
const IntVarArgs& p,
2521 const IntVarArgs& e,
const IntArgs& u,
2522 const IntArgs&
c,
bool at_most,
2530 const IntVarArgs& s,
const IntVarArgs& p,
2531 const IntVarArgs& e,
const IntArgs& u,
2532 const IntArgs&
c,
bool at_most,
2540 const IntVarArgs& s,
const IntArgs& p,
2541 const IntVarArgs& e,
const IntArgs& u,
2542 const IntArgs&
c,
bool at_most,
2550 const IntVarArgs& s,
const IntArgs& p,
2551 const IntVarArgs& e,
const IntArgs& u,
2552 const IntArgs&
c,
bool at_most,
2574 unary(Home home,
const IntVarArgs& s,
const IntArgs& p,
2598 unary(Home home,
const IntVarArgs& s,
const IntArgs& p,
2665 const IntVarArgs& flex,
const IntArgs& fix,
2688 unary(Home home,
const IntVarArgs& s,
const IntVarArgs& p,
2713 unary(Home home,
const IntVarArgs& s,
const IntVarArgs& p,
2752 const IntVarArgs& flex,
const IntArgs& fix,
const IntArgs& u,
2762 const IntVarArgs& flex,
const IntArgs& fix,
const IntArgs& u,
2803 const IntVarArgs& flex,
const IntArgs& fix,
const IntArgs& u,
2811 const IntVarArgs& flex,
const IntArgs& fix,
const IntArgs& u,
2839 cumulative(Home home,
int c,
const IntVarArgs& s,
const IntArgs& p,
2846 cumulative(Home home, IntVar
c,
const IntVarArgs& s,
const IntArgs& p,
2876 cumulative(Home home,
int c,
const IntVarArgs& s,
const IntArgs& p,
2883 cumulative(Home home, IntVar
c,
const IntVarArgs& s,
const IntArgs& p,
2915 cumulative(Home home,
int c,
const IntVarArgs& s,
const IntVarArgs& p,
2922 cumulative(Home home, IntVar
c,
const IntVarArgs& s,
const IntVarArgs& p,
2956 cumulative(Home home,
int c,
const IntVarArgs& s,
const IntVarArgs& p,
2957 const IntVarArgs& e,
const IntArgs& u,
const BoolVarArgs&
m,
2964 cumulative(Home home, IntVar
c,
const IntVarArgs& s,
const IntVarArgs& p,
2965 const IntVarArgs& e,
const IntArgs& u,
const BoolVarArgs&
m,
2990 circuit(Home home,
const IntVarArgs& x,
3008 circuit(Home home,
int offset,
const IntVarArgs& x,
3034 const IntVarArgs& x,
const IntVarArgs& y, IntVar z,
3060 const IntArgs&
c,
int offset,
3061 const IntVarArgs& x,
const IntVarArgs& y, IntVar z,
3084 const IntVarArgs& x, IntVar z,
3108 const IntArgs&
c,
int offset,
3109 const IntVarArgs& x, IntVar z,
3127 path(Home home,
const IntVarArgs& x, IntVar s, IntVar e,
3147 path(Home home,
int offset,
const IntVarArgs& x, IntVar s, IntVar e,
3174 const IntVarArgs& x, IntVar s, IntVar e,
const IntVarArgs& y, IntVar z,
3202 const IntArgs&
c,
int offset,
3203 const IntVarArgs& x, IntVar s, IntVar e,
const IntVarArgs& y, IntVar z,
3228 const IntVarArgs& x, IntVar s, IntVar e, IntVar z,
3254 const IntArgs&
c,
int offset,
3255 const IntVarArgs& x, IntVar s, IntVar e, IntVar z,
3271 wait(Home home, IntVar x,
void (*
c)(Space& home),
3275 wait(Home home, BoolVar x,
void (*
c)(Space& home),
3279 wait(Home home,
const IntVarArgs& x,
void (*
c)(Space& home),
3283 wait(Home home,
const BoolVarArgs& x,
void (*
c)(Space& home),
3287 when(Home home, BoolVar x,
3288 void (*t)(Space& home),
void (*e)(Space& home)= NULL,
3318 unshare(Home home, IntVarArgs& x,
3322 unshare(Home home, BoolVarArgs& x,
3392 branch(Home home,
const IntVarArgs& x,
3398 branch(Home home,
const IntVarArgs& x,
3399 const TieBreakVarBranch<IntVarBranch>& vars,
IntValBranch vals,
3408 branch(Home home,
const BoolVarArgs& x,
3414 branch(Home home,
const BoolVarArgs& x,
3415 const TieBreakVarBranch<IntVarBranch>& vars,
IntValBranch vals,
3460 template<
class Char,
class Traits>
3461 std::basic_ostream<Char,Traits>&
3462 operator <<(std::basic_ostream<Char,Traits>& os,
const DFA&
d);
3467 template<
class Char,
class Traits>
3468 std::basic_ostream<Char,Traits>&
3469 operator <<(std::basic_ostream<Char,Traits>& os,
const TupleSet& ts);