float.hpp /usr/include/gecode/float/view.hpp Gecode /*-*-mode:C++;c-basic-offset:2;indent-tabs-mode:nil-*-*/ /* *Mainauthors: *ChristianSchulte<schulte@gecode.org> *VincentBarichard<Vincent.Barichard@univ-angers.fr> * *Copyright: *ChristianSchulte,2002 *VincentBarichard,2012 * *Lastmodified: *$Date:2012-04-0613:04:47+0200(Fri,06Apr2012)$by$Author:schulte$ *$Revision:12711$ * *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{ forceinlinevoid FloatVar::_init(Space&home,FloatNummin,FloatNummax){ x=new(home)Float::FloatVarImp(home,FloatVal(min,max)); } forceinline FloatVar::FloatVar(void){} forceinline FloatVar::FloatVar(constFloatVar&y) :VarImpVar<Float::FloatVarImp>(y.varimp()){} forceinline FloatVar::FloatVar(constFloat::FloatView&y) :VarImpVar<Float::FloatVarImp>(y.varimp()){} forceinlineFloatVal FloatVar::val(void)const{ if(!x->assigned()) throwFloat::ValOfUnassignedVar("FloatVar::val"); returnx->val(); } forceinlineFloatNum FloatVar::min(void)const{ returnx->min(); } forceinlineFloatNum FloatVar::med(void)const{ returnx->med(); } forceinlineFloatNum FloatVar::max(void)const{ returnx->max(); } forceinlineFloatVal FloatVar::domain(void)const{ returnx->domain(); } forceinlineFloatNum FloatVar::size(void)const{ returnx->size(); } forceinlinebool FloatVar::in(constFloatVal&n)const{ returnx->in(n); } } //STATISTICS:float-var