Boost logo

Boost Users :

Subject: Re: [Boost-users] [BGL] Finding the descriptor for a given vertex
From: Anders Wallin (anders.e.e.wallin_at_[hidden])
Date: 2011-12-30 05:27:54


> The intent of this adapter class is to basically abstract out all the
> mentions of stuff like the descriptors and such.  So a good helper function
> to this end would be a function that retrieves the VertexDescriptor for a
> given T, if it exists.  Is there such a function already in the BGL, or do I
> have to manage that separately (ie. having an external map)?

I don't think BGL has anything ready-made for this, so you probably
need to have a map from T to VertexDescriptor as a member of your
Graph.

As a comment to this: when I write algorithms that do a lot of
modifications to a graph, a common reason for a segfault is accessing
the
bundled property (either vertex or edge) of a BGL-graph with an
illegal vertex/edge-descriptor. It would be useful if in debug-mode,
or perhaps
a special "safe"-mode BGL would guard against this segfault and
produce an assert() on g[illegal_descriptor]

AW


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