| 326 | */ |
| 327 | template<typename Graph, typename OutputIt, typename Pred> |
| 328 | OutputIt |
| 329 | removeIslands_if(Graph& g, OutputIt result, Pred p) |
| 330 | { |
| 331 | typedef typename graph_traits<Graph>::vertex_iterator Uit; |
| 332 | typedef typename graph_traits<Graph>::vertex_descriptor V; |
| 333 | |
| 334 | /** Identify and remove Islands. */ |
| 335 | std::pair<Uit, Uit> urange = vertices(g); |
| 336 | for (Uit uit = urange.first; uit != urange.second; ++uit) { |
| 337 | V u = *uit; |
| 338 | if (get(vertex_removed, g, u)) |
| 339 | continue; |
| 340 | if (p(u) && in_degree(u, g) == 0 && out_degree(u, g) == 0) { |
| 341 | *result++ = get(vertex_contig_index, g, u); |
| 342 | clear_vertex(u, g); |
| 343 | remove_vertex(u, g); |
| 344 | } |
| 345 | } |
| 346 | return result; |
| 347 | } |
| 348 | |
| 349 | /** Add missing complementary edges. */ |
| 350 | template<typename DG> |
no test coverage detected