Changeset 567:efaa79ee8d14 in lemon-0.x for src/test/graph_test.cc
- Timestamp:
- 05/07/04 08:57:50 (21 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@742
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/test/graph_test.cc
r564 r567 2 2 #include<hugo/smart_graph.h> 3 3 #include<hugo/skeletons/graph.h> 4 #include"test_tools.h" 5 4 6 //#include<../work/alpar/list_graph.h> 5 7 … … 12 14 13 15 using namespace hugo; 14 15 // void check(bool rc, const char *msg) {16 // if(!rc) {17 // std::cerr << msg << std::endl;18 // exit(1);19 // }20 // }21 22 #define check(rc, msg) \23 if(!rc) { \24 std::cerr << __FILE__ ":" << __LINE__ << ": error: " << msg << std::endl; \25 exit(1); \26 } else { } \27 28 16 29 17 template<class Graph> void checkCompile(Graph &G) … … 173 161 } 174 162 175 template<class Graph> struct PetNodes176 {177 std::vector<typename Graph::Node> outer, inner;178 std::vector<typename Graph::Edge> outcir, incir, cons;179 };180 181 template<class Graph> PetNodes<Graph> addPetersen(Graph &G,int num=5)182 {183 //std::vector<typename Graph::Node> outer, inner;184 185 PetNodes<Graph> n;186 187 for(int i=0;i<num;i++) {188 n.outer.push_back(G.addNode());189 n.inner.push_back(G.addNode());190 }191 192 for(int i=0;i<num;i++) {193 n.cons.push_back(G.addEdge(n.outer[i],n.inner[i]));194 n.outcir.push_back(G.addEdge(n.outer[i],n.outer[(i+1)%5]));195 n.incir.push_back(G.addEdge(n.inner[i],n.inner[(i+2)%5]));196 }197 return n;198 }199 200 163 template<class Graph> void checkNodeList(Graph &G, int nn) 201 164 {
Note: See TracChangeset
for help on using the changeset viewer.