diff -r d167149bde95 -r 83c22ca968d8 src/work/marci/top_sort_test.cc --- a/src/work/marci/top_sort_test.cc Thu May 06 15:19:59 2004 +0000 +++ b/src/work/marci/top_sort_test.cc Thu May 06 15:24:42 2004 +0000 @@ -6,20 +6,35 @@ #include #include #include +#include using namespace hugo; int main() { typedef ListGraph Graph; Graph g; - readDimacs(std::cin, g); - std::list l; - topSort(g, l); - std::cout << "Leaving order of dfs which is pretopological..." << std::endl; - for(std::list::const_iterator i=l.begin(); i!=l.end(); ++i) { - std::cout << *i << " "; + readDimacs(std::cin, g); + { + std::list l; + topSort(g, l); + std::cout << "Leaving order of dfs which is pretopological..." << std::endl; + for(std::list::const_iterator i=l.begin(); i!=l.end(); ++i) { + std::cout << *i << " "; + } + std::cout << std::endl; } - std::cout << std::endl; + + { + typedef RevGraphWrapper GW; + GW gw(g); + std::list l; + topSort(gw, l); + std::cout << "Same in the revered oriented graph..." << std::endl; + for(std::list::const_iterator i=l.begin(); i!=l.end(); ++i) { + std::cout << *i << " "; + } + std::cout << std::endl; + } return 0; }