Boost logo

Boost Users :

From: Stephan Diederich (S.Diederich_at_[hidden])
Date: 2006-09-06 12:13:30


2006/9/6, moritz Hilger <moritz.hilger_at_[hidden]>:
> On 9/5/06, Stephan Diederich <S.Diederich_at_[hidden] > wrote:
> > Hi Moritz,
> >
> > 2006/9/5, moritz Hilger <moritz.hilger_at_[hidden]>:
> > - Zitierten Text anzeigen -
> > > is there a particular reason that the filtered graph is missing a
> > > vertex_descriptor vertex(vertices_size_type, const& filtered_graph)
> > > function? of course this would return exactly the same as the one of the
> > > underlying graph, nevertheless it would be handy for code treating
> filtered
> > > graphs the same way as normal ones.
> >
> > I think the problem here is the return value of the function. If you
> > have a VertexPredicate set, it would be possible that the vertex you
> > specify through the index doesn't exist in the filtered graph.
> > Maybe a null_vertex() could be returned in that case (But, IIRC, that
> > null_vertex() doesn't exist in every graph).
>
>
> hmm, the null_vertex() function is part of the graph concept
> (http://www.boost.org/libs/graph/doc/Graph.html) and
> should return "a special
> boost::graph_traits<G>::vertex_descriptor object which does
> not refer to any vertex of graph object which type is G." so why not return
> this if the VertexPredicate excludes the requested vertex?

Yes, I'd vote for that, too.
But after that, you have to check each vertex(vertices_size_type,
const& filtered_graph) call for a returned null_vertex which you
normally don't want to do if you have a "proper" graph.
But at least it makes it a bit nicer to work with a filtered graph.

Cheers,
Stephan


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