From: Vladimir Prus (ghost_at_[hidden])
Date: 2002-01-25 11:01:05
David Abrahams wrote:
> > Thanks! This will do for my case. However, I feel like this is not very
> > direct way to accomplish the task. Further, it's less efficient as it
> > would
> > require examining vertex label once for each out-edge, not once for each
> > search. Okay, I agree that this might not be a problem in practice.
> Here's another thought:
> Just make sure the filtered_graph is specialized on a user-defined
> predicate type, then define an out_edges() function for this specialized
> graph which returns an empty range when the source vertex is labelled. The
> filtering predicate will never get used; it's just there to make sure you
> "own" the filtered_graph type.
It's not that simple. Since labels is not internal property (and it makes
little sense), I can't just specialize out_edges. I'd need to create a new
graph type which ctor will take labels, or I'll need to create a new type of
graph, which will have labels as internal property and make a copy of the
original. Hmm... that's too complicated... settled on simple filtered_graph
for now. Actually, I would be very good if I could add property maps to a
graph at runtime.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk