view-val-graph.hh gecode/int.hh gecode/int/view-val-graph/comb-ptr-flag.hpp gecode/int/view-val-graph/bi-link.hpp gecode/int/view-val-graph/edge.hpp gecode/int/view-val-graph/node.hpp gecode/int/view-val-graph/iter-prune-val.hpp gecode/int/view-val-graph/graph.hpp /usr/include/gecode/int/distinct.hh /usr/include/gecode/int/nvalues.hh Gecode::Int::ViewValGraph::CombPtrFlag Gecode::Int::ViewValGraph::BiLink Gecode::Int::ViewValGraph::Edge Gecode::Int::ViewValGraph::Node Gecode::Int::ViewValGraph::ValNode Gecode::Int::ViewValGraph::ViewNode Gecode::Int::ViewValGraph::Edge Gecode::Int::ViewValGraph::IterPruneVal Gecode::Int::ViewValGraph::Graph Gecode::Int::ViewValGraph Gecode Gecode::Int /*-*-mode:C++;c-basic-offset:2;indent-tabs-mode:nil-*-*/ /* *Mainauthors: *ChristianSchulte<schulte@gecode.org> *GuidoTack<tack@gecode.org> * *Copyright: *ChristianSchulte,2002 *GuidoTack,2004 * *Lastmodified: *$Date:2011-09-0814:34:40+0200(Thu,08Sep2011)$by$Author:schulte$ *$Revision:12395$ * *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_VIEW_VAL_GRAPH_HH__ #define__GECODE_INT_VIEW_VAL_GRAPH_HH__ #include<gecode/int.hh> namespaceGecode{namespaceInt{namespaceViewValGraph{ template<classT> classCombPtrFlag{ private: ptrdiff_tcpf; public: CombPtrFlag(T*p1,T*p2); voidinit(T*p1,T*p2); T*ptr(T*p)const; intis_set(void)const; voidset(void); voidunset(void); }; classBiLink{ private: BiLink*_prev; BiLink*_next; public: BiLink(void); BiLink*prev(void)const; BiLink*next(void)const; voidprev(BiLink*l); voidnext(BiLink*l); voidadd(BiLink*l); voidunlink(void); voidmark(void); boolmarked(void)const; boolempty(void)const; }; template<classView>classEdge; template<classView> classNode:publicBiLink{ public: Edge<View>*iter; unsignedintlow,min,comp; Node(void); Edge<View>*edge_fst(void)const; Edge<View>*edge_lst(void)const; staticvoid*operatornew(size_t,Space&); staticvoidoperatordelete(void*,size_t); staticvoidoperatordelete(void*,Space&); }; template<classView> classValNode:publicNode<View>{ protected: constint_val; Edge<View>*_matching; ValNode<View>*_next_val; public: ValNode(intv); ValNode(intv,ValNode<View>*n); intval(void)const; voidmatching(Edge<View>*m); Edge<View>*matching(void)const; ValNode<View>**next_val_ref(void); ValNode<View>*next_val(void)const; voidnext_val(ValNode<View>*v); }; template<classView> classViewNode:publicNode<View>{ protected: unsignedint_size; View_view; Edge<View>*_val_edges; public: ViewNode(void); ViewNode(Viewx); Edge<View>*val_edges(void)const; Edge<View>**val_edges_ref(void); boolfake(void)const; Viewview(void)const; voidupdate(void); boolchanged(void)const; boolmatched(void)const; }; template<classView> classEdge:publicBiLink{ protected: Edge<View>*_next_edge; CombPtrFlag<Node<View>>sd; public: Edge(ValNode<View>*v,ViewNode<View>*x); Edge(ValNode<View>*v,ViewNode<View>*x,Edge<View>*n); Node<View>*dst(Node<View>*s)const; ViewNode<View>*view(ValNode<View>*v)const; ValNode<View>*val(ViewNode<View>*x)const; boolused(Node<View>*v)const; voiduse(void); voidfree(void); voidrevert(Node<View>*d); Edge<View>*next_edge(void)const; Edge<View>**next_edge_ref(void); Edge<View>*next(void)const; staticvoid*operatornew(size_t,Space&); staticvoidoperatordelete(void*,size_t); staticvoidoperatordelete(void*,Space&); }; template<classView> classIterPruneVal{ protected: ViewNode<View>*x; Edge<View>*e; public: IterPruneVal(ViewNode<View>*x); booloperator ()(void)const; voidoperator ++(void); intval(void)const; }; }}} #include<gecode/int/view-val-graph/comb-ptr-flag.hpp> #include<gecode/int/view-val-graph/bi-link.hpp> #include<gecode/int/view-val-graph/edge.hpp> #include<gecode/int/view-val-graph/node.hpp> #include<gecode/int/view-val-graph/iter-prune-val.hpp> namespaceGecode{namespaceInt{namespaceViewValGraph{ template<classView> classGraph{ protected: ViewNode<View>**view; ValNode<View>*val; intn_view; intn_val; unsignedintcount; typedefSupport::StaticStack<ViewNode<View>*,Region>ViewNodeStack; voidinit(Space&home,ViewNode<View>*x); boolmatch(ViewNodeStack&m,ViewNode<View>*x); voidscc(Space&home); public: Graph(void); boolinitialized(void)const; voidpurge(void); }; }}} #include<gecode/int/view-val-graph/graph.hpp> #endif //STATISTICS:int-prop