Changeset 986:e997802b855c in lemon-0.x for src/test
- Timestamp:
- 11/13/04 13:53:28 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1376
- Location:
- src/test
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
src/test/bfs_test.cc
r959 r986 84 84 85 85 for(EdgeIt e(G); e==INVALID; ++e) { 86 Node u=G. tail(e);87 Node v=G. head(e);86 Node u=G.source(e); 87 Node v=G.target(e); 88 88 check( !bfs_test.reached(u) || 89 89 (bfs_test.dist(v) > bfs_test.dist(u)+1), … … 95 95 if ( bfs_test.pred(v)!=INVALID ) { 96 96 Edge e=bfs_test.pred(v); 97 Node u=G. tail(e);97 Node u=G.source(e); 98 98 check(u==bfs_test.predNode(v),"Wrong tree."); 99 99 check(bfs_test.dist(v) - bfs_test.dist(u) == 1, -
src/test/dfs_test.cc
r959 r986 84 84 if ( dfs_test.pred(v)!=INVALID ) { 85 85 Edge e=dfs_test.pred(v); 86 Node u=G. tail(e);86 Node u=G.source(e); 87 87 check(u==dfs_test.predNode(v),"Wrong tree."); 88 88 check(dfs_test.dist(v) - dfs_test.dist(u) == 1, -
src/test/dijkstra_heap_test.cc
r921 r986 74 74 EdgeIt e; 75 75 for(G.first(e); e!=INVALID; ++e) { 76 Node u=G. tail(e);77 Node v=G. head(e);76 Node u=G.source(e); 77 Node v=G.target(e); 78 78 if ( dijkstra_test.dist(v) - dijkstra_test.dist(u) > cap[e] ) 79 79 if ( dijkstra_test.reached(u) ) { 80 std::cout<<"Error! dist( head)-dist(tail)- edge_length= "80 std::cout<<"Error! dist(target)-dist(source)- edge_length= " 81 81 <<dijkstra_test.dist(v) - dijkstra_test.dist(u) 82 82 - cap[e]<<std::endl; … … 89 89 if ( dijkstra_test.reached(v) ) { 90 90 Edge e=dijkstra_test.pred(v); 91 Node u=G. tail(e);91 Node u=G.source(e); 92 92 if ( dijkstra_test.dist(v) - dijkstra_test.dist(u) != cap[e] ) { 93 93 std::cout<<"Error in a shortest path tree edge! Difference: " … … 123 123 124 124 for(G.first(e); e!=INVALID; ++e) { 125 Node u=G. tail(e);126 Node v=G. head(e);125 Node u=G.source(e); 126 Node v=G.target(e); 127 127 if ( dijkstra_test2.dist(v) - dijkstra_test2.dist(u) > cap[e] ) 128 128 if ( dijkstra_test2.reached(u) ) { 129 std::cout<<"Error! dist( head)-dist(tail)- edge_length= "129 std::cout<<"Error! dist(target)-dist(source)- edge_length= " 130 130 <<dijkstra_test2.dist(v) - dijkstra_test2.dist(u) 131 131 - cap[e]<<std::endl; … … 137 137 if ( dijkstra_test2.reached(v) ) { 138 138 Edge e=dijkstra_test2.pred(v); 139 Node u=G. tail(e);139 Node u=G.source(e); 140 140 if ( dijkstra_test2.dist(v) - dijkstra_test2.dist(u) != cap[e] ) { 141 141 std::cout<<"Error in a shortest path tree edge! Difference: " -
src/test/dijkstra_test.cc
r959 r986 94 94 95 95 for(EdgeIt e(G); e!=INVALID; ++e) { 96 Node u=G. tail(e);97 Node v=G. head(e);96 Node u=G.source(e); 97 Node v=G.target(e); 98 98 check( !dijkstra_test.reached(u) || 99 99 (dijkstra_test.dist(v) - dijkstra_test.dist(u) <= cap[e]), 100 "dist( head)-dist(tail)- edge_length= "100 "dist(target)-dist(source)- edge_length= " 101 101 << dijkstra_test.dist(v) - dijkstra_test.dist(u) 102 102 - cap[e]); … … 108 108 if ( dijkstra_test.pred(v)!=INVALID ) { 109 109 Edge e=dijkstra_test.pred(v); 110 Node u=G. tail(e);110 Node u=G.source(e); 111 111 check(u==dijkstra_test.predNode(v),"Wrong tree."); 112 112 check(dijkstra_test.dist(v) - dijkstra_test.dist(u) == cap[e], -
src/test/graph_factory_test.cc
r959 r986 29 29 This test makes consistency checks of list graph structures. 30 30 31 G.addNode(), G.addEdge(), G. tail(), G.head()31 G.addNode(), G.addEdge(), G.source(), G.target() 32 32 33 33 \todo Checks for empty graphs and isolated points. … … 49 49 50 50 for(typename std::vector<Edge>::iterator p=ee.begin();p!=ee.end();p++) 51 G.addEdge(G. head(*p),G.tail(*p));51 G.addEdge(G.target(*p),G.source(*p)); 52 52 } 53 53 -
src/test/graph_test.h
r946 r986 54 54 for(int i=0;i<nn;i++) { 55 55 check(e!=INVALID,"Wrong OutEdge list linking."); 56 check(n==G. tail(e), "Wrong OutEdge list linking.");56 check(n==G.source(e), "Wrong OutEdge list linking."); 57 57 ++e; 58 58 } … … 66 66 for(int i=0;i<nn;i++) { 67 67 check(e!=INVALID,"Wrong InEdge list linking."); 68 check(n==G. head(e), "Wrong InEdge list linking.");68 check(n==G.target(e), "Wrong InEdge list linking."); 69 69 ++e; 70 70 } … … 82 82 83 83 ///\file 84 ///\todo Check head(), tail() as well;84 ///\todo Check target(), source() as well; 85 85 86 86 -
src/test/path_test.cc
r959 r986 48 48 P.clear(); //void clear() {} 49 49 50 gn=P. head(); //GraphNode/*It*/ head() const {return INVALID;}51 gn=P. tail(); //GraphNode/*It*/ tail() const {return INVALID;}50 gn=P.target(); //GraphNode/*It*/ target() const {return INVALID;} 51 gn=P.source(); //GraphNode/*It*/ source() const {return INVALID;} 52 52 53 53 ei=P.first(ei); //It& first(It &i) const { return i=It(*this); } 54 54 55 ni=P. head(ei); //NodeIt head(const EdgeIt& e) const {}56 ni=P. tail(ei); //NodeIt tail(const EdgeIt& e) const {}55 ni=P.target(ei); //NodeIt target(const EdgeIt& e) const {} 56 ni=P.source(ei); //NodeIt source(const EdgeIt& e) const {} 57 57 58 58 -
src/test/preflow_test.cc
r959 r986 68 68 int c=0; 69 69 for(SmartGraph::EdgeIt e(g); e!=INVALID; ++e) { 70 if (cut[g. tail(e)] && !cut[g.head(e)]) c+=cap[e];70 if (cut[g.source(e)] && !cut[g.target(e)]) c+=cap[e]; 71 71 } 72 72 return c; -
src/test/sym_graph_test.cc
r959 r986 31 31 This test makes consistency checks of list graph structures. 32 32 33 G.addNode(), G.addEdge(), G. tail(), G.head()33 G.addNode(), G.addEdge(), G.source(), G.target() 34 34 35 35 \todo Checks for empty graphs and isolated points. -
src/test/sym_graph_test.h
r959 r986 74 74 SymEdge se; 75 75 se=INVALID; 76 n=G. tail(se);77 n=G. head(se);76 n=G.source(se); 77 n=G.target(se); 78 78 } 79 79 // id tests … … 175 175 176 176 ///\file 177 ///\todo Check head(), tail() as well;177 ///\todo Check target(), source() as well; 178 178 179 179 -
src/test/test_tools.h
r978 r986 106 106 107 107 for(typename std::vector<Edge>::iterator p=ee.begin();p!=ee.end();p++) 108 G.addEdge(G. head(*p),G.tail(*p));108 G.addEdge(G.target(*p),G.source(*p)); 109 109 } 110 110
Note: See TracChangeset
for help on using the changeset viewer.