170 m=dm; //Copy to another type |
170 m=dm; //Copy to another type |
171 } |
171 } |
172 |
172 |
173 } |
173 } |
174 |
174 |
175 |
175 template<class Graph> struct PetNodes |
176 |
|
177 template<class Graph> void addPetersen(Graph &G) |
|
178 { |
176 { |
179 std::vector<typename Graph::Node> outer, inner; |
177 std::vector<typename Graph::Node> outer, inner; |
180 |
178 std::vector<typename Graph::Edge> outcir, incir, cons; |
181 for(int i=0;i<5;i++) { |
179 }; |
182 outer.push_back(G.addNode()); |
180 |
183 inner.push_back(G.addNode()); |
181 template<class Graph> PetNodes<Graph> addPetersen(Graph &G,int num=5) |
184 } |
182 { |
185 |
183 //std::vector<typename Graph::Node> outer, inner; |
186 for(int i=0;i<5;i++) { |
184 |
187 G.addEdge(outer[i],inner[i]); |
185 PetNodes<Graph> n; |
188 G.addEdge(outer[i],outer[(i+1)%5]); |
186 |
189 G.addEdge(inner[i],inner[(i+2)%5]); |
187 for(int i=0;i<num;i++) { |
190 } |
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; |
191 } |
198 } |
192 |
199 |
193 template<class Graph> void checkNodeList(Graph &G, int nn) |
200 template<class Graph> void checkNodeList(Graph &G, int nn) |
194 { |
201 { |
195 typename Graph::NodeIt n(G); |
202 typename Graph::NodeIt n(G); |
267 checkOutEdgeList(G,n,3); |
274 checkOutEdgeList(G,n,3); |
268 G.next(n); |
275 G.next(n); |
269 } |
276 } |
270 } |
277 } |
271 |
278 |
272 //template void checkCompile<GraphSkeleton>(GraphSkeleton &); |
279 template void checkCompile<GraphSkeleton>(GraphSkeleton &); |
273 template void checkCompile<SmartGraph>(SmartGraph &); |
280 template void checkCompile<SmartGraph>(SmartGraph &); |
274 template void checkCompile<SymSmartGraph>(SymSmartGraph &); |
281 template void checkCompile<SymSmartGraph>(SymSmartGraph &); |
275 //template void checkCompile<ListGraph>(ListGraph &); |
282 //template void checkCompile<ListGraph>(ListGraph &); |
276 //template void checkCompile<SymListGraph>(SymListGraph &); |
283 //template void checkCompile<SymListGraph>(SymListGraph &); |
277 |
284 |