|
Boost Users : |
Subject: [Boost-users] [BGL] Filtered_graph edgepredicate
From: Line Blander Reinhardt (lbre_at_[hidden])
Date: 2010-04-26 07:32:21
Hi all
I need to make a filtered graph for each color.
I have a graph where the edges are assigned a color (there are many colours).
I want to make a filtered graph (for each colour) given a colour.
I am a little lost with the filtered graph and edge predicates and do not know how to make one with a colour and a colour-edge map.
In the examples I have found it is only the map that is needed in the edgepredicate.
I have made something like ...
template <typename Colour, typename EdgeColourMap >
struct same_edge_colour {
same_edge_colour(): t_colour(){ }
same_edge_colour(Colour a, EdgeColourMap m) : t_colour(a),m_colours(m){ }
template <typename Edge>
bool operator()(const Edge& e) const {
return boost::get(m_colours,e)==t_colour;
}
Tag t_colour;
EdgeAgentMap m_colours;
};
I am not able to make my filter and the filtered graph.
Can someone help me?? Tell me if you need more information.
Thanks
Line
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