Boost logo

Boost Users :

Subject: Re: [Boost-users] BGL - accessing component subgraphs.
From: Adam Spargo (aws_at_[hidden])
Date: 2010-07-16 06:53:53


> I don't see why you can't just pass get(vertex_component, g) as the component
> map in connected_components()

Yes, that works, code attached. I've also changed to using pointers for my
graph and filtered graph so that I can use new and delete. In my real code
I have a StringGraph class with Graph and FilteredGraph member pointers.
I'm assuming that I should free any memory associated with FilteredGraph,
before I allocate a new one, as I could have many many components. Also I
will want to deallocate the memory for the whole Graph before the program
finishes as I need to use it for something else. So is delete the best
way? Does the destructor for Graph/FilteredGraph actually release all the
memory? I don't see any other clean-up functions in the documentation.

> Look at boost::keep_all (in filtered_graph.hpp); that can be used to keep all
> of a certain kind of entity.

It's seems to me that these filters are only actually called when
you ask for vertices or edges of the FilteredGraph. That being true I
guess I would need both function objects?

Thanks again for your help,

Adam.

-- 
 The Wellcome Trust Sanger Institute is operated by Genome Research 
 Limited, a charity registered in England with number 1021457 and a 
 company registered in England with number 2742969, whose registered 
 office is 215 Euston Road, London, NW1 2BE. 



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