--- subgraph.hpp.orig 2014-06-27 13:49:35.000000000 +0400 +++ subgraph.hpp.copyctr.patched.reconst 2014-10-28 20:19:00.000000000 +0300 @@ -131,25 +131,22 @@ // copy constructor subgraph(const subgraph& x) - : m_parent(x.m_parent), m_edge_counter(x.m_edge_counter) + : m_parent(x.m_parent), m_graph(x.m_graph), m_edge_counter(x.m_edge_counter) , m_global_vertex(x.m_global_vertex), m_global_edge(x.m_global_edge) + , m_local_vertex(x.m_local_vertex), m_local_edge(x.m_local_edge) { - if(x.is_root()) - { - m_graph = x.m_graph; - } // Do a deep copy (recursive). // Only the root graph is copied, the subgraphs contain // only references to the global vertices they own. typename subgraph::children_iterator i,i_end; boost::tie(i,i_end) = x.children(); for(; i != i_end; ++i) - { + { subgraph child = this->create_subgraph(); child = *i; - vertex_iterator vi,vi_end; + vertex_iterator vi,vi_end; boost::tie(vi,vi_end) = vertices(*i); - for (;vi!=vi_end;++vi) + for (;vi!=vi_end;++vi) { add_vertex(*vi,child); }