diff --git a/lemon/euler.h b/lemon/euler.h --- a/lemon/euler.h +++ b/lemon/euler.h @@ -54,29 +54,29 @@ ///\endcode ///If \c g is not Euler then the resulted tour will not be full or closed. ///\sa EulerIt - template + template class DiEulerIt { - typedef typename Digraph::Node Node; - typedef typename Digraph::NodeIt NodeIt; - typedef typename Digraph::Arc Arc; - typedef typename Digraph::ArcIt ArcIt; - typedef typename Digraph::OutArcIt OutArcIt; - typedef typename Digraph::InArcIt InArcIt; + typedef typename GR::Node Node; + typedef typename GR::NodeIt NodeIt; + typedef typename GR::Arc Arc; + typedef typename GR::ArcIt ArcIt; + typedef typename GR::OutArcIt OutArcIt; + typedef typename GR::InArcIt InArcIt; - const Digraph &g; - typename Digraph::template NodeMap nedge; + const GR &g; + typename GR::template NodeMap nedge; std::list euler; public: ///Constructor - ///\param _g A digraph. + ///\param gr A digraph. ///\param start The starting point of the tour. If it is not given /// the tour will start from the first node. - DiEulerIt(const Digraph &_g,typename Digraph::Node start=INVALID) - : g(_g), nedge(g) + DiEulerIt(const GR &gr, typename GR::Node start = INVALID) + : g(gr), nedge(g) { if(start==INVALID) start=NodeIt(g); for(NodeIt n(g);n!=INVALID;++n) nedge[n]=OutArcIt(g,n); @@ -145,31 +145,31 @@ /// ///If \c g is not Euler then the resulted tour will not be full or closed. ///\sa EulerIt - template + template class EulerIt { - typedef typename Digraph::Node Node; - typedef typename Digraph::NodeIt NodeIt; - typedef typename Digraph::Arc Arc; - typedef typename Digraph::Edge Edge; - typedef typename Digraph::ArcIt ArcIt; - typedef typename Digraph::OutArcIt OutArcIt; - typedef typename Digraph::InArcIt InArcIt; + typedef typename GR::Node Node; + typedef typename GR::NodeIt NodeIt; + typedef typename GR::Arc Arc; + typedef typename GR::Edge Edge; + typedef typename GR::ArcIt ArcIt; + typedef typename GR::OutArcIt OutArcIt; + typedef typename GR::InArcIt InArcIt; - const Digraph &g; - typename Digraph::template NodeMap nedge; - typename Digraph::template EdgeMap visited; + const GR &g; + typename GR::template NodeMap nedge; + typename GR::template EdgeMap visited; std::list euler; public: ///Constructor - ///\param _g An graph. + ///\param gr An graph. ///\param start The starting point of the tour. If it is not given /// the tour will start from the first node. - EulerIt(const Digraph &_g,typename Digraph::Node start=INVALID) - : g(_g), nedge(g), visited(g,false) + EulerIt(const GR &gr, typename GR::Node start = INVALID) + : g(gr), nedge(g), visited(g, false) { if(start==INVALID) start=NodeIt(g); for(NodeIt n(g);n!=INVALID;++n) nedge[n]=OutArcIt(g,n); @@ -238,25 +238,25 @@ ///and only if it is connected and the number of incident arcs is even ///for each node. Therefore, there are digraphs which are not Eulerian, ///but still have an Euler tour. - template + template #ifdef DOXYGEN bool #else - typename enable_if,bool>::type - eulerian(const Digraph &g) + typename enable_if,bool>::type + eulerian(const GR &g) { - for(typename Digraph::NodeIt n(g);n!=INVALID;++n) + for(typename GR::NodeIt n(g);n!=INVALID;++n) if(countIncEdges(g,n)%2) return false; return connected(g); } - template - typename disable_if,bool>::type + template + typename disable_if,bool>::type #endif - eulerian(const Digraph &g) + eulerian(const GR &g) { - for(typename Digraph::NodeIt n(g);n!=INVALID;++n) + for(typename GR::NodeIt n(g);n!=INVALID;++n) if(countInArcs(g,n)!=countOutArcs(g,n)) return false; - return connected(Undirector(g)); + return connected(Undirector(g)); } }