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(Space* 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(ModEventDelta) const {
00073 return PC_UNARY_LO;
00074 }
00075
00076 template<class BVA, class BVB>
00077 Reflection::ActorSpec
00078 BoolBinary<BVA,BVB>::spec(const Space* home, Reflection::VarMap& m,
00079 const Support::Symbol& name) const {
00080 Reflection::ActorSpec s(name);
00081 return s << x0.spec(home, m)
00082 << x1.spec(home, m);
00083 }
00084
00085 template<class BVA, class BVB>
00086 forceinline size_t
00087 BoolBinary<BVA,BVB>::dispose(Space* home) {
00088 x0.cancel(home,this,PC_BOOL_VAL);
00089 x1.cancel(home,this,PC_BOOL_VAL);
00090 (void) Propagator::dispose(home);
00091 return sizeof(*this);
00092 }
00093
00094
00095
00096
00097
00098 template<class BVA, class BVB, class BVC>
00099 forceinline
00100 BoolTernary<BVA,BVB,BVC>::BoolTernary
00101 (Space* home, BVA b0, BVB b1, BVC b2)
00102 : Propagator(home), x0(b0), x1(b1), x2(b2) {
00103 x0.subscribe(home,this,PC_BOOL_VAL);
00104 x1.subscribe(home,this,PC_BOOL_VAL);
00105 x2.subscribe(home,this,PC_BOOL_VAL);
00106 }
00107
00108 template<class BVA, class BVB, class BVC>
00109 forceinline
00110 BoolTernary<BVA,BVB,BVC>::BoolTernary(Space* home, bool share,
00111 BoolTernary<BVA,BVB,BVC>& p)
00112 : Propagator(home,share,p) {
00113 x0.update(home,share,p.x0);
00114 x1.update(home,share,p.x1);
00115 x2.update(home,share,p.x2);
00116 }
00117
00118 template<class BVA, class BVB, class BVC>
00119 forceinline
00120 BoolTernary<BVA,BVB,BVC>::BoolTernary(Space* home, bool share, Propagator& p,
00121 BVA b0, BVB b1, BVC b2)
00122 : Propagator(home,share,p) {
00123 x0.update(home,share,b0);
00124 x1.update(home,share,b1);
00125 x2.update(home,share,b2);
00126 }
00127
00128 template<class BVA, class BVB, class BVC>
00129 PropCost
00130 BoolTernary<BVA,BVB,BVC>::cost(ModEventDelta) const {
00131 return PC_BINARY_LO;
00132 }
00133
00134 template<class BVA, class BVB, class BVC>
00135 Reflection::ActorSpec
00136 BoolTernary<BVA,BVB,BVC>::spec(const Space* home, Reflection::VarMap& m,
00137 const Support::Symbol& name) const {
00138 Reflection::ActorSpec s(name);
00139 return s << x0.spec(home, m)
00140 << x1.spec(home, m)
00141 << x2.spec(home, m);
00142 }
00143
00144 template<class BVA, class BVB, class BVC>
00145 forceinline size_t
00146 BoolTernary<BVA,BVB,BVC>::dispose(Space* home) {
00147 x0.cancel(home,this,PC_BOOL_VAL);
00148 x1.cancel(home,this,PC_BOOL_VAL);
00149 x2.cancel(home,this,PC_BOOL_VAL);
00150 (void) Propagator::dispose(home);
00151 return sizeof(*this);
00152 }
00153
00154 }}}
00155
00156