Changeset 941:186aa53d2802 in lemon-0.x for src/test/suurballe_test.cc
- Timestamp:
- 10/08/04 15:07:51 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1283
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/test/suurballe_test.cc
r921 r941 21 21 #include "test_tools.h" 22 22 23 using namespace std;24 23 using namespace lemon; 25 26 24 27 25 … … 31 29 int main() 32 30 { 31 typedef ListGraph Graph; 32 typedef Graph::Node Node; 33 typedef Graph::Edge Edge; 33 34 34 typedef ListGraph::Node Node; 35 typedef ListGraph::Edge Edge; 36 37 ListGraph graph; 35 Graph graph; 38 36 39 37 //Ahuja könyv példája … … 57 55 58 56 59 ListGraph::EdgeMap<int> length(graph);57 Graph::EdgeMap<int> length(graph); 60 58 61 59 length.set(s_v1, 6); … … 72 70 73 71 int k=3; 74 Suurballe< ListGraph, ListGraph::EdgeMap<int> >75 surb_test(graph, length );72 Suurballe< Graph, Graph::EdgeMap<int> > 73 surb_test(graph, length, s, t); 76 74 77 check( surb_test.run( s,t,k) == 2 && surb_test.totalLength() == 46,75 check( surb_test.run(k) == 2 && surb_test.totalLength() == 46, 78 76 "Two paths, total length should be 46"); 79 77 … … 81 79 "Complementary slackness conditions are not met."); 82 80 83 // typedef DirPath< ListGraph> DPath;81 // typedef DirPath<Graph> DPath; 84 82 // DPath P(graph); 85 83 … … 87 85 surb_test.getPath(P,0); 88 86 check(P.length() == 4, "First path should contain 4 edges."); 89 cout<<P.length()<<endl;87 std::cout<<P.length()<<std::endl; 90 88 surb_test.getPath(P,1); 91 89 check(P.length() == 3, "Second path: 3 edges."); 92 cout<<P.length()<<endl;90 std::cout<<P.length()<<std::endl; 93 91 */ 94 92 95 93 k=1; 96 check( surb_test.run( s,t,k) == 1 && surb_test.totalLength() == 19,94 check( surb_test.run(k) == 1 && surb_test.totalLength() == 19, 97 95 "One path, total length should be 19"); 98 96 … … 103 101 // check(P.length() == 4, "First path should contain 4 edges."); 104 102 105 cout << (passed ? "All tests passed." : "Some of the tests failed!!!")106 <<endl;103 std::cout << (passed ? "All tests passed." : "Some of the tests failed!!!") 104 << std::endl; 107 105 108 106 return passed ? 0 : 1;
Note: See TracChangeset
for help on using the changeset viewer.