Changeset 609:0566ac97809b in lemon-0.x
- Timestamp:
- 05/11/04 17:54:00 (21 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@791
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/work/marci/top_sort_test.cc
r577 r609 9 9 #include <hugo/graph_wrapper.h> 10 10 #include <hugo/maps.h> 11 #include <for_each_macros.h> 11 12 12 13 using namespace hugo; 14 15 using std::cout; 16 using std::endl; 13 17 14 18 int main() { … … 16 20 Graph g; 17 21 readDimacs(std::cin, g); 22 18 23 { 19 24 std::list<Graph::Node> l; 20 NullMap<Graph::Node, Graph::Edge> pred; 25 //NullMap<Graph::Node, Graph::Edge> pred; 26 Graph::NodeMap<Graph::Edge> pred(g, INVALID); 21 27 topSort(g, l, pred); 22 std::cout << "Leaving order of dfs which is pretopological..." << std::endl;28 cout << "Leaving order of dfs which is pretopological..." << endl; 23 29 for(std::list<Graph::Node>::const_iterator i=l.begin(); i!=l.end(); ++i) { 24 std::cout << *i << " ";30 cout << *i << " "; 25 31 } 26 std::cout << std::endl; 32 cout << endl; 33 34 FOR_EACH_LOC(Graph::NodeIt, n, g) { 35 cout << "pred of node " << n << " is " << pred[n] << endl; 36 } 27 37 } 28 38 … … 31 41 GW gw(g); 32 42 std::list<GW::Node> l; 33 NullMap<GW::Node, GW::Edge> pred; 43 //NullMap<GW::Node, GW::Edge> pred; 44 GW::NodeMap<Graph::Edge> pred(gw, INVALID); 34 45 topSort(gw, l, pred); 35 std::cout << "Same in the revered oriented graph..." << std::endl;46 cout << "Same in the reversed oriented graph..." << endl; 36 47 for(std::list<GW::Node>::const_iterator i=l.begin(); i!=l.end(); ++i) { 37 std::cout << *i << " ";48 cout << *i << " "; 38 49 } 39 std::cout << std::endl; 50 cout << endl; 51 52 FOR_EACH_LOC(GW::NodeIt, n, gw) { 53 cout << "pred of node " << n << " is " << pred[n] << endl; 54 } 40 55 } 41 56
Note: See TracChangeset
for help on using the changeset viewer.