copy_graphtemplate <class VertexListGraph, class MutableGraph> void copy_graph(const VertexListGraph& G, MutableGraph& G_copy, const bgl_named_params<P, T, R>& params = all defaults)This function copies all of the vertices and edges from graph G into G_copy. Also, it copies the vertex and edge properties, either by using the vertex_all and edge_all property maps, or by user-supplied copy functions. Where Defined
ParametersIN: const VertexListGraph& GA directed or undirected graph. The graph type must be a model of Vertex List Graph.OUT: MutableGraph& G_copy The resulting copy of the graph. The graph type must be a model of Mutable Graph. Named ParametersIN: vertex_copy(VertexCopier vc)This is a Binary Function that copies the properties of a vertex in the original graph into the corresponding vertex in the copy.IN: edge_copy(EdgeCopier ec) This is a Binary Function that copies the properties of an edge in the original graph into the corresponding edge in the copy.IN: vertex_index_map(VertexIndexMap i_map) The vertex index map type must be a model of Readable Property Map and must map the vertex descriptors of G to the integers in the half-open range [0,num_vertices(G)).UTIL/OUT: orig_to_copy(Orig2CopyMap c) This maps vertices in the original graph to vertices in the copy. Default: an iterator_property_map created from a std::vector of the output graph's vertex descriptor type of size num_vertices(g) and using the i_map for the index map. Complexity
The time complexity is O(V + E).
|