ranges-minus.hpp /usr/include/gecode/iter.hh Gecode::Iter::Ranges::Minus Gecode Gecode::Iter Gecode::Iter::Ranges /*-*-mode:C++;c-basic-offset:2;indent-tabs-mode:nil-*-*/ /* *Mainauthors: *ChristianSchulte<schulte@gecode.org> * *Copyright: *ChristianSchulte,2004 * *Lastmodified: *$Date:2012-09-0717:42:21+0200(Fri,07Sep2012)$by$Author:schulte$ *$Revision:13069$ * *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{namespaceIter{namespaceRanges{ classMinus:publicRangeListIter{ public: Minus(void); Minus(constMinus&m); template<classI> Minus(Region&r,I&i); template<classI> voidinit(Region&r,I&i); Minus&operator =(constMinus&m); }; forceinline Minus::Minus(void){} forceinline Minus::Minus(constMinus&m) :RangeListIter(m){} template<classI> void Minus::init(Region&r,I&i){ RangeListIter::init(r); RangeList*p=NULL; for(;i();++i){ RangeList*t=new(*rlio)RangeList; t->next=p; t->min=-i.max(); t->max=-i.min(); p=t; } RangeListIter::set(p); } template<classI> forceinline Minus::Minus(Region&r,I&i){ init(r,i); } forceinlineMinus& Minus::operator =(constMinus&m){ returnstatic_cast<Minus&>(RangeListIter::operator =(m)); } }}} //STATISTICS:iter-any