element.hh gecode/int.hh gecode/int/rel.hh gecode/int/element/int.hpp gecode/int/element/view.hpp gecode/int/element/pair.hpp /usr/include/gecode/set/element.hh Gecode::Int::Element::Int Gecode::Int::Element::Int::IdxVal Gecode::Int::Element::Int::IterIdxUnmark Gecode::Int::Element::Int::IterVal Gecode::Int::Element::Int::IterValUnmark Gecode::Int::Element::Int::ByVal Gecode::Int::Element::IdxView Gecode::Int::Element::ViewToVarArg Gecode::Int::Element::IdxViewArray Gecode::Int::Element::View Gecode::Int::Element::ViewBnd Gecode::Int::Element::ViewDom Gecode::Int::Element::Pair Gecode::Int::Element Gecode Gecode::Int /*-*-mode:C++;c-basic-offset:2;indent-tabs-mode:nil-*-*/ /* *Mainauthors: *ChristianSchulte<schulte@gecode.org> *GuidoTack<tack@gecode.org> * *Copyright: *ChristianSchulte,2004 *GuidoTack,2004 * *Lastmodified: *$Date:2010-05-0318:31:57+0200(Mon,03May2010)$by$Author:schulte$ *$Revision:10846$ * *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_ELEMENT_HH__ #define__GECODE_INT_ELEMENT_HH__ #include<gecode/int.hh> #include<gecode/int/rel.hh> namespaceGecode{namespaceInt{namespaceElement{ template<classV0,classV1,classIdx,classVal> classInt:publicPropagator{ protected: classIdxVal{ public: Idxidx_next; Idxval_next; Idxidx; Valval; voidmark(void); boolmarked(void)const; }; classIterIdxUnmark{ private: IdxVal*iv; Idxi; public: IterIdxUnmark(IdxVal*iv); booloperator ()(void)const; voidoperator ++(void); Idxval(void)const; }; classIterVal{ private: IdxVal*iv; Idxi; public: IterVal(IdxVal*iv); booloperator ()(void)const; voidoperator ++(void); Valval(void)const; }; classIterValUnmark{ private: IdxVal*iv; Idxi; public: IterValUnmark(IdxVal*iv); booloperator ()(void)const; voidoperator ++(void); Valval(void)const; }; classByVal{ protected: constIdxVal*iv; public: ByVal(constIdxVal*iv); booloperator ()(Idx&i,Idx&j); }; V0x0; typedeftypenameGecode::Support::IntTypeTraits<Idx>::utypeIdxSize; IdxSizes0; V1x1; typedeftypenameGecode::Support::IntTypeTraits<Val>::utypeValSize; ValSizes1; IntSharedArrayc; IdxVal*iv; voidprune_idx(void); voidprune_val(void); staticExecStatusassigned_val(Space&home,IntSharedArray&c, V0x0,V1x1); Int(Space&home,boolshared,Int&p); Int(Homehome,IntSharedArray&i,V0x0,V1x1); public: virtualActor*copy(Space&home,boolshare); virtualPropCostcost(constSpace&home,constModEventDelta&med)const; virtualExecStatuspropagate(Space&home,constModEventDelta&med); staticExecStatuspost(Homehome,IntSharedArray&i,V0x0,V1x1); virtualsize_tdispose(Space&home); }; template<classV0,classV1> ExecStatuspost_int(Homehome,IntSharedArray&c,V0x0,V1x1); template<classViewB>classIdxView; template<classView> classViewToVarArg{}; template<classView> classIdxViewArray{ private: IdxView<View>*xs; intn; public: IdxViewArray(void); IdxViewArray(constIdxViewArray<View>&); IdxViewArray(Space&home,consttypenameViewToVarArg<View>::argtype&x); IdxViewArray(Space&home,intn); intsize(void)const; voidsize(intn); IdxView<View>&operator [](intn); constIdxView<View>&operator [](int)const; voidsubscribe(Space&home,Propagator&p,PropCondpc,boolprocess=true); voidcancel(Space&home,Propagator&p,PropCondpc); voidupdate(Space&home,boolshare,IdxViewArray<View>&x); }; template<classVA,classVB,classVC,PropCondpc_ac> classView:publicPropagator{ protected: IdxViewArray<VA>iv; VBx0; VCx1; View(Space&home,boolshare,View&p); View(Homehome,IdxViewArray<VA>&iv,VBx0,VCx1); public: //Costfunction(definedaslowlinear) virtualPropCostcost(constSpace&home,constModEventDelta&med)const; virtualsize_tdispose(Space&home); }; template<classVA,classVB,classVC> classViewBnd:publicView<VA,VB,VC,PC_INT_BND>{ protected: usingView<VA,VB,VC,PC_INT_BND>::iv; usingView<VA,VB,VC,PC_INT_BND>::x0; usingView<VA,VB,VC,PC_INT_BND>::x1; ViewBnd(Space&home,boolshare,ViewBnd&p); ViewBnd(Homehome,IdxViewArray<VA>&iv,VBx0,VCx1); public: virtualActor*copy(Space&home,boolshare); virtualExecStatuspropagate(Space&home,constModEventDelta&med); staticExecStatuspost(Homehome,IdxViewArray<VA>&iv,VBx0,VCx1); }; template<classVA,classVB,classVC> classViewDom:publicView<VA,VB,VC,PC_INT_DOM>{ protected: usingView<VA,VB,VC,PC_INT_DOM>::iv; usingView<VA,VB,VC,PC_INT_DOM>::x0; usingView<VA,VB,VC,PC_INT_DOM>::x1; ViewDom(Space&home,boolshare,ViewDom&p); ViewDom(Homehome,IdxViewArray<VA>&iv,VBx0,VCx1); public: virtualActor*copy(Space&home,boolshare); virtualPropCostcost(constSpace&home,constModEventDelta&med)const; virtualExecStatuspropagate(Space&home,constModEventDelta&med); staticExecStatuspost(Homehome,IdxViewArray<VA>&iv, VBx0,VCx1); }; classGECODE_VTABLE_EXPORTPair :publicTernaryPropagator<IntView,PC_INT_DOM>{ protected: usingTernaryPropagator<IntView,PC_INT_DOM>::x0; usingTernaryPropagator<IntView,PC_INT_DOM>::x1; usingTernaryPropagator<IntView,PC_INT_DOM>::x2; intw; Pair(Space&home,boolshare,Pair&p); public: Pair(Homehome,IntViewx0,IntViewx1,IntViewx2,intw); staticExecStatuspost(Homehome,IntViewx0,IntViewx1,IntViewx2, intw,inth); GECODE_INT_EXPORTvirtualActor*copy(Space&home,boolshare); GECODE_INT_EXPORTvirtualExecStatuspropagate(Space&home,constModEventDelta&med); }; }}} #include<gecode/int/element/int.hpp> #include<gecode/int/element/view.hpp> #include<gecode/int/element/pair.hpp> #endif //STATISTICS:int-prop