man-to-opt.hpp /usr/include/gecode/int/task.hh Gecode Gecode::Int /*-*-mode:C++;c-basic-offset:2;indent-tabs-mode:nil-*-*/ /* *Mainauthors: *ChristianSchulte<schulte@gecode.org> * *Copyright: *ChristianSchulte,2009 * *Lastmodified: *$Date:2011-05-2516:56:41+0200(Wed,25May2011)$by$Author:schulte$ *$Revision:12022$ * *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{ template<classManTask> forceinline ManToOptTask<ManTask>::ManToOptTask(void){} template<classManTask> forceinlinebool ManToOptTask<ManTask>::mandatory(void)const{ return_m.one(); } template<classManTask> forceinlinebool ManToOptTask<ManTask>::excluded(void)const{ return_m.zero(); } template<classManTask> forceinlinebool ManToOptTask<ManTask>::optional(void)const{ return_m.none(); } template<classManTask> forceinlinebool ManToOptTask<ManTask>::assigned(void)const{ returnManTask::assigned()&&_m.assigned(); } template<classManTask> forceinlineModEvent ManToOptTask<ManTask>::mandatory(Space&home){ return_m.one(home); } template<classManTask> forceinlineModEvent ManToOptTask<ManTask>::excluded(Space&home){ return_m.zero(home); } template<classManTask> forceinlinevoid ManToOptTask<ManTask>::update(Space&home,boolshare, ManToOptTask<ManTask>&t){ ManTask::update(home,share,t); _m.update(home,share,t._m); } template<classManTask> forceinlinevoid ManToOptTask<ManTask>::subscribe(Space&home,Propagator&p,PropCondpc){ ManTask::subscribe(home,p,pc); _m.subscribe(home,p,Int::PC_BOOL_VAL); } template<classManTask> forceinlinevoid ManToOptTask<ManTask>::cancel(Space&home,Propagator&p,PropCondpc){ _m.cancel(home,p,Int::PC_BOOL_VAL); ManTask::cancel(home,p,pc); } }} //STATISTICS:int-var