| 292 | typename graph_type2 |
| 293 | > |
| 294 | typename enable_if<is_graph<graph_type1> >::type copy_graph_structure ( |
| 295 | const graph_type1& src, |
| 296 | graph_type2& dest |
| 297 | ) |
| 298 | { |
| 299 | COMPILE_TIME_ASSERT(is_graph<graph_type1>::value); |
| 300 | COMPILE_TIME_ASSERT(is_graph<graph_type2>::value); |
| 301 | if (graph_helpers::is_same_object(src,dest)) |
| 302 | return; |
| 303 | |
| 304 | dest.clear(); |
| 305 | dest.set_number_of_nodes(src.number_of_nodes()); |
| 306 | |
| 307 | // copy all the edges from src into dest |
| 308 | for (unsigned long i = 0; i < src.number_of_nodes(); ++i) |
| 309 | { |
| 310 | for (unsigned long j = 0; j < src.node(i).number_of_neighbors(); ++j) |
| 311 | { |
| 312 | const unsigned long nidx = src.node(i).neighbor(j).index(); |
| 313 | if (nidx >= i) |
| 314 | { |
| 315 | dest.add_edge(i,nidx); |
| 316 | } |
| 317 | } |
| 318 | } |
| 319 | } |
| 320 | |
| 321 | template < |
| 322 | typename graph_type1, |