|
Boost Users : |
From: Olivier Tournaire (olitour_at_[hidden])
Date: 2007-11-13 14:13:48
Thank you, this is perfect
2007/11/13, Jeffrey Holle <jeffreyholle_at_[hidden]>:
>
> Olivier Tournaire wrote:
>
> > Any help would be appreciate.
>
> This is the function that I came up with to erase a graph.
>
> /*
> * Note the use of the reverse_iterator
> */
> template<typename T1> void
> EraseGraph(T1& g)
> {
> typedef typename std::vector<typename
> boost::graph_traits<T1>::vertex_descriptor> Vertices;
> Vertices vertices;
> typename boost::graph_traits<T1>::vertex_iterator vi,vi_end;
> for (boost::tie(vi,vi_end)=boost::vertices(g);vi!=vi_end;++vi)
> vertices.push_back(*vi);
> for (typename Vertices::reverse_iterator
> iter=vertices.rbegin();iter!=vertices.rend();++iter) {
> boost::clear_vertex(*iter,g);
> boost::remove_vertex(*iter,g);
> }
> }
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
-- Le temps des cerises reviendra. Dans l'immédiat, c'est le temps des noyaux. Courage.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net