nq.icc
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 namespace Gecode { namespace Int { namespace Rel {
00023
00024
00025
00026
00027
00028
00029 template <class View>
00030 forceinline
00031 Nq<View>::Nq(Space* home, View x0, View x1)
00032 : BinaryPropagator<View,PC_INT_VAL>(home,x0,x1) {}
00033
00034 template <class View>
00035 ExecStatus
00036 Nq<View>::post(Space* home, View x0, View x1){
00037 if (x0.assigned()) {
00038 GECODE_ME_CHECK(x1.nq(home,x0.val()));
00039 } else if (x1.assigned()) {
00040 GECODE_ME_CHECK(x0.nq(home,x1.val()));
00041 } else if (same(x0,x1)) {
00042 return ES_FAILED;
00043 } else {
00044 (void) new (home) Nq<View>(home,x0,x1);
00045 }
00046 return ES_OK;
00047 }
00048
00049 template <class View>
00050 forceinline
00051 Nq<View>::Nq(Space* home, bool share, Nq<View>& p)
00052 : BinaryPropagator<View,PC_INT_VAL>(home,share,p) {}
00053
00054 template <class View>
00055 Actor*
00056 Nq<View>::copy(Space* home, bool share) {
00057 return new (home) Nq<View>(home,share,*this);
00058 }
00059
00060 template <class View>
00061 PropCost
00062 Nq<View>::cost(void) const {
00063 return PC_UNARY_LO;
00064 }
00065
00066 template <class View>
00067 ExecStatus
00068 Nq<View>::propagate(Space* home) {
00069 if (x0.assigned()) {
00070 GECODE_ME_CHECK(x1.nq(home,x0.val()));
00071 } else {
00072 GECODE_ME_CHECK(x0.nq(home,x1.val()));
00073 }
00074 return ES_SUBSUMED;
00075 }
00076
00077 }}}
00078
00079
00080