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 #ifndef __GECODE_SET_HH__
00029 #define __GECODE_SET_HH__
00030
00031 namespace Gecode { namespace Set {
00042 }}
00043
00044 #include "gecode/limits.hh"
00045
00046 #include "gecode/kernel.hh"
00047 #include "gecode/int.hh"
00048
00049
00050
00051
00052
00053
00054 #if !defined(GECODE_STATIC_LIBS) && \
00055 (defined(__CYGWIN__) || defined(__MINGW32__) || defined(_MSC_VER))
00056
00057 #ifdef GECODE_BUILD_SET
00058 #define GECODE_SET_EXPORT __declspec( dllexport )
00059 #else
00060 #define GECODE_SET_EXPORT __declspec( dllimport )
00061 #endif
00062
00063 #else
00064
00065 #ifdef GCC_HASCLASSVISIBILITY
00066
00067 #define GECODE_SET_EXPORT __attribute__ ((visibility("default")))
00068
00069 #else
00070
00071 #define GECODE_SET_EXPORT
00072
00073 #endif
00074 #endif
00075
00076 #include "gecode/set/exception.icc"
00077 #include "gecode/set/var.icc"
00078 #include "gecode/set/view.icc"
00079 #include "gecode/set/propagator.icc"
00080 #include "gecode/set/array.icc"
00081
00082 namespace Gecode {
00083
00088 enum SetRelType {
00089 SRT_EQ,
00090 SRT_NQ,
00091 SRT_SUB,
00092 SRT_SUP,
00093 SRT_DISJ,
00094 SRT_CMPL
00095 };
00096
00101 enum SetOpType {
00102 SOT_UNION,
00103 SOT_DUNION,
00104 SOT_INTER,
00105 SOT_MINUS
00106 };
00107
00115
00117 GECODE_SET_EXPORT void
00118 dom(Space* home, SetVar x, SetRelType r, int i);
00119
00121 GECODE_SET_EXPORT void
00122 dom(Space* home, SetVar x, SetRelType r, int i, int j);
00123
00125 GECODE_SET_EXPORT void
00126 dom(Space* home, SetVar x, SetRelType r, const IntSet& s);
00127
00129 GECODE_SET_EXPORT void
00130 dom(Space* home, SetVar x, SetRelType r, int i, BoolVar b);
00131
00133 GECODE_SET_EXPORT void
00134 dom(Space* home, SetVar x, SetRelType r, int i, int j, BoolVar b);
00135
00137 GECODE_SET_EXPORT void
00138 dom(Space* home, SetVar x, SetRelType r, const IntSet& s, BoolVar b);
00139
00141 GECODE_SET_EXPORT void
00142 cardinality(Space* home, SetVar x, unsigned int i, unsigned int j);
00143
00145
00146
00154
00156 GECODE_SET_EXPORT void
00157 rel(Space* home, SetVar x, SetRelType r, SetVar y);
00158
00160 GECODE_SET_EXPORT void
00161 rel(Space* home, SetVar x, SetRelType r, SetVar y, BoolVar b);
00162
00164 GECODE_SET_EXPORT void
00165 rel(Space* home, SetVar s, SetRelType r, IntVar x);
00166
00168 GECODE_SET_EXPORT void
00169 rel(Space* home, IntVar x, SetRelType r, SetVar s);
00170
00172 GECODE_SET_EXPORT void
00173 rel(Space* home, SetVar s, SetRelType r, IntVar x, BoolVar b);
00174
00176 GECODE_SET_EXPORT void
00177 rel(Space* home, IntVar x, SetRelType r, SetVar s, BoolVar b);
00178
00180 GECODE_SET_EXPORT void
00181 rel(Space* home, SetVar s, IntRelType r, IntVar x);
00182
00184 GECODE_SET_EXPORT void
00185 rel(Space* home, IntVar x, IntRelType r, SetVar s);
00186
00188
00196
00198 GECODE_SET_EXPORT void
00199 rel(Space* home, SetVar x, SetOpType op, SetVar y, SetRelType r, SetVar z);
00200
00202 GECODE_SET_EXPORT void
00203 rel(Space* home, SetOpType op, const SetVarArgs& x, SetVar y);
00204
00206 GECODE_SET_EXPORT void
00207 rel(Space* home, SetOpType op, const IntVarArgs& x, SetVar y);
00208
00210 GECODE_SET_EXPORT void
00211 rel(Space* home, const IntSet& x, SetOpType op, SetVar y,
00212 SetRelType r, SetVar z);
00213
00215 GECODE_SET_EXPORT void
00216 rel(Space* home, SetVar x, SetOpType op, const IntSet& y,
00217 SetRelType r, SetVar z);
00218
00220 GECODE_SET_EXPORT void
00221 rel(Space* home, SetVar x, SetOpType op, SetVar y,
00222 SetRelType r, const IntSet& z);
00223
00225 GECODE_SET_EXPORT void
00226 rel(Space* home, const IntSet& x, SetOpType op, const IntSet& y,
00227 SetRelType r, SetVar z);
00228
00230 GECODE_SET_EXPORT void
00231 rel(Space* home, const IntSet& x, SetOpType op, SetVar y, SetRelType r,
00232 const IntSet& z);
00233
00235 GECODE_SET_EXPORT void
00236 rel(Space* home, SetVar x, SetOpType op, const IntSet& y, SetRelType r,
00237 const IntSet& z);
00238
00240
00241
00248
00250 GECODE_SET_EXPORT void
00251 convex(Space* home, SetVar x);
00252
00254 GECODE_SET_EXPORT void
00255 convexHull(Space* home, SetVar x, SetVar y);
00256
00258
00265
00267 GECODE_SET_EXPORT void
00268 sequence(Space* home, const SetVarArgs& x);
00269
00271 GECODE_SET_EXPORT void
00272 sequentialUnion(Space* home, const SetVarArgs& y, SetVar x);
00273
00275
00282
00283
00285 GECODE_SET_EXPORT void
00286 atmostOne(Space* home, const SetVarArgs& x, unsigned int c);
00287
00289 GECODE_SET_EXPORT void
00290 distinct(Space* home, const SetVarArgs& x, unsigned int c);
00291
00293
00301
00303 GECODE_SET_EXPORT void
00304 min(Space* home, SetVar s, IntVar x);
00305
00307 GECODE_SET_EXPORT void
00308 max(Space* home, SetVar s, IntVar x);
00309
00311 GECODE_SET_EXPORT void
00312 match(Space* home, SetVar s, const IntVarArgs& x);
00313
00315 GECODE_SET_EXPORT void
00316 channel(Space* home, const IntVarArgs& x,const SetVarArgs& y);
00317
00319 GECODE_SET_EXPORT void
00320 cardinality(Space* home, SetVar s, IntVar x);
00321
00322
00333 GECODE_SET_EXPORT void
00334 weights(Space* home, const IntArgs& elements, const IntArgs& weights,
00335 SetVar x, IntVar y);
00336
00338
00352
00358 GECODE_SET_EXPORT void
00359 selectUnion(Space* home, const SetVarArgs& x, SetVar y, SetVar z);
00360
00366 GECODE_SET_EXPORT void
00367 selectInter(Space* home, const SetVarArgs& x, SetVar y, SetVar z);
00368
00374 GECODE_SET_EXPORT void
00375 selectInterIn(Space* home, const SetVarArgs& x, SetVar y, SetVar z,
00376 const IntSet& u);
00377
00379 GECODE_SET_EXPORT void
00380 selectDisjoint(Space* home, const SetVarArgs& x, SetVar y);
00381
00383 GECODE_SET_EXPORT void
00384 selectSet(Space* home, const SetVarArgs& x, IntVar y, SetVar z);
00385
00387
00394
00396 enum SetBvarSel {
00397 SETBVAR_NONE,
00398 SETBVAR_MIN_CARD,
00399 SETBVAR_MAX_CARD,
00400 SETBVAR_MIN_UNKNOWN_ELEM,
00401 SETBVAR_MAX_UNKNOWN_ELEM,
00402 };
00403
00405 enum SetBvalSel {
00406 SETBVAL_MIN,
00407 SETBVAL_MAX,
00408 };
00409
00411 GECODE_SET_EXPORT void
00412 branch(Space* home, const SetVarArgs& x, SetBvarSel vars, SetBvalSel vals);
00414
00415 }
00416
00417 #endif
00418
00419