optimize.hpp /usr/include/gecode/minimodel.hh Gecode Gecode::MiniModel /*-*-mode:C++;c-basic-offset:2;indent-tabs-mode:nil-*-*/ /* *Mainauthor: *ChristianSchulte<schulte@gecode.org> * *Copyright: *ChristianSchulte,2008 * *Lastmodified: *$Date:2013-04-0915:16:43+0200(Tue,09Apr2013)$by$Author:schulte$ *$Revision:13571$ * *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{namespaceMiniModel{ template<IntRelTypeirt> forceinline IntOptimizeSpace<irt>::IntOptimizeSpace(void){} template<IntRelTypeirt> forceinline IntOptimizeSpace<irt>::IntOptimizeSpace(boolshare,IntOptimizeSpace&s) :Space(share,s){} template<IntRelTypeirt> void IntOptimizeSpace<irt>::constrain(constSpace&_best){ constIntOptimizeSpace<irt>*best= dynamic_cast<constIntOptimizeSpace<irt>*>(&_best); if(best==NULL) throwDynamicCastFailed("IntOptimizeSpace::constrain"); rel(*this,cost(),irt,best->cost().val()); } #ifdefGECODE_HAS_FLOAT_VARS template<FloatRelTypefrt> forceinline FloatOptimizeSpace<frt>::FloatOptimizeSpace(void){} template<FloatRelTypefrt> forceinline FloatOptimizeSpace<frt>::FloatOptimizeSpace(boolshare, FloatOptimizeSpace&s) :Space(share,s){} template<FloatRelTypefrt> void FloatOptimizeSpace<frt>::constrain(constSpace&_best){ constFloatOptimizeSpace<frt>*best= dynamic_cast<constFloatOptimizeSpace<frt>*>(&_best); if(best==NULL) throwDynamicCastFailed("FloatOptimizeSpace::constrain"); rel(*this,cost(),frt,best->cost().val()); } #endif }} //STATISTICS:minimodel-search