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