Boost Users :
Subject: Re: [Boost-users] [BGL] passing a graph from one function to another
From: r89 (r8921025_at_[hidden])
Date: 2008-11-19 12:39:15
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
> can use add_vertex and add_edge to insert data as needed. The graph will
> dynamically resized as you add elements.
> Andrew Sutton
> Boost-users mailing list
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.
-- View this message in context: http://www.nabble.com/-BGL--passing-a-graph-from-one-function-to-another-tp20582781p20585086.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