| 54 | /** Add the outgoing edges of vertex u to vertex uout. */ |
| 55 | template<typename Graph> |
| 56 | void |
| 57 | copy_out_edges( |
| 58 | Graph& g, |
| 59 | typename Graph::vertex_descriptor u, |
| 60 | typename Graph::vertex_descriptor uout) |
| 61 | { |
| 62 | typedef typename graph_traits<Graph>::vertex_descriptor vertex_descriptor; |
| 63 | typedef typename graph_traits<Graph>::out_edge_iterator out_edge_iterator; |
| 64 | typedef typename edge_property<Graph>::type edge_property_type; |
| 65 | assert(u != uout); |
| 66 | std::pair<out_edge_iterator, out_edge_iterator> edges = g.out_edges(u); |
| 67 | bool palindrome = false; |
| 68 | edge_property_type palindrome_ep; |
| 69 | for (out_edge_iterator e = edges.first; e != edges.second; ++e) { |
| 70 | vertex_descriptor v = target(*e, g); |
| 71 | vertex_descriptor vc = get(vertex_complement, g, v); |
| 72 | if (vc == u) { |
| 73 | // When ~v == u, adding the edge (~v,~u), which is (u,~u), |
| 74 | // would invalidate our iterator. Add the edge after this |
| 75 | // loop completes. |
| 76 | palindrome = true; |
| 77 | palindrome_ep = g[*e]; |
| 78 | } else |
| 79 | g.add_edge(uout, v, g[*e]); |
| 80 | } |
| 81 | if (palindrome) { |
| 82 | vertex_descriptor uc = get(vertex_complement, g, u); |
| 83 | vertex_descriptor uoutc = get(vertex_complement, g, uout); |
| 84 | g.add_edge(uout, uc, palindrome_ep); |
| 85 | g.add_edge(uout, uoutc, palindrome_ep); |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | /** Add the incoming edges of vertex u to vertex v. */ |
| 90 | template<typename Graph> |
no test coverage detected