int-rel.hpp /usr/include/gecode/minimodel.hh Gecode /*-*-mode:C++;c-basic-offset:2;indent-tabs-mode:nil-*-*/ /* *Mainauthors: *ChristianSchulte<schulte@gecode.org> * *Copyright: *ChristianSchulte,2005 * *Lastmodified: *$Date:2013-01-2213:48:12+0100(Tue,22Jan2013)$by$Author:schulte$ *$Revision:13227$ * *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{ /* *Operationsforlinearexpressions * */ forceinline LinIntRel::LinIntRel(void){} forceinline LinIntRel::LinIntRel(constLinIntExpr&l,IntRelTypeirt0,constLinIntExpr&r) :e(l-r),irt(irt0){} forceinline LinIntRel::LinIntRel(constLinIntExpr&l,IntRelTypeirt0,intr) :e(l-r),irt(irt0){} forceinline LinIntRel::LinIntRel(intl,IntRelTypeirt0,constLinIntExpr&r) :e(l-r),irt(irt0){} forceinlineIntRelType LinIntRel::neg(IntRelTypeirt){ switch(irt){ caseIRT_EQ:returnIRT_NQ; caseIRT_NQ:returnIRT_EQ; caseIRT_LQ:returnIRT_GR; caseIRT_LE:returnIRT_GQ; caseIRT_GQ:returnIRT_LE; caseIRT_GR:returnIRT_LQ; default:GECODE_NEVER; } returnIRT_LQ; } forceinlinevoid LinIntRel::post(Homehome,boolt,IntConLevelicl)const{ e.post(home,t?irt:neg(irt),icl); } forceinlinevoid LinIntRel::post(Homehome,constBoolVar&b,boolt,IntConLevelicl)const{ e.post(home,t?irt:neg(irt),b,icl); } } //STATISTICS:minimodel-any