Boost logo

Boost Users :

Subject: Re: [Boost-users] [BGL] passing a graph from one function to another
From: Andrew Sutton (andrew.n.sutton_at_[hidden])
Date: 2008-11-19 12:17:25

> 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

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at