Ticket #6564: subgraph.hpp.2.patch
File subgraph.hpp.2.patch, 1.3 KB (added by , 11 years ago) |
---|
-
subgraph.hpp
131 131 132 132 // copy constructor 133 133 subgraph(const subgraph& x) 134 : m_ graph(x.m_graph), m_parent(x.m_parent), m_edge_counter(x.m_edge_counter)134 : m_parent(x.m_parent), m_edge_counter(x.m_edge_counter) 135 135 , m_global_vertex(x.m_global_vertex), m_global_edge(x.m_global_edge) 136 136 { 137 // Do a deep copy (recursive). 138 for(typename ChildrenList::const_iterator i = x.m_children.begin(); 139 i != x.m_children.end(); ++i) 137 if(x.is_root()) 140 138 { 141 m_children.push_back(new subgraph<Graph>( **i ));139 m_graph = x.m_graph; 142 140 } 141 // Do a deep copy (recursive). 142 // Only the root graph is copied, the subgraphes contain 143 // only references to the global vertices they own. 144 subgraph<Graph>::children_iterator i,i_end; 145 boost::tie(i,i_end) = x.children(); 146 for(; i != i_end; ++i) 147 { 148 subgraph<Graph> child = this->create_subgraph(); 149 child = *i; 150 vertex_iterator vi,vi_end; 151 boost::tie(vi,vi_end) = vertices(*i); 152 for (;vi!=vi_end;++vi) 153 { 154 add_vertex(*vi,child); 155 } 156 } 143 157 } 144 158 145 159