
Andrew Sutton-2 wrote:
I do have graph typedef as a global. The original problem was, I am not allowed to define graph_t myGraph; without all the arguments like this: graph_t myGraph(array, edge_array + num_arcs, weights, num_nodes);
Since I don't know the arguments before fun_A, I need something like a "resize" operator, so that i can define graph_t outside the function, but declare it later inside the function.
You are definitely allowed to declare graph_t without any arguments, and you can use add_vertex and add_edge to insert data as needed. The graph will by dynamically resized as you add elements.
Andrew Sutton andrew.n.sutton@gmail.com
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Yes, I tried using add_vertex and add_edge and it works fine. But I assume that add_vertex and add_edge is much slower than using graph_t myGraph(array, edge_array + num_arcs, weights, num_nodes); Is this true or not? Does anyone have experience on that? My graph has over 10^6 edges. Thanks! -- View this message in context: http://www.nabble.com/-BGL--passing-a-graph-from-one-function-to-another-tp2... Sent from the Boost - Users mailing list archive at Nabble.com.