|
Boost Users : |
Subject: [Boost-users] Function pointer to in/out_degree in BGL
From: langermatze (langer.matze_at_[hidden])
Date: 2010-10-26 13:11:32
Hi,
I have a question regarding the boost graph library. I'd like to write a set
of depth first search visitors to determine the maximum in/out-degree of a
graph. The code should look pretty similar for both cases except for the
function call to get the property of the visited node.
boost:in_degree(node_id, graph) vs. boost:out_degree(vertexId, graph)
At first glance the function signature pretty much the same, maybe:
template<class Graph>
graph_traits<Graph>::degree_size_type
function(graph_traits<Graph>::vertex_descriptor u, const Graph &g)
When looking at the BGL headers however, things seem to be a bit more
complex, though.
I tried to implement a generic dfs_visitor taking a general function pointer
to get the in/out degree property of the visited node but I couldn't work
out the type of the function pointer to be passed. All my attemtps failed
badly. Hopefully, there is anybody on this list who has a better
understanding of this business and could provide some help. Any
hints/comments are appreciated!
Thank you so much,
Matthias
-- View this message in context: http://boost.2283326.n4.nabble.com/Function-pointer-to-in-out-degree-in-BGL-tp3014116p3014116.html Sent from the Boost - Users mailing list archive at Nabble.com.
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