COIN-OR::LEMON - Graph Library

Changeset 780:e06d0d16595f in lemon-0.x for src/test/bfs_test.cc


Ignore:
Timestamp:
09/01/04 17:08:41 (17 years ago)
Author:
Alpar Juttner
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1073
Message:
  • DFS class (bfs.h and bfs_test.cc) added
  • Bugfixes in Dijkstra and Bfs
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/test/bfs_test.cc

    r774 r780  
    7777  }
    7878
    79   ///\bug This works only for integer lengths
    80   for(NodeIt v(G); v==INVALID; ++v)
    81     if ( bfs_test.reached(v) ) {
     79  for(NodeIt v(G); v==INVALID; ++v) {
     80    check(bfs_test.reached(v),"Each node should be reached.");
     81    if ( bfs_test.pred(v)!=INVALID ) {
    8282      Edge e=bfs_test.pred(v);
    8383      Node u=G.tail(e);
     84      check(u==bfs_test.predNode(v),"Wrong tree.");
    8485      check(bfs_test.dist(v) - bfs_test.dist(u) == 1,
    85             "Bad shortest path tree edge! Difference: "
     86            "Wrong distance. Difference: "
    8687            << std::abs(bfs_test.dist(v) - bfs_test.dist(u)
    8788                        - 1));
    8889    }
     90  }
    8991}
     92
Note: See TracChangeset for help on using the changeset viewer.