Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/libs/graph/doc/copy_graph.html @ 14

Last change on this file since 14 was 12, checked in by landauf, 17 years ago

added boost

File size: 3.8 KB
Line 
1<HTML>
2<!--
3  -- Copyright (c) Jeremy Siek 2000
4  --
5  -- Permission to use, copy, modify, distribute and sell this software
6  -- and its documentation for any purpose is hereby granted without fee,
7  -- provided that the above copyright notice appears in all copies and
8  -- that both that copyright notice and this permission notice appear
9  -- in supporting documentation.  Jeremy Siek makes no
10  -- representations about the suitability of this software for any
11  -- purpose.  It is provided "as is" without express or implied warranty.
12  -->
13<Head>
14<Title>Boost Graph Library: Copy Graph</Title>
15<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b" 
16        ALINK="#ff0000"> 
17<IMG SRC="../../../boost.png" 
18     ALT="C++ Boost" width="277" height="86"> 
19
20<BR Clear>
21
22<H1><TT>copy_graph</TT></H1>
23
24<PRE>
25template &lt;class <a href="./VertexListGraph.html">VertexListGraph</a>, class <a href="./MutableGraph.html">MutableGraph</a>&gt; 
26void copy_graph(const VertexListGraph&amp; G, MutableGraph&amp; G_copy,
27    const bgl_named_params&lt;P, T, R&gt;&amp; params = <i>all defaults</i>)
28</PRE>
29
30This function copies all of the vertices and edges from graph
31<tt>G</tt> into <tt>G_copy</tt>. Also, it copies the vertex and edge
32properties, either by using the <tt>vertex_all</tt> and
33<tt>edge_all</tt> property maps, or by user-supplied copy functions.
34
35<H3>Where Defined</H3>
36
37<P>
38<a href="../../../boost/graph/copy.hpp"><TT>boost/graph/copy.hpp</TT></a>
39
40<P>
41
42<H3>Parameters</H3>
43
44IN: <tt>const VertexListGraph&amp; G</tt>
45<blockquote>
46A directed or undirected graph. The graph type must be a model of <a href="./VertexListGraph.html">Vertex List Graph</a>.
47</blockquote>
48
49OUT: <tt>MutableGraph&amp; G_copy</tt>
50<blockquote>
51The resulting copy of the graph.  The graph type must be a model of <a
52href="./MutableGraph.html">Mutable Graph</a>.
53</blockquote>
54
55<h3>Named Parameters</h3>
56
57IN: <tt>vertex_copy(VertexCopier vc)</tt>
58<blockquote>
59This is a <a href="http://www.sgi.com/tech/stl/BinaryFunction.html">Binary Function</a> that copies the properties of a vertex in the original graph
60into the corresponding vertex in the copy.<br>
61
62<b>Default:</b> <tt>vertex_copier&lt;VertexListGraph, MutableGraph&gt;</tt>
63which uses the property tag <tt>vertex_all</tt> to access a property
64map from the graph.
65</blockquote>
66
67IN: <tt>edge_copy(EdgeCopier ec)</tt>
68<blockquote>
69This is a <a href="http://www.sgi.com/tech/stl/BinaryFunction.html">Binary Function</a> that copies the properties of an edge in the original graph
70into the corresponding edge in the copy.<br>
71
72<b>Default:</b> <tt>edge_copier&lt;VertexListGraph, MutableGraph&gt;</tt>
73which uses the property tag <tt>edge_all</tt> to access a property
74map from the graph.
75</blockquote>
76
77IN: <tt>vertex_index_map(VertexIndexMap i_map)</tt>
78<blockquote>
79The vertex index map type must be a model of <a
80href="../../property_map/ReadablePropertyMap.html">Readable Property
81Map</a> and must map the vertex descriptors of <tt>G</tt> to the
82integers from 0 to <tt>num_vertices(G)</tt>.<br>
83
84<b>Default:</b> <tt>get(vertex_index, G)</tt>
85</blockquote>
86
87
88UTIL/OUT: <tt>orig_to_copy(Orig2CopyMap c)</tt>
89<blockquote>
90This maps vertices in the original graph to vertices in the copy.
91
92<b>Default:</b> an <a
93  href="../../property_map/iterator_property_map.html">
94  </tt>iterator_property_map</tt></a> created from a
95  <tt>std::vector</tt> of the output graph's vertex descriptor type of size
96  <tt>num_vertices(g)</tt> and using the <tt>i_map</tt> for the index
97  map.
98</blockquote>
99
100<H3>Complexity</H3>
101
102<P>
103The time complexity is <i>O(V + E)</i>.
104
105
106
107<br>
108<HR>
109<TABLE>
110<TR valign=top>
111<TD nowrap>Copyright &copy 2000-2001</TD><TD>
112<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Indiana University (<A HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)
113</TD></TR></TABLE>
114
115</BODY>
116</HTML> 
Note: See TracBrowser for help on using the repository browser.