Inconsistency in graph Example Code, Documentation

This is a minor point but one worth correcting for the sake of correctness and ease of following the examples. In the boost-1.30.2 distribution, the file libs/graph/example/kevin-bacon.cpp makes a reference to a "./kevin-bacon.dat" file, but the file in both the distribution and the documentation is actually kevin_bacon.dat. The only difference being '_' vs. '-'. This is easily fixed by an end-user, but it would be nice to have the examples work out of the box. -tfo

Problem with the Kevin Bacon example: char_delimiters_separator < char >sep(false, "", ";"); should be char_delimiters_separator < char >sep(false, "", "|"); At least this is true with the dat file I have. My output was: William Shatner|Loaded Weapon 1 (1993)|Denise Richards has a Bacon number of 0 has a Bacon number of 1 Denise Richards|Wild Things (1998)|Kevin Bacon has a Bacon number of 2 Patrick Stewart|Prince of Egypt, The (1998)|Steve Martin has a Bacon number of 2 Steve Martin|Novocaine (2000)|Kevin Bacon has a Bacon number of 2 ... It is now: William Shatner has a Bacon number of 2 Denise Richards has a Bacon number of 1 Kevin Bacon has a Bacon number of 0 Patrick Stewart has a Bacon number of 2 Steve Martin has a Bacon number of 1 ... Another problem, it still does not produce the output described in the docs such as: William Shatner was in Loaded Weapon 1 (1993) with Denise Richards Denise Richards was in Wild Things (1998) with Kevin Bacon Patrick Stewart was in Prince of Egypt, The (1998) with Steve Martin ... Thanks, -d Thomas F. O'Connell wrote:
This is a minor point but one worth correcting for the sake of correctness and ease of following the examples.
In the boost-1.30.2 distribution, the file
libs/graph/example/kevin-bacon.cpp
makes a reference to a "./kevin-bacon.dat" file, but the file in both the distribution and the documentation is actually kevin_bacon.dat.
The only difference being '_' vs. '-'.
This is easily fixed by an end-user, but it would be nice to have the examples work out of the box.
-tfo
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- David Ohlemacher BBN Technologies 127 John Clarke Rd. Middletown, RI 02878 Phone: (401)848-3542, Fax:(401)849-8611 ohlemacher at bbn dot com

Here is the missing code for the second problem: graph_traits < Graph >::edge_iterator ei, ei_end; for (tie(ei, ei_end) = edges(g); ei != ei_end; ++ei) { std::cout << actor_name[source(*ei, g)] << " was in \"" << connecting_movie[*ei] << "\" with " << actor_name[target(*ei, g)] << std::endl; } David Ohlemacher wrote:
Problem with the Kevin Bacon example:
char_delimiters_separator < char >sep(false, "", ";");
should be
char_delimiters_separator < char >sep(false, "", "|");
At least this is true with the dat file I have.
My output was: William Shatner|Loaded Weapon 1 (1993)|Denise Richards has a Bacon number of 0 has a Bacon number of 1 Denise Richards|Wild Things (1998)|Kevin Bacon has a Bacon number of 2 Patrick Stewart|Prince of Egypt, The (1998)|Steve Martin has a Bacon number of 2 Steve Martin|Novocaine (2000)|Kevin Bacon has a Bacon number of 2 ...
It is now: William Shatner has a Bacon number of 2 Denise Richards has a Bacon number of 1 Kevin Bacon has a Bacon number of 0 Patrick Stewart has a Bacon number of 2 Steve Martin has a Bacon number of 1 ...
Another problem, it still does not produce the output described in the docs such as:
William Shatner was in Loaded Weapon 1 (1993) with Denise Richards Denise Richards was in Wild Things (1998) with Kevin Bacon Patrick Stewart was in Prince of Egypt, The (1998) with Steve Martin ...
Thanks, -d
Thomas F. O'Connell wrote:
This is a minor point but one worth correcting for the sake of correctness and ease of following the examples.
In the boost-1.30.2 distribution, the file
libs/graph/example/kevin-bacon.cpp
makes a reference to a "./kevin-bacon.dat" file, but the file in both the distribution and the documentation is actually kevin_bacon.dat.
The only difference being '_' vs. '-'.
This is easily fixed by an end-user, but it would be nice to have the examples work out of the box.
-tfo
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- David Ohlemacher BBN Technologies 127 John Clarke Rd. Middletown, RI 02878 Phone: (401)848-3542, Fax:(401)849-8611 ohlemacher at bbn dot com

Hi David, Sorry, the docs had not been updated to match the new version of the example that went with the BGL book. I've updated the docs. Cheers, Jeremy ---------------------------------------------------------------------- Jeremy Siek http://php.indiana.edu/~jsiek/ Ph.D. Student, Indiana Univ. B'ton email: jsiek@osl.iu.edu C++ Booster (http://www.boost.org) office phone: (812) 855-3608 ----------------------------------------------------------------------
participants (3)
-
David Ohlemacher
-
Jeremy Siek
-
Thomas F. O'Connell