예제 #1
0
파일: nq.hpp 프로젝트: Wushaowei001/vcp
 ExecStatus
 Nq<View0,View1>::post(Home home, View0 x0, View1 x1){
   if (x0.assigned() && x1.assigned()) {
     if (overlap(x0.val(),x1.val()))
       return ES_FAILED;
   } else if (same(x0,x1)) {
     return ES_FAILED;
   } else {
     (void) new (home) Nq<View0,View1>(home,x0,x1);
   }
   return ES_OK;
 }
예제 #2
0
파일: eq.hpp 프로젝트: Gecode/gecode
 ExecStatus
 Eq<View0,View1>::post(Home home, View0 x0, View1 x1){
   if (x0.assigned()) {
     GECODE_ME_CHECK(x1.eq(home,x0.val()));
   } else if (x1.assigned()) {
     GECODE_ME_CHECK(x0.eq(home,x1.val()));
   } else if (!same(x0,x1)) {
     GECODE_ME_CHECK(x0.lq(home,x1.max()));
     GECODE_ME_CHECK(x1.lq(home,x0.max()));
     GECODE_ME_CHECK(x0.gq(home,x1.min()));
     GECODE_ME_CHECK(x1.gq(home,x0.min()));
     (void) new (home) Eq<View0,View1>(home,x0,x1);
   }
   return ES_OK;
 }