values-minus.hpp /usr/include/gecode/iter.hh Gecode::Iter::Values::Minus Gecode Gecode::Iter Gecode::Iter::Values /*-*-mode:C++;c-basic-offset:2;indent-tabs-mode:nil-*-*/ /* *Mainauthors: *ChristianSchulte<schulte@gecode.org> * *Copyright: *ChristianSchulte,2007 * *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{namespaceValues{ classMinus:publicValueListIter{ 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) :ValueListIter(m){} template<classI> void Minus::init(Region&r,I&i){ ValueListIter::init(r); ValueList*p=NULL; for(;i();++i){ ValueList*t=new(*vlio)ValueList; t->next=p; t->val=-i.val(); p=t; } ValueListIter::set(p); } template<classI> forceinline Minus::Minus(Region&r,I&i){ init(r,i); } forceinlineMinus& Minus::operator =(constMinus&m){ returnstatic_cast<Minus&>(ValueListIter::operator =(m)); } }}} //STATISTICS:iter-any