Boost logo

Boost Users :

From: David E. Konerding (dekonerding_at_[hidden])
Date: 2005-03-07 23:59:25


David E. Konerding DSD staff wrote:

> Hi folks,
>
> I'm trying to convert the Boost Graph Library example from a graph
> built in the code, to one that usses the adjacency_list_io supporto
> load the graph from a file.
> I was able to convert the dijkstra example this way, and had no problems.
>
>
> I'm getting a weird error when I disable GRAPH_CODE (this example is
> very close to the true example in the boost source distribution):
>
> test.cpp: In function `int main(int, char**)':
> test.cpp:44: no matching function for call to
> `johnson_all_pairs_shortest_paths
> (main(int, char**)::Graph&, int[V][V], boost::bgl_named_params<int*,
> boost::vertex_distance_t, boost::no_property>)'

Sorry to follow up on my own post, but I figured it out on my own :-)

Inspecting the signature for the missing reference, I pondered the
"int[V][V]" (the distance map parameter) and finally realized that it
was having trouble with the array declaration syntax when the value was
based on a non-compile time value (the number of vertices in the graph
wasn't a constant at compile time in my failing case). I'm sure this is
all well defined in the C++ rules, and when I built the distance map
array by hand using int **, it appeared to work.

Thanks,
Dave


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