Changeset 552:83c22ca968d8 in lemon0.x for src/work
 Timestamp:
 05/06/04 17:24:42 (17 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@725
 Location:
 src/work/marci
 Files:

 3 edited
Legend:
 Unmodified
 Added
 Removed

src/work/marci/bfs_dfs_misc.h
r549 r552 51 51 dfs.pushAndSetReached(n); 52 52 while (!dfs.finished()) { 53 ++dfs; 53 54 if (dfs.isANodeExamined()) { 54 55 l.push_back(dfs.aNode()); 55 56 } 56 ++dfs;57 57 } 58 58 } 
src/work/marci/top_sort.dim
r549 r552 1 p mat 5 41 p mat 5 5 2 2 a 1 3 3 3 a 2 3 4 4 a 3 5 5 5 a 3 4 6 a 5 4 
src/work/marci/top_sort_test.cc
r549 r552 7 7 #include <bfs_dfs_misc.h> 8 8 #include <list_graph.h> 9 #include <graph_wrapper.h> 9 10 10 11 using namespace hugo; … … 13 14 typedef ListGraph Graph; 14 15 Graph g; 15 readDimacs(std::cin, g); 16 std::list<Graph::Node> l; 17 topSort(g, l); 18 std::cout << "Leaving order of dfs which is pretopological..." << std::endl; 19 for(std::list<Graph::Node>::const_iterator i=l.begin(); i!=l.end(); ++i) { 20 std::cout << *i << " "; 16 readDimacs(std::cin, g); 17 { 18 std::list<Graph::Node> l; 19 topSort(g, l); 20 std::cout << "Leaving order of dfs which is pretopological..." << std::endl; 21 for(std::list<Graph::Node>::const_iterator i=l.begin(); i!=l.end(); ++i) { 22 std::cout << *i << " "; 23 } 24 std::cout << std::endl; 21 25 } 22 std::cout << std::endl; 26 27 { 28 typedef RevGraphWrapper<Graph> GW; 29 GW gw(g); 30 std::list<GW::Node> l; 31 topSort(gw, l); 32 std::cout << "Same in the revered oriented graph..." << std::endl; 33 for(std::list<GW::Node>::const_iterator i=l.begin(); i!=l.end(); ++i) { 34 std::cout << *i << " "; 35 } 36 std::cout << std::endl; 37 } 23 38 24 39 return 0;
Note: See TracChangeset
for help on using the changeset viewer.