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 Bool {
00023
00024
00025
00026
00027
00028 template<class BVA, class BVB>
00029 forceinline
00030 BoolBinary<BVA,BVB>::BoolBinary(Space* home, BVA b0, BVB b1)
00031 : Propagator(home), x0(b0), x1(b1) {
00032 x0.subscribe(home,this,PC_INT_VAL);
00033 x1.subscribe(home,this,PC_INT_VAL);
00034 }
00035
00036 template<class BVA, class BVB>
00037 forceinline
00038 BoolBinary<BVA,BVB>::BoolBinary(Space* home, bool share,
00039 BoolBinary<BVA,BVB>& p)
00040 : Propagator(home,share,p) {
00041 x0.update(home,share,p.x0);
00042 x1.update(home,share,p.x1);
00043 }
00044
00045 template<class BVA, class BVB>
00046 PropCost
00047 BoolBinary<BVA,BVB>::cost(void) const {
00048 return PC_UNARY_LO;
00049 }
00050
00051 template<class BVA, class BVB>
00052 BoolBinary<BVA,BVB>::~BoolBinary(void) {
00053 x0.cancel(this,PC_INT_VAL);
00054 x1.cancel(this,PC_INT_VAL);
00055 }
00056
00057
00058
00059
00060
00061 template<class BVA, class BVB, class BVC>
00062 forceinline
00063 BoolTernary<BVA,BVB,BVC>::BoolTernary
00064 (Space* home, BVA b0, BVB b1, BVC b2)
00065 : Propagator(home), x0(b0), x1(b1), x2(b2) {
00066 x0.subscribe(home,this,PC_INT_VAL);
00067 x1.subscribe(home,this,PC_INT_VAL);
00068 x2.subscribe(home,this,PC_INT_VAL);
00069 }
00070
00071 template<class BVA, class BVB, class BVC>
00072 forceinline
00073 BoolTernary<BVA,BVB,BVC>::BoolTernary(Space* home, bool share,
00074 BoolTernary<BVA,BVB,BVC>& p)
00075 : Propagator(home,share,p) {
00076 x0.update(home,share,p.x0);
00077 x1.update(home,share,p.x1);
00078 x2.update(home,share,p.x2);
00079 }
00080
00081 template<class BVA, class BVB, class BVC>
00082 PropCost
00083 BoolTernary<BVA,BVB,BVC>::cost(void) const {
00084 return PC_BINARY_LO;
00085 }
00086
00087 template<class BVA, class BVB, class BVC>
00088 BoolTernary<BVA,BVB,BVC>::~BoolTernary(void) {
00089 x0.cancel(this,PC_INT_VAL);
00090 x1.cancel(this,PC_INT_VAL);
00091 x2.cancel(this,PC_INT_VAL);
00092 }
00093
00094 }}}
00095
00096
00097