[Graph] Very minor typo/doc-bug in bellman-ford example

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Graph] Very minor typo/doc-bug in bellman-ford example

Greg Link
I'm not quite sure where to submit this, but the main boost.org site  
noted that bug reports are often best reported to mailing lists, so  
here goes. In the documentation for the Bellman-Ford algorithm, there  
is an example program (bellman-example.cpp) that contains the  
following 'main' function (snippet):

main()
{
   enum { u, v, x, y, z, N };
   char name[] = { 'u', 'v', 'x', 'y', 'z' };
   typedef std::pair < int, int >E;
   const int n_edges = 10;
   E edge_array[] = { E(u, y), E(u, x), E(u, v), E(v, u),
       E(x, y), E(x, v), E(y, v), E(y, z), E(z, u), E(z,x) };
...

Note that edge_array[] is of type "E", which of course, should be  
"Edge". The example doesn't work as listed, as such.

- Greg Link
_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: [Graph] Very minor typo/doc-bug in bellman-ford example

Doug Gregor-2

On Apr 5, 2006, at 2:22 PM, Greg Link wrote:

> I'm not quite sure where to submit this, but the main boost.org site
> noted that bug reports are often best reported to mailing lists, so
> here goes. In the documentation for the Bellman-Ford algorithm, there
> is an example program (bellman-example.cpp) that contains the
> following 'main' function (snippet):
>
> main()
> {
>    enum { u, v, x, y, z, N };
>    char name[] = { 'u', 'v', 'x', 'y', 'z' };
>    typedef std::pair < int, int >E;
>    const int n_edges = 10;
>    E edge_array[] = { E(u, y), E(u, x), E(u, v), E(v, u),
>        E(x, y), E(x, v), E(y, v), E(y, z), E(z, u), E(z,x) };
> ...
>
> Note that edge_array[] is of type "E", which of course, should be
> "Edge". The example doesn't work as listed, as such.

E is a typedef of std::pair<int, int>. That's okay--it's used to  
build the graph. The example compiles and runs properly for me.

        Doug
_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users