var-imp.hpp /usr/include/gecode/kernel.hh Gecode /* *CAUTION: *Thisfilehasbeenautomaticallygenerated.Donotedit, *editthefollowingfilesinstead: *-./gecode/int/var-imp/int.vis *-./gecode/int/var-imp/bool.vis *-./gecode/set/var-imp/set.vis *-./gecode/float/var-imp/float.vis * *Thisfilecontainsgeneratedcodefragmentswhichare *copyrightedasfollows: * *Mainauthor: *ChristianSchulte<schulte@gecode.org> * *Copyright: *ChristianSchulte,2007 * *ThegeneratedcodefragmentsarepartofGecode,thegeneric *constraintdevelopmentenvironment: *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. * */ #ifdefGECODE_HAS_INT_VARS namespaceGecode{namespaceInt{ classIntVarImpBase:publicGecode::VarImp<Gecode::Int::IntVarImpConf>{ protected: IntVarImpBase(Gecode::Space&home,boolshare,IntVarImpBase&x); public: IntVarImpBase(void); IntVarImpBase(Gecode::Space&home); voidsubscribe(Gecode::Space&home,Gecode::Propagator&p,Gecode::PropCondpc,boolassigned,boolschedule); voidsubscribe(Gecode::Space&home,Gecode::Advisor&a,boolassigned); Gecode::ModEventnotify(Gecode::Space&home,Gecode::ModEventme,Gecode::Delta&d); }; }} #endif #ifdefGECODE_HAS_INT_VARS namespaceGecode{namespaceInt{ classBoolVarImpBase:publicGecode::VarImp<Gecode::Int::BoolVarImpConf>{ protected: BoolVarImpBase(Gecode::Space&home,boolshare,BoolVarImpBase&x); public: BoolVarImpBase(void); BoolVarImpBase(Gecode::Space&home); voidsubscribe(Gecode::Space&home,Gecode::Propagator&p,Gecode::PropCondpc,boolassigned,boolschedule); voidsubscribe(Gecode::Space&home,Gecode::Advisor&a,boolassigned); Gecode::ModEventnotify(Gecode::Space&home,Gecode::ModEventme,Gecode::Delta&d); }; }} #endif #ifdefGECODE_HAS_SET_VARS namespaceGecode{namespaceSet{ classSetVarImpBase:publicGecode::VarImp<Gecode::Set::SetVarImpConf>{ protected: SetVarImpBase(Gecode::Space&home,boolshare,SetVarImpBase&x); public: SetVarImpBase(void); SetVarImpBase(Gecode::Space&home); voidsubscribe(Gecode::Space&home,Gecode::Propagator&p,Gecode::PropCondpc,boolassigned,boolschedule); voidsubscribe(Gecode::Space&home,Gecode::Advisor&a,boolassigned); Gecode::ModEventnotify(Gecode::Space&home,Gecode::ModEventme,Gecode::Delta&d); }; }} #endif #ifdefGECODE_HAS_FLOAT_VARS namespaceGecode{namespaceFloat{ classFloatVarImpBase:publicGecode::VarImp<Gecode::Float::FloatVarImpConf>{ protected: FloatVarImpBase(Gecode::Space&home,boolshare,FloatVarImpBase&x); public: FloatVarImpBase(void); FloatVarImpBase(Gecode::Space&home); voidsubscribe(Gecode::Space&home,Gecode::Propagator&p,Gecode::PropCondpc,boolassigned,boolschedule); voidsubscribe(Gecode::Space&home,Gecode::Advisor&a,boolassigned); Gecode::ModEventnotify(Gecode::Space&home,Gecode::ModEventme,Gecode::Delta&d); }; }} #endif #ifdefGECODE_HAS_INT_VARS namespaceGecode{namespaceInt{ forceinline IntVarImpBase::IntVarImpBase(void){} forceinline IntVarImpBase::IntVarImpBase(Gecode::Space&home) :Gecode::VarImp<Gecode::Int::IntVarImpConf>(home){} forceinline IntVarImpBase::IntVarImpBase(Gecode::Space&home,boolshare,IntVarImpBase&x) :Gecode::VarImp<Gecode::Int::IntVarImpConf>(home,share,x){} forceinlinevoid IntVarImpBase::subscribe(Gecode::Space&home,Gecode::Propagator&p,Gecode::PropCondpc,boolassigned,boolschedule){ Gecode::VarImp<Gecode::Int::IntVarImpConf>::subscribe(home,p,pc,assigned,ME_INT_BND,schedule); } forceinlinevoid IntVarImpBase::subscribe(Gecode::Space&home,Gecode::Advisor&a,boolassigned){ Gecode::VarImp<Gecode::Int::IntVarImpConf>::subscribe(home,a,assigned); } forceinlineGecode::ModEvent IntVarImpBase::notify(Gecode::Space&home,Gecode::ModEventme,Gecode::Delta&d){ switch(me){ caseME_INT_VAL: //Conditions:VAL,BND,DOM schedule(home,PC_INT_VAL,PC_INT_DOM,ME_INT_VAL); if(!Gecode::VarImp<Gecode::Int::IntVarImpConf>::advise(home,ME_INT_VAL,d)) returnME_INT_FAILED; cancel(home); break; caseME_INT_BND: //Conditions:BND,DOM schedule(home,PC_INT_BND,PC_INT_DOM,ME_INT_BND); if(!Gecode::VarImp<Gecode::Int::IntVarImpConf>::advise(home,ME_INT_BND,d)) returnME_INT_FAILED; break; caseME_INT_DOM: //Conditions:DOM schedule(home,PC_INT_DOM,PC_INT_DOM,ME_INT_DOM); if(!Gecode::VarImp<Gecode::Int::IntVarImpConf>::advise(home,ME_INT_DOM,d)) returnME_INT_FAILED; break; default:GECODE_NEVER; } returnme; } }} #endif #ifdefGECODE_HAS_INT_VARS namespaceGecode{namespaceInt{ forceinline BoolVarImpBase::BoolVarImpBase(void){} forceinline BoolVarImpBase::BoolVarImpBase(Gecode::Space&home) :Gecode::VarImp<Gecode::Int::BoolVarImpConf>(home){} forceinline BoolVarImpBase::BoolVarImpBase(Gecode::Space&home,boolshare,BoolVarImpBase&x) :Gecode::VarImp<Gecode::Int::BoolVarImpConf>(home,share,x){} forceinlinevoid BoolVarImpBase::subscribe(Gecode::Space&home,Gecode::Propagator&p,Gecode::PropCondpc,boolassigned,boolschedule){ Gecode::VarImp<Gecode::Int::BoolVarImpConf>::subscribe(home,p,pc,assigned,ME_BOOL_VAL,schedule); } forceinlinevoid BoolVarImpBase::subscribe(Gecode::Space&home,Gecode::Advisor&a,boolassigned){ Gecode::VarImp<Gecode::Int::BoolVarImpConf>::subscribe(home,a,assigned); } forceinlineGecode::ModEvent BoolVarImpBase::notify(Gecode::Space&home,Gecode::ModEvent,Gecode::Delta&d){ schedule(home,PC_BOOL_VAL,PC_BOOL_VAL,ME_BOOL_VAL); if(!Gecode::VarImp<Gecode::Int::BoolVarImpConf>::advise(home,ME_BOOL_VAL,d)) returnME_BOOL_FAILED; cancel(home); returnME_BOOL_VAL; } }} #endif #ifdefGECODE_HAS_SET_VARS namespaceGecode{namespaceSet{ forceinline SetVarImpBase::SetVarImpBase(void){} forceinline SetVarImpBase::SetVarImpBase(Gecode::Space&home) :Gecode::VarImp<Gecode::Set::SetVarImpConf>(home){} forceinline SetVarImpBase::SetVarImpBase(Gecode::Space&home,boolshare,SetVarImpBase&x) :Gecode::VarImp<Gecode::Set::SetVarImpConf>(home,share,x){} forceinlinevoid SetVarImpBase::subscribe(Gecode::Space&home,Gecode::Propagator&p,Gecode::PropCondpc,boolassigned,boolschedule){ Gecode::VarImp<Gecode::Set::SetVarImpConf>::subscribe(home,p,pc,assigned,ME_SET_CBB,schedule); } forceinlinevoid SetVarImpBase::subscribe(Gecode::Space&home,Gecode::Advisor&a,boolassigned){ Gecode::VarImp<Gecode::Set::SetVarImpConf>::subscribe(home,a,assigned); } forceinlineGecode::ModEvent SetVarImpBase::notify(Gecode::Space&home,Gecode::ModEventme,Gecode::Delta&d){ switch(me){ caseME_SET_VAL: //Conditions:VAL,CARD,CLUB,CGLB,ANY schedule(home,PC_SET_VAL,PC_SET_ANY,ME_SET_VAL); if(!Gecode::VarImp<Gecode::Set::SetVarImpConf>::advise(home,ME_SET_VAL,d)) returnME_SET_FAILED; cancel(home); break; caseME_SET_CARD: //Conditions:CARD,CLUB,CGLB,ANY schedule(home,PC_SET_CARD,PC_SET_ANY,ME_SET_CARD); if(!Gecode::VarImp<Gecode::Set::SetVarImpConf>::advise(home,ME_SET_CARD,d)) returnME_SET_FAILED; break; caseME_SET_LUB: //Conditions:CLUB,ANY schedule(home,PC_SET_CLUB,PC_SET_CLUB,ME_SET_LUB); schedule(home,PC_SET_ANY,PC_SET_ANY,ME_SET_LUB); if(!Gecode::VarImp<Gecode::Set::SetVarImpConf>::advise(home,ME_SET_LUB,d)) returnME_SET_FAILED; break; caseME_SET_GLB: //Conditions:CGLB,ANY schedule(home,PC_SET_CGLB,PC_SET_ANY,ME_SET_GLB); if(!Gecode::VarImp<Gecode::Set::SetVarImpConf>::advise(home,ME_SET_GLB,d)) returnME_SET_FAILED; break; caseME_SET_BB: //Conditions:CLUB,CGLB,ANY schedule(home,PC_SET_CLUB,PC_SET_ANY,ME_SET_BB); if(!Gecode::VarImp<Gecode::Set::SetVarImpConf>::advise(home,ME_SET_BB,d)) returnME_SET_FAILED; break; caseME_SET_CLUB: //Conditions:CARD,CLUB,CGLB,ANY schedule(home,PC_SET_CARD,PC_SET_ANY,ME_SET_CLUB); if(!Gecode::VarImp<Gecode::Set::SetVarImpConf>::advise(home,ME_SET_CLUB,d)) returnME_SET_FAILED; break; caseME_SET_CGLB: //Conditions:CARD,CLUB,CGLB,ANY schedule(home,PC_SET_CARD,PC_SET_ANY,ME_SET_CGLB); if(!Gecode::VarImp<Gecode::Set::SetVarImpConf>::advise(home,ME_SET_CGLB,d)) returnME_SET_FAILED; break; caseME_SET_CBB: //Conditions:CARD,CLUB,CGLB,ANY schedule(home,PC_SET_CARD,PC_SET_ANY,ME_SET_CBB); if(!Gecode::VarImp<Gecode::Set::SetVarImpConf>::advise(home,ME_SET_CBB,d)) returnME_SET_FAILED; break; default:GECODE_NEVER; } returnme; } }} #endif #ifdefGECODE_HAS_FLOAT_VARS namespaceGecode{namespaceFloat{ forceinline FloatVarImpBase::FloatVarImpBase(void){} forceinline FloatVarImpBase::FloatVarImpBase(Gecode::Space&home) :Gecode::VarImp<Gecode::Float::FloatVarImpConf>(home){} forceinline FloatVarImpBase::FloatVarImpBase(Gecode::Space&home,boolshare,FloatVarImpBase&x) :Gecode::VarImp<Gecode::Float::FloatVarImpConf>(home,share,x){} forceinlinevoid FloatVarImpBase::subscribe(Gecode::Space&home,Gecode::Propagator&p,Gecode::PropCondpc,boolassigned,boolschedule){ Gecode::VarImp<Gecode::Float::FloatVarImpConf>::subscribe(home,p,pc,assigned,ME_FLOAT_BND,schedule); } forceinlinevoid FloatVarImpBase::subscribe(Gecode::Space&home,Gecode::Advisor&a,boolassigned){ Gecode::VarImp<Gecode::Float::FloatVarImpConf>::subscribe(home,a,assigned); } forceinlineGecode::ModEvent FloatVarImpBase::notify(Gecode::Space&home,Gecode::ModEventme,Gecode::Delta&d){ switch(me){ caseME_FLOAT_VAL: //Conditions:VAL,BND schedule(home,PC_FLOAT_VAL,PC_FLOAT_BND,ME_FLOAT_VAL); if(!Gecode::VarImp<Gecode::Float::FloatVarImpConf>::advise(home,ME_FLOAT_VAL,d)) returnME_FLOAT_FAILED; cancel(home); break; caseME_FLOAT_BND: //Conditions:BND schedule(home,PC_FLOAT_BND,PC_FLOAT_BND,ME_FLOAT_BND); if(!Gecode::VarImp<Gecode::Float::FloatVarImpConf>::advise(home,ME_FLOAT_BND,d)) returnME_FLOAT_FAILED; break; default:GECODE_NEVER; } returnme; } }} #endif namespaceGecode{ forceinlinevoid Space::update(ActorLink**sub){ #ifdefGECODE_HAS_INT_VARS Gecode::VarImp<Gecode::Int::IntVarImpConf>::update(*this,sub); #endif #ifdefGECODE_HAS_INT_VARS Gecode::VarImp<Gecode::Int::BoolVarImpConf>::update(*this,sub); #endif #ifdefGECODE_HAS_SET_VARS Gecode::VarImp<Gecode::Set::SetVarImpConf>::update(*this,sub); #endif #ifdefGECODE_HAS_FLOAT_VARS Gecode::VarImp<Gecode::Float::FloatVarImpConf>::update(*this,sub); #endif } } //STATISTICS:kernel-var