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 #define GECODE_SET_EXPORT
00066
00067 #endif
00068
00069 #include "gecode/set/exception.icc"
00070 #include "gecode/set/var.icc"
00071 #include "gecode/set/view.icc"
00072 #include "gecode/set/propagator.icc"
00073 #include "gecode/set/array.icc"
00074
00075 namespace Gecode {
00076
00081 enum SetRelType {
00082 SRT_EQ,
00083 SRT_NQ,
00084 SRT_SUB,
00085 SRT_SUP,
00086 SRT_DISJ,
00087 SRT_CMPL
00088 };
00089
00094 enum SetOpType {
00095 SOT_UNION,
00096 SOT_DUNION,
00097 SOT_INTER,
00098 SOT_MINUS
00099 };
00100
00108
00110 GECODE_SET_EXPORT void
00111 dom(Space* home, SetVar x, SetRelType r, int i);
00112
00114 GECODE_SET_EXPORT void
00115 dom(Space* home, SetVar x, SetRelType r, int i, int j);
00116
00118 GECODE_SET_EXPORT void
00119 dom(Space* home, SetVar x, SetRelType r, const IntSet& s);
00120
00122 GECODE_SET_EXPORT void
00123 dom(Space* home, SetVar x, SetRelType r, int i, BoolVar b);
00124
00126 GECODE_SET_EXPORT void
00127 dom(Space* home, SetVar x, SetRelType r, int i, int j, BoolVar b);
00128
00130 GECODE_SET_EXPORT void
00131 dom(Space* home, SetVar x, SetRelType r, const IntSet& s, BoolVar b);
00132
00134 GECODE_SET_EXPORT void
00135 cardinality(Space* home, SetVar x, unsigned int i, unsigned int j);
00136
00138
00139
00147
00149 GECODE_SET_EXPORT void
00150 rel(Space* home, SetVar x, SetRelType r, SetVar y);
00151
00153 GECODE_SET_EXPORT void
00154 rel(Space* home, SetVar x, SetRelType r, SetVar y, BoolVar b);
00155
00157 GECODE_SET_EXPORT void
00158 rel(Space* home, SetVar s, SetRelType r, IntVar x);
00159
00161 GECODE_SET_EXPORT void
00162 rel(Space* home, IntVar x, SetRelType r, SetVar s);
00163
00165 GECODE_SET_EXPORT void
00166 rel(Space* home, SetVar s, SetRelType r, IntVar x, BoolVar b);
00167
00169 GECODE_SET_EXPORT void
00170 rel(Space* home, IntVar x, SetRelType r, SetVar s, BoolVar b);
00171
00173 GECODE_SET_EXPORT void
00174 rel(Space* home, SetVar s, IntRelType r, IntVar x);
00175
00177 GECODE_SET_EXPORT void
00178 rel(Space* home, IntVar x, IntRelType r, SetVar s);
00179
00181
00189
00191 GECODE_SET_EXPORT void
00192 rel(Space* home, SetVar x, SetOpType op, SetVar y, SetRelType r, SetVar z);
00193
00195 GECODE_SET_EXPORT void
00196 rel(Space* home, SetOpType op, const SetVarArgs& x, SetVar y);
00197
00199 GECODE_SET_EXPORT void
00200 rel(Space* home, SetOpType op, const IntVarArgs& x, SetVar y);
00201
00203 GECODE_SET_EXPORT void
00204 rel(Space* home, const IntSet& x, SetOpType op, SetVar y,
00205 SetRelType r, SetVar z);
00206
00208 GECODE_SET_EXPORT void
00209 rel(Space* home, SetVar x, SetOpType op, const IntSet& y,
00210 SetRelType r, SetVar z);
00211
00213 GECODE_SET_EXPORT void
00214 rel(Space* home, SetVar x, SetOpType op, SetVar y,
00215 SetRelType r, const IntSet& z);
00216
00218 GECODE_SET_EXPORT void
00219 rel(Space* home, const IntSet& x, SetOpType op, const IntSet& y,
00220 SetRelType r, SetVar z);
00221
00223 GECODE_SET_EXPORT void
00224 rel(Space* home, const IntSet& x, SetOpType op, SetVar y, SetRelType r,
00225 const IntSet& z);
00226
00228 GECODE_SET_EXPORT void
00229 rel(Space* home, SetVar x, SetOpType op, const IntSet& y, SetRelType r,
00230 const IntSet& z);
00231
00233
00234
00241
00243 GECODE_SET_EXPORT void
00244 convex(Space* home, SetVar x);
00245
00247 GECODE_SET_EXPORT void
00248 convexHull(Space* home, SetVar x, SetVar y);
00249
00251
00258
00260 GECODE_SET_EXPORT void
00261 sequence(Space* home, const SetVarArgs& x);
00262
00264 GECODE_SET_EXPORT void
00265 sequentialUnion(Space* home, const SetVarArgs& y, SetVar x);
00266
00268
00275
00276
00278 GECODE_SET_EXPORT void
00279 atmostOne(Space* home, const SetVarArgs& x, unsigned int c);
00280
00282 GECODE_SET_EXPORT void
00283 distinct(Space* home, const SetVarArgs& x, unsigned int c);
00284
00286
00294
00296 GECODE_SET_EXPORT void
00297 min(Space* home, SetVar s, IntVar x);
00298
00300 GECODE_SET_EXPORT void
00301 max(Space* home, SetVar s, IntVar x);
00302
00304 GECODE_SET_EXPORT void
00305 match(Space* home, SetVar s, const IntVarArgs& x);
00306
00308 GECODE_SET_EXPORT void
00309 channel(Space* home, const IntVarArgs& x,const SetVarArgs& y);
00310
00312 GECODE_SET_EXPORT void
00313 cardinality(Space* home, SetVar s, IntVar x);
00314
00315
00326 GECODE_SET_EXPORT void
00327 weights(Space* home, const IntArgs& elements, const IntArgs& weights,
00328 SetVar x, IntVar y);
00329
00331
00345
00351 GECODE_SET_EXPORT void
00352 selectUnion(Space* home, const SetVarArgs& x, SetVar y, SetVar z);
00353
00359 GECODE_SET_EXPORT void
00360 selectInter(Space* home, const SetVarArgs& x, SetVar y, SetVar z);
00361
00367 GECODE_SET_EXPORT void
00368 selectInterIn(Space* home, const SetVarArgs& x, SetVar y, SetVar z,
00369 const IntSet& u);
00370
00372 GECODE_SET_EXPORT void
00373 selectDisjoint(Space* home, const SetVarArgs& x, SetVar y);
00374
00376 GECODE_SET_EXPORT void
00377 selectSet(Space* home, const SetVarArgs& x, IntVar y, SetVar z);
00378
00380
00387
00389 enum SetBvarSel {
00390 SETBVAR_NONE,
00391 SETBVAR_MIN_CARD,
00392 SETBVAR_MAX_CARD,
00393 SETBVAR_MIN_UNKNOWN_ELEM,
00394 SETBVAR_MAX_UNKNOWN_ELEM,
00395 };
00396
00398 enum SetBvalSel {
00399 SETBVAL_MIN,
00400 SETBVAL_MAX,
00401 };
00402
00404 GECODE_SET_EXPORT void
00405 branch(Space* home, const SetVarArgs& x, SetBvarSel vars, SetBvalSel vals);
00407
00408 }
00409
00410 #endif
00411
00412