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 #ifndef __GECODE_INT_REL_HH__
00045 #define __GECODE_INT_REL_HH__
00046
00047 #include <gecode/int.hh>
00048
00054 namespace Gecode { namespace Int { namespace Rel {
00055
00056
00057
00058
00059
00060
00070 template<class View0,class View1>
00071 class EqDom :
00072 public MixBinaryPropagator<View0,PC_INT_DOM,View1,PC_INT_DOM> {
00073 protected:
00074 using MixBinaryPropagator<View0,PC_INT_DOM,View1,PC_INT_DOM>::x0;
00075 using MixBinaryPropagator<View0,PC_INT_DOM,View1,PC_INT_DOM>::x1;
00076
00078 EqDom(Space& home, bool share, EqDom<View0,View1>& p);
00079 public:
00081 EqDom(Home home, View0 x0, View1 x1);
00083 EqDom(Space& home, bool share, Propagator& p, View0 x0, View1 x1);
00085 virtual Actor* copy(Space& home, bool share);
00093 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
00095 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00097 static ExecStatus post(Home home, View0 x0, View1 x1);
00098 };
00099
00106 template<class View0, class View1>
00107 class EqBnd :
00108 public MixBinaryPropagator<View0,PC_INT_BND,View1,PC_INT_BND> {
00109 protected:
00110 using MixBinaryPropagator<View0,PC_INT_BND,View1,PC_INT_BND>::x0;
00111 using MixBinaryPropagator<View0,PC_INT_BND,View1,PC_INT_BND>::x1;
00112
00114 EqBnd(Space& home, bool share, EqBnd<View0,View1>& p);
00115 public:
00117 EqBnd(Home home, View0 x0, View1 x1);
00119 EqBnd(Space& home, bool share, Propagator& p, View0 x0, View1 x1);
00121 virtual Actor* copy(Space& home, bool share);
00123 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00125 static ExecStatus post(Home home, View0 x0, View1 x1);
00126 };
00127
00137 template<class View>
00138 class NaryEqDom : public NaryPropagator<View,PC_INT_DOM> {
00139 protected:
00140 using NaryPropagator<View,PC_INT_DOM>::x;
00141
00143 NaryEqDom(Space& home, bool share, NaryEqDom<View>& p);
00145 NaryEqDom(Home home, ViewArray<View>&);
00146 public:
00148 virtual Actor* copy(Space& home, bool share);
00156 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
00158 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00160 static ExecStatus post(Home home, ViewArray<View>& x);
00161 };
00162
00169 template<class View>
00170 class NaryEqBnd : public NaryPropagator<View,PC_INT_BND> {
00171 protected:
00172 using NaryPropagator<View,PC_INT_BND>::x;
00173
00175 NaryEqBnd(Space& home, bool share, NaryEqBnd<View>& p);
00177 NaryEqBnd(Home home, ViewArray<View>&);
00178 public:
00180 virtual Actor* copy(Space& home, bool share);
00187 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
00189 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00191 static ExecStatus post(Home home, ViewArray<View>& x);
00192 };
00193
00200 template<class View, class CtrlView>
00201 class ReEqDom : public ReBinaryPropagator<View,PC_INT_DOM,CtrlView> {
00202 protected:
00203 using ReBinaryPropagator<View,PC_INT_DOM,CtrlView>::x0;
00204 using ReBinaryPropagator<View,PC_INT_DOM,CtrlView>::x1;
00205 using ReBinaryPropagator<View,PC_INT_DOM,CtrlView>::b;
00206
00208 ReEqDom(Space& home, bool share, ReEqDom& p);
00210 ReEqDom(Home home, View x0, View x1, CtrlView b);
00211 public:
00213 virtual Actor* copy(Space& home, bool share);
00215 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00217 static ExecStatus post(Home home, View x0, View x1, CtrlView b);
00218 };
00219
00226 template<class View, class CtrlView>
00227 class ReEqBnd : public ReBinaryPropagator<View,PC_INT_BND,CtrlView> {
00228 protected:
00229 using ReBinaryPropagator<View,PC_INT_BND,CtrlView>::x0;
00230 using ReBinaryPropagator<View,PC_INT_BND,CtrlView>::x1;
00231 using ReBinaryPropagator<View,PC_INT_BND,CtrlView>::b;
00232
00234 ReEqBnd(Space& home, bool share, ReEqBnd& p);
00236 ReEqBnd(Home home, View x0, View x1, CtrlView b);
00237 public:
00239 virtual Actor* copy(Space& home, bool share);
00241 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00243 static ExecStatus post(Home home, View x0, View x1, CtrlView b);
00244 };
00245
00252 template<class View, class CtrlView>
00253 class ReEqDomInt : public ReUnaryPropagator<View,PC_INT_DOM,CtrlView> {
00254 protected:
00255 using ReUnaryPropagator<View,PC_INT_DOM,CtrlView>::x0;
00256 using ReUnaryPropagator<View,PC_INT_DOM,CtrlView>::b;
00257
00259 int c;
00261 ReEqDomInt(Space& home, bool share, ReEqDomInt& p);
00263 ReEqDomInt(Home home, View x, int c, CtrlView b);
00264 public:
00266 virtual Actor* copy(Space& home, bool share);
00268 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00270 static ExecStatus post(Home home, View x, int c, CtrlView b);
00271 };
00272
00279 template<class View, class CtrlView>
00280 class ReEqBndInt : public ReUnaryPropagator<View,PC_INT_BND,CtrlView> {
00281 protected:
00282 using ReUnaryPropagator<View,PC_INT_BND,CtrlView>::x0;
00283 using ReUnaryPropagator<View,PC_INT_BND,CtrlView>::b;
00284
00286 int c;
00288 ReEqBndInt(Space& home, bool share, ReEqBndInt& p);
00290 ReEqBndInt(Home home, View x, int c, CtrlView b);
00291 public:
00293 virtual Actor* copy(Space& home, bool share);
00295 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00297 static ExecStatus post(Home home, View x, int c, CtrlView b);
00298 };
00299
00300
00301
00302
00303
00304
00305
00306
00307
00314 template<class View>
00315 class Nq : public BinaryPropagator<View,PC_INT_VAL> {
00316 protected:
00317 using BinaryPropagator<View,PC_INT_VAL>::x0;
00318 using BinaryPropagator<View,PC_INT_VAL>::x1;
00319
00321 Nq(Space& home, bool share, Nq<View>& p);
00323 Nq(Home home, View x0, View x1);
00324 public:
00326 virtual Actor* copy(Space& home, bool share);
00328 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
00330 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00332 static ExecStatus post(Home home, View x0, View x1);
00333 };
00334
00335
00336
00337
00338
00339
00347 template<class View>
00348 class Lq : public BinaryPropagator<View,PC_INT_BND> {
00349 protected:
00350 using BinaryPropagator<View,PC_INT_BND>::x0;
00351 using BinaryPropagator<View,PC_INT_BND>::x1;
00352
00354 Lq(Space& home, bool share, Lq& p);
00356 Lq(Home home, View x0, View x1);
00357 public:
00359 virtual Actor* copy(Space& home, bool share);
00361 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00363 static ExecStatus post(Home home, View x0, View x1);
00364 };
00365
00372 template<class View>
00373 class Le : public BinaryPropagator<View,PC_INT_BND> {
00374 protected:
00375 using BinaryPropagator<View,PC_INT_BND>::x0;
00376 using BinaryPropagator<View,PC_INT_BND>::x1;
00377
00379 Le(Space& home, bool share, Le& p);
00381 Le(Home home, View x0, View x1);
00382 public:
00384 virtual Actor* copy(Space& home, bool share);
00386 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00388 static ExecStatus post(Home home, View x0, View x1);
00389 };
00390
00391
00392
00393
00394
00395
00396
00404 template<class View, class CtrlView>
00405 class ReLq : public ReBinaryPropagator<View,PC_INT_BND,CtrlView> {
00406 protected:
00407 using ReBinaryPropagator<View,PC_INT_BND,CtrlView>::x0;
00408 using ReBinaryPropagator<View,PC_INT_BND,CtrlView>::x1;
00409 using ReBinaryPropagator<View,PC_INT_BND,CtrlView>::b;
00410
00412 ReLq(Space& home, bool share, ReLq& p);
00414 ReLq(Home home, View x0, View x1, CtrlView b);
00415 public:
00417 virtual Actor* copy(Space& home, bool share);
00419 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00421 static ExecStatus post(Home home, View x0, View x1, CtrlView b);
00422 };
00423
00431 template<class View, class CtrlView>
00432 class ReLqInt : public ReUnaryPropagator<View,PC_INT_BND,CtrlView> {
00433 protected:
00434 using ReUnaryPropagator<View,PC_INT_BND,CtrlView>::x0;
00435 using ReUnaryPropagator<View,PC_INT_BND,CtrlView>::b;
00436
00438 int c;
00440 ReLqInt(Space& home, bool share, ReLqInt& p);
00442 ReLqInt(Home home, View x, int c, CtrlView b);
00443 public:
00445 virtual Actor* copy(Space& home, bool share);
00447 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00449 static ExecStatus post(Home home, View x, int c, CtrlView b);
00450 };
00451
00452
00453
00454
00455
00479 template<class View>
00480 class Lex : public Propagator {
00481 protected:
00483 ViewArray<View> x, y;
00485 bool strict;
00487 Lex(Space& home, bool share, Lex& p);
00489 Lex(Home home, ViewArray<View>& x, ViewArray<View>& y, bool strict);
00490 public:
00492 virtual Actor* copy(Space& home, bool share);
00494 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
00496 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00498 static ExecStatus post(Home home, ViewArray<View>& x, ViewArray<View>& y,
00499 bool strict);
00501 virtual size_t dispose(Space& home);
00502 };
00503
00504 }}}
00505
00506 #include <gecode/int/rel/eq.hpp>
00507 #include <gecode/int/rel/nq.hpp>
00508 #include <gecode/int/rel/lq-le.hpp>
00509 #include <gecode/int/rel/lex.hpp>
00510
00511 #endif
00512
00513
00514
00515