diff --git a/src/graph/graph_util.hh b/src/graph/graph_util.hh index 4eb7aa22ccf9fd57e6749f20e96d4e2991fe6ba6..def52bebe7eaea971cab6b7dd58806839fbe992a 100644 --- a/src/graph/graph_util.hh +++ b/src/graph/graph_util.hh @@ -192,6 +192,18 @@ void remove_edge(typename graph_traits return remove_edge(e,const_cast(g.m_g)); } +//============================================================================== +//remove_edge(e, reverse_graph) +//============================================================================== +template +inline +void remove_edge +(typename graph_traits >::edge_descriptor e, + reverse_graph& g) +{ + return remove_edge(e,const_cast(g.m_g)); +} + //============================================================================== // add_vertex(filtered_graph) //============================================================================== diff --git a/src/graph/graph_wrap.hh b/src/graph/graph_wrap.hh index a44aa7377d210b7643f987865765289a2778e966..ad197f205646413d340400086ba0f84bb241f90a 100644 --- a/src/graph/graph_wrap.hh +++ b/src/graph/graph_wrap.hh @@ -40,6 +40,9 @@ class GraphWrap typedef typename Graph::graph_tag graph_tag; typedef Graph orig_graph_t; + typedef typename graph_traits::vertex_descriptor vertex_descriptor; + typedef typename graph_traits::edge_descriptor edge_descriptor; + Graph& _g; GraphInterface& _gi; }; @@ -53,6 +56,10 @@ GraphWrap graph_wrap(Graph& g, GraphInterface& gi) template struct graph_traits >: public graph_traits {}; +template +struct graph_traits >: + public graph_traits {}; + template inline typename graph_traits >::vertex_descriptor source(typename graph_traits >::edge_descriptor e, @@ -165,7 +172,7 @@ inline std::pair >::edge_descriptor, bool> add_edge(typename graph_traits >::vertex_descriptor u, typename graph_traits >::vertex_descriptor v, - GraphWrap& g) + GraphWrap g) { std::pair >::edge_descriptor, bool> retval = add_edge(u, v, g._g); @@ -176,7 +183,7 @@ add_edge(typename graph_traits >::vertex_descriptor u, template inline void remove_edge (typename graph_traits >::edge_descriptor e, - GraphWrap& g) + GraphWrap g) { g._gi.RemoveEdgeIndex(e); } @@ -185,7 +192,7 @@ template inline void remove_edge (typename graph_traits >::vertex_descriptor u, typename graph_traits >::vertex_descriptor v, - Graph& g) + GraphWrap g) { vector >::edge_descriptor> removed_edges; @@ -202,7 +209,7 @@ inline void remove_edge template inline typename graph_traits >::vertex_descriptor -add_vertex(GraphWrap& g) +add_vertex(GraphWrap g) { return add_vertex(g._g); } @@ -210,7 +217,7 @@ add_vertex(GraphWrap& g) template inline void clear_vertex (typename graph_traits >::vertex_descriptor u, - GraphWrap& g) + GraphWrap g) { typedef GraphWrap graph_t; vector::edge_descriptor> del_es; @@ -231,7 +238,7 @@ inline void clear_vertex template inline void remove_vertex (typename graph_traits >::vertex_descriptor u, - GraphWrap& g) + GraphWrap g) { clear_vertex(u, g); remove_vertex(u, g._g); @@ -241,7 +248,7 @@ template inline void remove_out_edge_if (typename graph_traits >::vertex_descriptor u, - Predicate predicate, Graph& g) + Predicate predicate, GraphWrap g) { vector >::edge_descriptor> removed_edges;