bin-packing.hh gecode/int.hh gecode/int/bin-packing/propagate.hpp Gecode::Int::BinPacking::Item Gecode::Int::BinPacking::SizeSet Gecode::Int::BinPacking::SizeSetMinusOne Gecode::Int::BinPacking::Pack Gecode::Int::BinPacking Gecode Gecode::Int /*-*-mode:C++;c-basic-offset:2;indent-tabs-mode:nil-*-*/ /* *Mainauthors: *ChristianSchulte<schulte@gecode.org> * *Copyright: *ChristianSchulte,2010 * *Lastmodified: *$Date:2010-10-0623:20:35+0200(Wed,06Oct2010)$by$Author:schulte$ *$Revision:11468$ * *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. * */ #ifndef__GECODE_INT_BIN_PACKING_HH__ #define__GECODE_INT_BIN_PACKING_HH__ #include<gecode/int.hh> namespaceGecode{namespaceInt{namespaceBinPacking{ classItem:publicDerivedView<IntView>{ protected: usingDerivedView<IntView>::x; ints; public: Item(void); Item(IntViewb,ints); IntViewbin(void)const; voidbin(IntViewb); intsize(void)const; voidsize(ints); voidupdate(Space&home,boolshare,Item&i); }; boolsame(constItem&i,constItem&j); boolbefore(constItem&i,constItem&j); booloperator <(constItem&i,constItem&j); classSizeSet{ protected: intn; intt; int*s; public: SizeSet(void); SizeSet(Region&region,intn_max); voidadd(ints); intcard(void)const; inttotal(void)const; intoperator [](inti)const; }; classSizeSetMinusOne:publicSizeSet{ protected: intp; public: SizeSetMinusOne(void); SizeSetMinusOne(Region&region,intn); voidminus(ints); intcard(void)const; inttotal(void)const; intoperator [](inti)const; }; classPack:publicPropagator{ protected: ViewArray<OffsetView>l; ViewArray<Item>bs; intt; Pack(Homehome,ViewArray<OffsetView>&l,ViewArray<Item>&bs); Pack(Space&home,boolshare,Pack&p); public: GECODE_INT_EXPORT staticExecStatuspost(Homehome, ViewArray<OffsetView>&l,ViewArray<Item>&bs); template<classSizeSet> boolnosum(constSizeSet&s,inta,intb,int&ap,int&bp); template<classSizeSet> boolnosum(constSizeSet&s,inta,intb); GECODE_INT_EXPORT virtualExecStatuspropagate(Space&home,constModEventDelta&med); GECODE_INT_EXPORT virtualPropCostcost(constSpace&home,constModEventDelta&med)const; GECODE_INT_EXPORT virtualActor*copy(Space&home,boolshare); virtualsize_tdispose(Space&home); }; }}} #include<gecode/int/bin-packing/propagate.hpp> #endif //STATISTICS:int-prop