Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r50816 - trunk/libs/graph/example
From: jewillco_at_[hidden]
Date: 2009-01-27 15:19:55


Author: jewillco
Date: 2009-01-27 15:19:55 EST (Tue, 27 Jan 2009)
New Revision: 50816
URL: http://svn.boost.org/trac/boost/changeset/50816

Log:
Tightened handling of inf in example to try to catch problems like #732 in the future
Text files modified:
   trunk/libs/graph/example/johnson-eg.cpp | 2 +-
   1 files changed, 1 insertions(+), 1 deletions(-)

Modified: trunk/libs/graph/example/johnson-eg.cpp
==============================================================================
--- trunk/libs/graph/example/johnson-eg.cpp (original)
+++ trunk/libs/graph/example/johnson-eg.cpp 2009-01-27 15:19:55 EST (Tue, 27 Jan 2009)
@@ -56,7 +56,7 @@
   for (int i = 0; i < V; ++i) {
     std::cout << i << " -> ";
     for (int j = 0; j < V; ++j) {
- if (D[i][j] > 20 || D[i][j] < -20)
+ if (D[i][j] == (std::numeric_limits<int>::max)())
         std::cout << std::setw(5) << "inf";
       else
         std::cout << std::setw(5) << D[i][j];


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk