base.hpp /usr/include/gecode/int/bool.hh Gecode Gecode::Int Gecode::Int::Bool /*-*-mode:C++;c-basic-offset:2;indent-tabs-mode:nil-*-*/ /* *Mainauthors: *ChristianSchulte<schulte@gecode.org> * *Copyright: *ChristianSchulte,2004 * *Lastmodified: *$Date:2009-10-1217:36:53+0200(Mon,12Oct2009)$by$Author:schulte$ *$Revision:9878$ * *ThisfileispartofGecode,thegenericconstraint *developmentenvironment: *http://www.gecode.org * *Permissionisherebygranted,freeofcharge,toanypersonobtaining *acopyofthissoftwareandassociateddocumentationfiles(the *"Software"),todealintheSoftwarewithoutrestriction,including *withoutlimitationtherightstouse,copy,modify,merge,publish, *distribute,sublicense,and/orsellcopiesoftheSoftware,andto *permitpersonstowhomtheSoftwareisfurnishedtodoso,subjectto *thefollowingconditions: * *Theabovecopyrightnoticeandthispermissionnoticeshallbe *includedinallcopiesorsubstantialportionsoftheSoftware. * *THESOFTWAREISPROVIDED"ASIS",WITHOUTWARRANTYOFANYKIND, *EXPRESSORIMPLIED,INCLUDINGBUTNOTLIMITEDTOTHEWARRANTIESOF *MERCHANTABILITY,FITNESSFORAPARTICULARPURPOSEAND *NONINFRINGEMENT.INNOEVENTSHALLTHEAUTHORSORCOPYRIGHTHOLDERSBE *LIABLEFORANYCLAIM,DAMAGESOROTHERLIABILITY,WHETHERINANACTION *OFCONTRACT,TORTOROTHERWISE,ARISINGFROM,OUTOFORINCONNECTION *WITHTHESOFTWAREORTHEUSEOROTHERDEALINGSINTHESOFTWARE. * */ namespaceGecode{namespaceInt{namespaceBool{ /* *BinaryBooleanpropagators * */ template<classBVA,classBVB> forceinline BoolBinary<BVA,BVB>::BoolBinary(Homehome,BVAb0,BVBb1) :Propagator(home),x0(b0),x1(b1){ x0.subscribe(home,*this,PC_BOOL_VAL); x1.subscribe(home,*this,PC_BOOL_VAL); } template<classBVA,classBVB> forceinline BoolBinary<BVA,BVB>::BoolBinary(Space&home,boolshare, BoolBinary<BVA,BVB>&p) :Propagator(home,share,p){ x0.update(home,share,p.x0); x1.update(home,share,p.x1); } template<classBVA,classBVB> forceinline BoolBinary<BVA,BVB>::BoolBinary(Space&home,boolshare,Propagator&p, BVAb0,BVBb1) :Propagator(home,share,p){ x0.update(home,share,b0); x1.update(home,share,b1); } template<classBVA,classBVB> PropCost BoolBinary<BVA,BVB>::cost(constSpace&,constModEventDelta&)const{ returnPropCost::unary(PropCost::LO); } template<classBVA,classBVB> forceinlinesize_t BoolBinary<BVA,BVB>::dispose(Space&home){ x0.cancel(home,*this,PC_BOOL_VAL); x1.cancel(home,*this,PC_BOOL_VAL); (void)Propagator::dispose(home); returnsizeof(*this); } /* *TernaryBooleanpropagators * */ template<classBVA,classBVB,classBVC> forceinline BoolTernary<BVA,BVB,BVC>::BoolTernary (Homehome,BVAb0,BVBb1,BVCb2) :Propagator(home),x0(b0),x1(b1),x2(b2){ x0.subscribe(home,*this,PC_BOOL_VAL); x1.subscribe(home,*this,PC_BOOL_VAL); x2.subscribe(home,*this,PC_BOOL_VAL); } template<classBVA,classBVB,classBVC> forceinline BoolTernary<BVA,BVB,BVC>::BoolTernary(Space&home,boolshare, BoolTernary<BVA,BVB,BVC>&p) :Propagator(home,share,p){ x0.update(home,share,p.x0); x1.update(home,share,p.x1); x2.update(home,share,p.x2); } template<classBVA,classBVB,classBVC> forceinline BoolTernary<BVA,BVB,BVC>::BoolTernary(Space&home,boolshare,Propagator&p, BVAb0,BVBb1,BVCb2) :Propagator(home,share,p){ x0.update(home,share,b0); x1.update(home,share,b1); x2.update(home,share,b2); } template<classBVA,classBVB,classBVC> PropCost BoolTernary<BVA,BVB,BVC>::cost(constSpace&,constModEventDelta&)const{ returnPropCost::binary(PropCost::LO); } template<classBVA,classBVB,classBVC> forceinlinesize_t BoolTernary<BVA,BVB,BVC>::dispose(Space&home){ x0.cancel(home,*this,PC_BOOL_VAL); x1.cancel(home,*this,PC_BOOL_VAL); x2.cancel(home,*this,PC_BOOL_VAL); (void)Propagator::dispose(home); returnsizeof(*this); } }}} //STATISTICS:int-prop