| 356 | typename graph_type2 |
| 357 | > |
| 358 | typename enable_if<is_graph<graph_type1> >::type copy_graph ( |
| 359 | const graph_type1& src, |
| 360 | graph_type2& dest |
| 361 | ) |
| 362 | { |
| 363 | COMPILE_TIME_ASSERT(is_graph<graph_type1>::value); |
| 364 | COMPILE_TIME_ASSERT(is_graph<graph_type2>::value); |
| 365 | if (graph_helpers::is_same_object(src,dest)) |
| 366 | return; |
| 367 | |
| 368 | copy_graph_structure(src,dest); |
| 369 | |
| 370 | // copy all the node and edge content |
| 371 | for (unsigned long i = 0; i < src.number_of_nodes(); ++i) |
| 372 | { |
| 373 | dest.node(i).data = src.node(i).data; |
| 374 | |
| 375 | for (unsigned long j = 0; j < src.node(i).number_of_neighbors(); ++j) |
| 376 | { |
| 377 | const unsigned long nidx = src.node(i).neighbor(j).index(); |
| 378 | if (nidx >= i) |
| 379 | { |
| 380 | dest.node(i).edge(j) = src.node(i).edge(j); |
| 381 | } |
| 382 | } |
| 383 | } |
| 384 | } |
| 385 | |
| 386 | template < |
| 387 | typename graph_type1, |