Changeset 937:d4e911acef3d in lemon0.x for src/test
 Timestamp:
 10/04/04 19:13:21 (18 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@1264
 Location:
 src/test
 Files:

 2 added
 4 edited
Legend:
 Unmodified
 Added
 Removed

src/test/Makefile.am
r919 r937 10 10 dijkstra_test \ 11 11 graph_test \ 12 sym_graph_test \ 12 13 graph_wrapper_test \ 13 14 kruskal_test \ … … 29 30 dijkstra_test_SOURCES = dijkstra_test.cc 30 31 graph_test_SOURCES = graph_test.cc 32 sym_graph_test_SOURCES = sym_graph_test.cc 31 33 graph_wrapper_test_SOURCES = graph_wrapper_test.cc 32 34 kruskal_test_SOURCES = kruskal_test.cc 
src/test/graph_test.cc
r921 r937 64 64 checkGraphInEdgeList(G,n,3); 65 65 checkGraphOutEdgeList(G,n,3); 66 ++n;67 66 } 68 67 } … … 83 82 84 83 //Compile SymSmartGraph 85 template void lemon::checkCompileGraph<SymSmartGraph>(SymSmartGraph &);86 template void lemon::checkCompileGraphFindEdge<SymSmartGraph>(SymSmartGraph &);84 //template void hugo::checkCompileGraph<SymSmartGraph>(SymSmartGraph &); 85 //template void hugo::checkCompileGraphFindEdge<SymSmartGraph>(SymSmartGraph &); 87 86 88 87 //Compile ListGraph … … 93 92 94 93 //Compile SymListGraph 95 template void lemon::checkCompileGraph<SymListGraph>(SymListGraph &);96 template void lemon::checkCompileErasableGraph<SymListGraph>(SymListGraph &);97 template void lemon::checkCompileGraphFindEdge<SymListGraph>(SymListGraph &);94 //template void hugo::checkCompileGraph<SymListGraph>(SymListGraph &); 95 //template void hugo::checkCompileErasableGraph<SymListGraph>(SymListGraph &); 96 //template void hugo::checkCompileGraphFindEdge<SymListGraph>(SymListGraph &); 98 97 99 98 //Compile FullGraph … … 132 131 } 133 132 { 134 SymSmartGraph G;135 addPetersen(G);136 checkPetersen(G);133 // SymSmartGraph G; 134 // addPetersen(G); 135 // checkPetersen(G); 137 136 } 138 137 { 139 SymListGraph G;140 addPetersen(G);141 checkPetersen(G);138 // SymListGraph G; 139 // addPetersen(G); 140 // checkPetersen(G); 142 141 } 143 142 
src/test/graph_test.h
r921 r937 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."); 301 302 ++e; 302 303 } … … 311 312 for(int i=0;i<nn;i++) { 312 313 check(e!=INVALID,"Wrong InEdge list linking."); 314 check(n==G.head(e), "Wrong InEdge list linking."); 313 315 ++e; 314 316 } 
src/test/test_tools.h
r921 r937 68 68 69 69 ///Adds a Petersen graph to \c G. 70 ///\return The nodes end edges ogthe generated graph.70 ///\return The nodes and edges of the generated graph. 71 71 72 72 template<typename Graph> … … 88 88 } 89 89 90 ///Structure returned by \ref addSymPetersen(). 90 91 92 ///Structure returned by \ref addSymPetersen(). 93 /// 94 template<class Graph> struct SymPetStruct 95 { 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 } 91 130 92 131 #endif
Note: See TracChangeset
for help on using the changeset viewer.