Changeset 919:6153d9cf78c6 in lemon-0.x for src/test
- Timestamp:
- 09/29/04 16:02:14 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1230
- Location:
- src/test
- Files:
-
- 2 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/test/Makefile.am ¶
r909 r919 10 10 dijkstra_test \ 11 11 graph_test \ 12 sym_graph_test \13 12 graph_wrapper_test \ 14 13 kruskal_test \ … … 30 29 dijkstra_test_SOURCES = dijkstra_test.cc 31 30 graph_test_SOURCES = graph_test.cc 32 sym_graph_test_SOURCES = sym_graph_test.cc33 31 graph_wrapper_test_SOURCES = graph_wrapper_test.cc 34 32 kruskal_test_SOURCES = kruskal_test.cc -
TabularUnified src/test/graph_test.cc ¶
r909 r919 64 64 checkGraphInEdgeList(G,n,3); 65 65 checkGraphOutEdgeList(G,n,3); 66 ++n; 66 67 } 67 68 } … … 82 83 83 84 //Compile SymSmartGraph 84 //template void hugo::checkCompileGraph<SymSmartGraph>(SymSmartGraph &);85 //template void hugo::checkCompileGraphFindEdge<SymSmartGraph>(SymSmartGraph &);85 template void hugo::checkCompileGraph<SymSmartGraph>(SymSmartGraph &); 86 template void hugo::checkCompileGraphFindEdge<SymSmartGraph>(SymSmartGraph &); 86 87 87 88 //Compile ListGraph … … 92 93 93 94 //Compile SymListGraph 94 //template void hugo::checkCompileGraph<SymListGraph>(SymListGraph &);95 //template void hugo::checkCompileErasableGraph<SymListGraph>(SymListGraph &);96 //template void hugo::checkCompileGraphFindEdge<SymListGraph>(SymListGraph &);95 template void hugo::checkCompileGraph<SymListGraph>(SymListGraph &); 96 template void hugo::checkCompileErasableGraph<SymListGraph>(SymListGraph &); 97 template void hugo::checkCompileGraphFindEdge<SymListGraph>(SymListGraph &); 97 98 98 99 //Compile FullGraph … … 131 132 } 132 133 { 133 //SymSmartGraph G;134 //addPetersen(G);135 //checkPetersen(G);134 SymSmartGraph G; 135 addPetersen(G); 136 checkPetersen(G); 136 137 } 137 138 { 138 //SymListGraph G;139 //addPetersen(G);140 //checkPetersen(G);139 SymListGraph G; 140 addPetersen(G); 141 checkPetersen(G); 141 142 } 142 143 -
TabularUnified src/test/graph_test.h ¶
r916 r919 299 299 for(int i=0;i<nn;i++) { 300 300 check(e!=INVALID,"Wrong OutEdge list linking."); 301 check(n==G.tail(e), "Wrong OutEdge list linking.");302 301 ++e; 303 302 } … … 312 311 for(int i=0;i<nn;i++) { 313 312 check(e!=INVALID,"Wrong InEdge list linking."); 314 check(n==G.head(e), "Wrong InEdge list linking.");315 313 ++e; 316 314 } -
TabularUnified src/test/test_tools.h ¶
r909 r919 68 68 69 69 ///Adds a Petersen graph to \c G. 70 ///\return The nodes and edges ofthe generated graph.70 ///\return The nodes end edges og the generated graph. 71 71 72 72 template<typename Graph> … … 88 88 } 89 89 90 ///Structure returned by \ref addSymPetersen().91 90 92 ///Structure returned by \ref addSymPetersen().93 ///94 template<class Graph> struct SymPetStruct95 {96 ///Vector containing the outer nodes.97 std::vector<typename Graph::Node> outer;98 ///Vector containing the inner nodes.99 std::vector<typename Graph::Node> inner;100 ///Vector containing the edges of the inner circle.101 std::vector<typename Graph::SymEdge> incir;102 ///Vector containing the edges of the outer circle.103 std::vector<typename Graph::SymEdge> outcir;104 ///Vector containing the chord edges.105 std::vector<typename Graph::SymEdge> chords;106 };107 108 ///Adds a Petersen graph to the symmetric \c G.109 110 ///Adds a Petersen graph to the symmetric \c G.111 ///\return The nodes and edges of the generated graph.112 113 template<typename Graph>114 SymPetStruct<Graph> addSymPetersen(Graph &G,int num=5)115 {116 SymPetStruct<Graph> n;117 118 for(int i=0;i<num;i++) {119 n.outer.push_back(G.addNode());120 n.inner.push_back(G.addNode());121 }122 123 for(int i=0;i<num;i++) {124 n.chords.push_back(G.addEdge(n.outer[i],n.inner[i]));125 n.outcir.push_back(G.addEdge(n.outer[i],n.outer[(i+1)%5]));126 n.incir.push_back(G.addEdge(n.inner[i],n.inner[(i+2)%5]));127 }128 return n;129 }130 91 131 92 #endif
Note: See TracChangeset
for help on using the changeset viewer.