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 namespace Gecode { namespace Int { namespace Bool {
00039
00040
00041
00042
00043
00044 template<class BVA, class BVB>
00045 forceinline
00046 BoolBinary<BVA,BVB>::BoolBinary(Home home, BVA b0, BVB b1)
00047 : Propagator(home), x0(b0), x1(b1) {
00048 x0.subscribe(home,*this,PC_BOOL_VAL);
00049 x1.subscribe(home,*this,PC_BOOL_VAL);
00050 }
00051
00052 template<class BVA, class BVB>
00053 forceinline
00054 BoolBinary<BVA,BVB>::BoolBinary(Space& home, bool share,
00055 BoolBinary<BVA,BVB>& p)
00056 : Propagator(home,share,p) {
00057 x0.update(home,share,p.x0);
00058 x1.update(home,share,p.x1);
00059 }
00060
00061 template<class BVA, class BVB>
00062 forceinline
00063 BoolBinary<BVA,BVB>::BoolBinary(Space& home, bool share, Propagator& p,
00064 BVA b0, BVB b1)
00065 : Propagator(home,share,p) {
00066 x0.update(home,share,b0);
00067 x1.update(home,share,b1);
00068 }
00069
00070 template<class BVA, class BVB>
00071 PropCost
00072 BoolBinary<BVA,BVB>::cost(const Space&, const ModEventDelta&) const {
00073 return PropCost::unary(PropCost::LO);
00074 }
00075
00076 template<class BVA, class BVB>
00077 void
00078 BoolBinary<BVA,BVB>::reschedule(Space& home) {
00079 x0.reschedule(home,*this,PC_BOOL_VAL);
00080 x1.reschedule(home,*this,PC_BOOL_VAL);
00081 }
00082
00083 template<class BVA, class BVB>
00084 forceinline size_t
00085 BoolBinary<BVA,BVB>::dispose(Space& home) {
00086 x0.cancel(home,*this,PC_BOOL_VAL);
00087 x1.cancel(home,*this,PC_BOOL_VAL);
00088 (void) Propagator::dispose(home);
00089 return sizeof(*this);
00090 }
00091
00092
00093
00094
00095
00096 template<class BVA, class BVB, class BVC>
00097 forceinline
00098 BoolTernary<BVA,BVB,BVC>::BoolTernary
00099 (Home home, BVA b0, BVB b1, BVC b2)
00100 : Propagator(home), x0(b0), x1(b1), x2(b2) {
00101 x0.subscribe(home,*this,PC_BOOL_VAL);
00102 x1.subscribe(home,*this,PC_BOOL_VAL);
00103 x2.subscribe(home,*this,PC_BOOL_VAL);
00104 }
00105
00106 template<class BVA, class BVB, class BVC>
00107 forceinline
00108 BoolTernary<BVA,BVB,BVC>::BoolTernary(Space& home, bool share,
00109 BoolTernary<BVA,BVB,BVC>& p)
00110 : Propagator(home,share,p) {
00111 x0.update(home,share,p.x0);
00112 x1.update(home,share,p.x1);
00113 x2.update(home,share,p.x2);
00114 }
00115
00116 template<class BVA, class BVB, class BVC>
00117 forceinline
00118 BoolTernary<BVA,BVB,BVC>::BoolTernary(Space& home, bool share, Propagator& p,
00119 BVA b0, BVB b1, BVC b2)
00120 : Propagator(home,share,p) {
00121 x0.update(home,share,b0);
00122 x1.update(home,share,b1);
00123 x2.update(home,share,b2);
00124 }
00125
00126 template<class BVA, class BVB, class BVC>
00127 PropCost
00128 BoolTernary<BVA,BVB,BVC>::cost(const Space&, const ModEventDelta&) const {
00129 return PropCost::binary(PropCost::LO);
00130 }
00131
00132 template<class BVA, class BVB, class BVC>
00133 void
00134 BoolTernary<BVA,BVB,BVC>::reschedule(Space& home) {
00135 x0.reschedule(home,*this,PC_BOOL_VAL);
00136 x1.reschedule(home,*this,PC_BOOL_VAL);
00137 x2.reschedule(home,*this,PC_BOOL_VAL);
00138 }
00139
00140 template<class BVA, class BVB, class BVC>
00141 forceinline size_t
00142 BoolTernary<BVA,BVB,BVC>::dispose(Space& home) {
00143 x0.cancel(home,*this,PC_BOOL_VAL);
00144 x1.cancel(home,*this,PC_BOOL_VAL);
00145 x2.cancel(home,*this,PC_BOOL_VAL);
00146 (void) Propagator::dispose(home);
00147 return sizeof(*this);
00148 }
00149
00150 }}}
00151
00152