Boost logo

Boost :

From: Jeremy Siek (jsiek_at_[hidden])
Date: 2003-01-24 09:47:33


Hi Duncan,

Sorry for the lagged reply.

I think the problem is in the value used for "zero" in
file_dependencies.cpp. Since we are using > for comparison, I think
"zero" should be std::numeric_limits<int>::max() instead of 0.

Cheers,
Jeremy

On Sun, 22 Dec 2002, Duncan Clarke wrote:
duncan> I downloaded the 1_29_0 version of Boost, compiled the file_dependencies.cpp
duncan> example, and when I run it, the sample program aborts after throwing
duncan> negative_edge in examine_edges(...) (from dijkstra_shortest_paths.cpp).
duncan>
duncan> After a little investigation, it looks to me like examine_edges(...) is
duncan> supposed to protect against negative edge weights. It does so by calling
duncan> the user-supplied comparison function to test each edge to make sure its
duncan> weight is greater than the user-supplied zero value. But the call in
duncan> examine_edges(...) is coded so that "if (EdgeWeight ? 0) then throw
duncan> negative_edge()," where the example program uses the ">" operator for "?".
duncan> Seems to me that those parameters are presented in the wrong order.
duncan>
duncan> I downloaded Boost 1_28_0 and the example compiled and ran without problems.
duncan> A quick diff showed that the code to test for negative edge weights is new
duncan> in BGL 1_29_0.
duncan>
duncan> So... is it a feature or a bug?
duncan>
duncan> I checked through all the boost newsgroups and couldn't find anything about
duncan> this, but I'm new to Boost, so forgive me (and point me to the resolution)
duncan> if this is a known problem.
duncan>
duncan> Thanks,
duncan>
duncan> Duncan Clarke
duncan> Computer Science and Engineering
duncan> University of South Carolina
duncan>
duncan>
duncan>

----------------------------------------------------------------------
 Jeremy Siek http://php.indiana.edu/~jsiek/
 Ph.D. Student, Indiana Univ. B'ton email: jsiek_at_[hidden]
 C++ Booster (http://www.boost.org) office phone: (812) 855-3608
----------------------------------------------------------------------


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk