[BGL] filtered_graph and null_vertex()
Hello.
Is the function graph_traits<G>::null_vertex() defined for G =
filtered_graph? When I try to compile the following simple program:
--------------------------------------------------------------
#include
Hi Tiago,
int main() { typedef adjacency_list<vecS> graph_t; typedef filtered_graph
f_graph_t; graph_traits ::vertex_descriptor v = graph_traits ::null_vertex(); return 0; } ..... Shouldn't null_vertex() just be defined to return the null_vertex() for the underlying graph, since the vertex descriptors are the same? Do I miss something?
Yes, null_vertex should be defined. I've just committed the attached patch to CVS, and your test program now compiles. You can either grab the current CVS version (CVS trunk), or apply the patch to 1.33 sources. Thanks, Volodya
On Mon, 2005-08-15 at 10:14 +0400, Vladimir Prus wrote:
Yes, null_vertex should be defined. I've just committed the attached patch to CVS, and your test program now compiles. You can either grab the current CVS version (CVS trunk), or apply the patch to 1.33 sources.
Thanks a lot!
I have one more problem with filtered_graph, but this time it has to do
with bundled properties. If I try to compile the following program:
--------------------------------------------------------------
#include
On Aug 15, 2005, at 3:58 PM, Tiago de Paula Peixoto wrote:
I have one more problem with filtered_graph, but this time it has to do with bundled properties. If I try to compile the following program:
-------------------------------------------------------------- #include
#include using namespace boost;
struct VertexProperties { int answer; };
int main() { typedef adjacency_list
graph_t; typedef filtered_graph f_graph_t; graph_t g; f_graph_t fg(g, keep_all()); graph_traits ::vertex_descriptor v = add_vertex(g); fg[v].answer = 42; return 0; } -------------------------------------------------------------- I get the following error with boost 1.33 and GCC 4.0.1: [snip] This was supposed to work right? The error is pretty clear, but I don't know what "local_to_global" is supposed to do, and where it should be.
Yes, it should have worked.
I made the attached modifications to a local version of filtered_graph.hpp, and the code above compiles, but I don't think that they are right at all, since I changed the constness of the internal reference to the original graph.
I think we're better off using const_cast instead of changing the stored reference. I've fixed the problem in CVS and the fix will be part of the upcoming 1.33.1 release. Thanks for reporting the bug! Doug
participants (3)
-
Doug Gregor
-
Tiago de Paula Peixoto
-
Vladimir Prus