Boost logo

Boost Users :

Subject: Re: [Boost-users] [BGL] - filtered_graph EdgePredicate performance
From: Andrew Sutton (andrew.n.sutton_at_[hidden])
Date: 2009-01-21 20:52:10


Sorry, I meant to respond sooner, but lost track of time....

Is there a different, preferred way of writing EdgePredicates?
>

No. The BGL follows the style of the STL for passing predicates, which
always passes by value. When the algorithm is decomposed into a bunch of
functions, it has to copy the predicate (but those copies are generally
optimized away).

The trick, as seem to have you've discovered on your own, is to build your
predicate over references (or pointers) to any objects external to the
predicate.

> Is there a way to get target/source from an edge_descriptor without
> the graph instance?
>

Not safely, but if you're keeping a reference to a graph, you won't need to.

Andrew Sutton
andrew.n.sutton_at_[hidden]



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