Boost logo

Boost Users :

Subject: [Boost-users] [BGL] What is filtered_graph really doing?
From: Lindley M French (lfrench1_at_[hidden])
Date: 2009-06-08 14:22:17


My edge properties struct has a bool "on" member. At times I may want to change whether an edge is on or not, and then I want to generate filtered_graphs that contain only the on or off edges for use with BGL algorithms.

However, it doesn't seem to be working. If I do:

func(Graph &G)
{
   filtered_graph<Graph> F1(G,OnEdges(G));
   // iterate over the edges of F1 and print them out
   
   // Now iterate over the edges of G and turn some of them off, printing out which ones

   filtered_graph<Graph> F2(G,OnEdges(G));
   // iterator over the edges of F2 and print them out
}

then I end up getting the exact same set of edges from F1 and F2! F2 even shows the edges I turned off in between.

What exactly is filtered_graph doing that this is possible?

Related question: If I have a filtered_graph of on edges, and I turn one of them off *through* it, what happens?


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