|
Boost Users : |
Subject: [Boost-users] [BGL] passing a graph from one function to another
From: r89 (r8921025_at_[hidden])
Date: 2008-11-19 10:54:27
Hi all,
I have a graph defined as follows (the same as in the Dijkstra shortest path
example code):
typedef adjacency_list < listS, vecS, directedS, no_property, property <
edge_weight_t, float > > graph_t;
The following works fine:
graph_t myGraph(array, edge_array + num_arcs, weights, num_nodes);
However, now I want to do the above line inside a function (say, fun_A), and
I want another function (say, fun_B) to have access to "myGraph".
How should I do that? I wish I could do something like this:
graph_t myGraph;
fun_A(graph_t &myGraph) {
myGraph(array, edge_array + num_arcs, weights, num_nodes);
}
fun_B(graph_t &myGraph) {
// using myGraph to run some graph algorithm...
}
but it doesn't work. Any suggestions?
Thanks!
-- View this message in context: http://www.nabble.com/-BGL--passing-a-graph-from-one-function-to-another-tp20582781p20582781.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