Blame view

3rdparty/boost_1_81_0/libs/graph/doc/MutablePropertyGraph.html 3.17 KB
977ed18d   Hu Chunming   提交三方库
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
  <HTML>
  <!--
       Copyright (c) Jeremy Siek 2000
  
       Distributed under the Boost Software License, Version 1.0.
       (See accompanying file LICENSE_1_0.txt or copy at
       http://www.boost.org/LICENSE_1_0.txt)
    -->
  <Head>
  <Title>MutablePropertyGraph</Title>
  <BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
          ALINK="#ff0000">
  <IMG SRC="../../../boost.png"
       ALT="C++ Boost" width="277" height="86">
  
  <BR Clear>
  
  
  
  <H2>
  <A NAME="sec:MutablePropertyGraph"></A>
  MutablePropertyGraph
  </H2>
  
  A MutablePropertyGraph is a <a
  href="./MutableGraph.html">MutableGraph</a> with properties attached
  internally to the vertices and edges. When adding vertices and edges
  the value of the properties can be given.
  
  
  <H3>Refinement of</H3>
  
  <a href="./MutableGraph.html">MutableGraph</a> and
  <a href="./PropertyGraph.html">PropertyGraph</a>
  
  <H3>Notation</H3>
  
  
  <TABLE>
  
  <TR>
  <TD><tt>G</tt></TD>
  <TD>A type that is a model of Graph.</TD>
  </TR>
  
  <TR>
  <TD><tt>g</tt></TD>
  <TD>An object of type <tt>G</tt>.</TD>
  </TR>
  
  <TR>
  <TD><tt>e</tt></TD>
  <TD>An object of type <tt>boost::graph_traits&lt;G&gt;::edge_descriptor</tt>.</TD>
  </TR>
  
  <TR>
  <TD><tt>u,v</tt></TD>
  <TD>are objects of type <tt>boost::graph_traits&lt;G&gt;::vertex_descriptor</tt>.</TD>
  </TR>
  
  <TR>
  <TD><TT>ep</TT></TD><TD>is an object of type <TT>G::edge_property_type</TT></TD>
  </TR>
  
  <TR>
  <TD><TT>vp</TT></TD><TD>is an object of type <TT>G::vertex_property_type</TT></TD>
  </TR>
  
  </TABLE>
  
  <P>
  
  <H3>Associated Types</H3>
  
  <table border>
  
  <tr>
  <td>Edge Property Type </td>
  <td><TT>graph_traits&lt;G&gt;::edge_property_type</TT></td>
  </tr>
  
  <tr>
  <td>Vertex Property Type </td>
  <td><TT>graph_traits&lt;G&gt;::vertex_property_type</TT> </td>
  </tr>
  
  </table>
  
  <H3>Valid Expressions</h3>
  
  <table border>
  
  <tr>
  <TD><TT>add_edge(u,&nbsp;v,&nbsp;ep,&nbsp;g)</TT></TD>
  <TD>Inserts the edge <i>(u,v)</i> into the graph, and
  copies object <TT>ep</TT> into the property for that edge.<br>
  Return type: <TT>std::pair&lt;edge_descriptor, bool&gt;</TT></TD>
  </TR>
  
  <tr>
  <TD><TT>add_vertex(vp,&nbsp;g)</TT></TD>
  <TD>
  Add a new vertex to the graph and copy <TT>vp</TT> into the
  property for the new vertex. The <TT>vertex_descriptor</TT> for the new
  vertex is returned.<br>
  Return type: <TT>vertex_descriptor</TT>
  </TD>
  </TR>
  
  </TABLE>
  
  
  <H3>Models</H3>
  
  <UL>
  <LI><TT>adjacency_list</TT></LI>
  </UL>
  
  <H3>Concept Checking Class</H3>
  
  <P>
  <PRE>
    template &lt;class G&gt;
    struct MutablePropertyGraphConcept
    {
      typedef typename boost::graph_traits&lt;G&gt;::edge_descriptor edge_descriptor;
      void constraints() {
        BOOST_CONCEPT_ASSERT(( MutableGraphConcept&lt;G&gt; ));
        v = add_vertex(vp, g);
        p = add_edge(u, v, ep, g);
      }
      G g;
      std::pair&lt;edge_descriptor, bool&gt; p;
      typename boost::graph_traits&lt;G&gt;::vertex_descriptor u, v;
      typename boost::graph_traits&lt;G&gt;::vertex_property_type vp;
      typename boost::graph_traits&lt;G&gt;::edge_property_type ep;
    };
  </PRE>
  
  
  <br>
  <HR>
  <TABLE>
  <TR valign=top>
  <TD nowrap>Copyright &copy; 2000-2001</TD><TD>
  <A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>, Indiana University (<A HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)
  </TD></TR></TABLE>
  
  </BODY>
  </HTML>