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 #ifndef __GECODE_FLOAT_REL_HH__
00043 #define __GECODE_FLOAT_REL_HH__
00044
00045 #include <gecode/int.hh>
00046 #include <gecode/float.hh>
00047
00052 namespace Gecode { namespace Float { namespace Rel {
00053
00054
00055
00056
00057
00058
00065 template<class View0, class View1>
00066 class Eq :
00067 public MixBinaryPropagator<View0,PC_FLOAT_BND,View1,PC_FLOAT_BND> {
00068 protected:
00069 using MixBinaryPropagator<View0,PC_FLOAT_BND,View1,PC_FLOAT_BND>::x0;
00070 using MixBinaryPropagator<View0,PC_FLOAT_BND,View1,PC_FLOAT_BND>::x1;
00071
00073 Eq(Space& home, Eq<View0,View1>& p);
00074 public:
00076 Eq(Home home, View0 x0, View1 x1);
00078 Eq(Space& home, Propagator& p, View0 x0, View1 x1);
00080 virtual Actor* copy(Space& home);
00082 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00084 static ExecStatus post(Home home, View0 x0, View1 x1);
00085 };
00086
00093 template<class View>
00094 class NaryEq : public NaryPropagator<View,PC_FLOAT_BND> {
00095 protected:
00096 using NaryPropagator<View,PC_FLOAT_BND>::x;
00097
00099 NaryEq(Space& home, NaryEq<View>& p);
00101 NaryEq(Home home, ViewArray<View>&);
00102 public:
00104 virtual Actor* copy(Space& home);
00111 virtual PropCost cost(const Space& home, const ModEventDelta& med) const;
00113 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00115 static ExecStatus post(Home home, ViewArray<View>& x);
00116 };
00117
00124 template<class View, class CtrlView, ReifyMode rm>
00125 class ReEq : public Int::ReBinaryPropagator<View,PC_FLOAT_BND,CtrlView> {
00126 protected:
00127 using Int::ReBinaryPropagator<View,PC_FLOAT_BND,CtrlView>::x0;
00128 using Int::ReBinaryPropagator<View,PC_FLOAT_BND,CtrlView>::x1;
00129 using Int::ReBinaryPropagator<View,PC_FLOAT_BND,CtrlView>::b;
00130
00132 ReEq(Space& home, ReEq& p);
00134 ReEq(Home home, View x0, View x1, CtrlView b);
00135 public:
00137 virtual Actor* copy(Space& home);
00139 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00141 static ExecStatus post(Home home, View x0, View x1, CtrlView b);
00142 };
00143
00150 template<class View, class CtrlView, ReifyMode rm>
00151 class ReEqFloat : public Int::ReUnaryPropagator<View,PC_FLOAT_BND,CtrlView> {
00152 protected:
00153 using Int::ReUnaryPropagator<View,PC_FLOAT_BND,CtrlView>::x0;
00154 using Int::ReUnaryPropagator<View,PC_FLOAT_BND,CtrlView>::b;
00155
00157 FloatVal c;
00159 ReEqFloat(Space& home, ReEqFloat& p);
00161 ReEqFloat(Home home, View x, FloatVal c, CtrlView b);
00162 public:
00164 virtual Actor* copy(Space& home);
00166 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00168 static ExecStatus post(Home home, View x, FloatVal c, CtrlView b);
00169 };
00170
00171
00178 template<class View0, class View1>
00179 class Nq :
00180 public MixBinaryPropagator<View0,PC_FLOAT_VAL,View1,PC_FLOAT_VAL> {
00181 protected:
00182 using MixBinaryPropagator<View0,PC_FLOAT_VAL,View1,PC_FLOAT_VAL>::x0;
00183 using MixBinaryPropagator<View0,PC_FLOAT_VAL,View1,PC_FLOAT_VAL>::x1;
00184
00186 Nq(Space& home, Nq<View0,View1>& p);
00187 public:
00189 Nq(Home home, View0 x0, View1 x1);
00191 Nq(Space& home, Propagator& p, View0 x0, View1 x1);
00193 virtual Actor* copy(Space& home);
00195 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00197 static ExecStatus post(Home home, View0 x0, View1 x1);
00198 };
00199
00206 template<class View>
00207 class NqFloat :
00208 public UnaryPropagator<View,PC_FLOAT_VAL> {
00209 protected:
00210 using UnaryPropagator<View,PC_FLOAT_VAL>::x0;
00211
00213 FloatVal c;
00215 NqFloat(Space& home, NqFloat<View>& p);
00216 public:
00218 NqFloat(Home home, View x, FloatVal c);
00220 virtual Actor* copy(Space& home);
00222 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00224 static ExecStatus post(Home home, View x0, FloatVal c);
00225 };
00226
00227
00228
00229
00230
00231
00232
00240 template<class View>
00241 class Lq : public BinaryPropagator<View,PC_FLOAT_BND> {
00242 protected:
00243 using BinaryPropagator<View,PC_FLOAT_BND>::x0;
00244 using BinaryPropagator<View,PC_FLOAT_BND>::x1;
00245
00247 Lq(Space& home, Lq& p);
00249 Lq(Home home, View x0, View x1);
00250 public:
00252 virtual Actor* copy(Space& home);
00254 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00256 static ExecStatus post(Home home, View x0, View x1);
00257 };
00258
00266 template<class View>
00267 class Le : public BinaryPropagator<View,PC_FLOAT_BND> {
00268 protected:
00269 using BinaryPropagator<View,PC_FLOAT_BND>::x0;
00270 using BinaryPropagator<View,PC_FLOAT_BND>::x1;
00271
00273 Le(Space& home, Le& p);
00275 Le(Home home, View x0, View x1);
00276 public:
00278 virtual Actor* copy(Space& home);
00280 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00282 static ExecStatus post(Home home, View x0, View x1);
00283 };
00284
00285
00286
00287
00288
00289
00297 template<class View, class CtrlView, ReifyMode rm>
00298 class ReLqFloat : public Int::ReUnaryPropagator<View,PC_FLOAT_BND,CtrlView> {
00299 protected:
00300 using Int::ReUnaryPropagator<View,PC_FLOAT_BND,CtrlView>::x0;
00301 using Int::ReUnaryPropagator<View,PC_FLOAT_BND,CtrlView>::b;
00302
00304 FloatVal c;
00306 ReLqFloat(Space& home, ReLqFloat& p);
00308 ReLqFloat(Home home, View x, FloatVal c, CtrlView b);
00309 public:
00311 virtual Actor* copy(Space& home);
00313 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00315 static ExecStatus post(Home home, View x, FloatVal c, CtrlView b);
00316 };
00317
00325 template<class View, class CtrlView, ReifyMode rm>
00326 class ReLeFloat : public Int::ReUnaryPropagator<View,PC_FLOAT_BND,CtrlView> {
00327 protected:
00328 using Int::ReUnaryPropagator<View,PC_FLOAT_BND,CtrlView>::x0;
00329 using Int::ReUnaryPropagator<View,PC_FLOAT_BND,CtrlView>::b;
00330
00332 FloatVal c;
00334 ReLeFloat(Space& home, ReLeFloat& p);
00336 ReLeFloat(Home home, View x, FloatVal c, CtrlView b);
00337 public:
00339 virtual Actor* copy(Space& home);
00341 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00343 static ExecStatus post(Home home, View x, FloatVal c, CtrlView b);
00344 };
00345
00353 template<class View, class CtrlView, ReifyMode rm>
00354 class ReLq : public Int::ReBinaryPropagator<View,PC_FLOAT_BND,CtrlView> {
00355 protected:
00356 using Int::ReBinaryPropagator<View,PC_FLOAT_BND,CtrlView>::x0;
00357 using Int::ReBinaryPropagator<View,PC_FLOAT_BND,CtrlView>::x1;
00358 using Int::ReBinaryPropagator<View,PC_FLOAT_BND,CtrlView>::b;
00359
00361 ReLq(Space& home, ReLq& p);
00363 ReLq(Home home, View x0, View x1, CtrlView b);
00364 public:
00366 virtual Actor* copy(Space& home);
00368 virtual ExecStatus propagate(Space& home, const ModEventDelta& med);
00370 static ExecStatus post(Home home, View x0, View x1, CtrlView b);
00371 };
00372
00373 }}}
00374
00375 #include <gecode/float/rel/eq.hpp>
00376 #include <gecode/float/rel/nq.hpp>
00377 #include <gecode/float/rel/lq-le.hpp>
00378
00379 #endif
00380
00381
00382
00383