File: EdgeListGraph.html

package info (click to toggle)
boost 1.27.0-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 19,908 kB
  • ctags: 26,546
  • sloc: cpp: 122,225; ansic: 10,956; python: 4,412; sh: 855; yacc: 803; makefile: 257; perl: 165; lex: 90; csh: 6
file content (182 lines) | stat: -rw-r--r-- 4,346 bytes parent folder | download
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
<HTML>
<!--
  -- Copyright (c) Jeremy Siek 2000
  --
  -- Permission to use, copy, modify, distribute and sell this software
  -- and its documentation for any purpose is hereby granted without fee,
  -- provided that the above copyright notice appears in all copies and
  -- that both that copyright notice and this permission notice appear
  -- in supporting documentation.  Silicon Graphics makes no
  -- representations about the suitability of this software for any
  -- purpose.  It is provided "as is" without express or implied warranty.
  -->
<Head>
<Title>EdgeListGraph</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b" 
        ALINK="#ff0000"> 
<IMG SRC="../../../c++boost.gif" 
     ALT="C++ Boost" width="277" height="86"> 

<BR Clear>


<H2><A NAME="concept:EdgeListGraph"></A>
EdgeListGraph
</H2>

The EdgeListGraph concept refines the <a href="./Graph.html">Graph</a>
concept, and adds the requirement for efficient access to all the
edges in the graph.


<H3>Refinement of</H3>

<a href="./Graph.html">Graph</a>


<h3>Notation</h3>

<Table>
<TR>
<TD><tt>G</tt></TD>
<TD>A type that is a model of EdgeListGraph.</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>

</table>

<H3>Associated Types</H3>

<table border>

<tr>
<td><pre>boost::graph_traits&lt;G&gt;::edge_iterator</pre>
An edge iterator (obtained via <TT>edges(g)</TT>) provides access to
all of the edges in a graph. An edge iterator type must meet the
requirements of <a
href="../../utility/MultiPassInputIterator.html">MultiPassInputIterator</a>.  The
value type of the edge iterator must be the same as the edge
descriptor of the graph.

<tr>
<td><pre>boost::graph_traits&lt;G&gt;::edges_size_type</pre>
The unsigned integer type used to represent the number of edges in the
graph.
</td>
</tr>

</table>

<h3>Valid Expressions</h3>

<table border>

<tr>
<TD><a name="sec:edges"><TT>edges(g)</TT></a></TD>
<TD>Returns an iterator-range providing access to all
     the edges in the graph <TT>g</TT>.<br>
Return type: <TT>std::pair&lt;edge_iterator, edge_iterator&gt;</TT>
</td>
</TR>

<tr>
<TD><TT>num_edges(g)</TT></TD>
<TD>Returns the number of edges in the graph <TT>g</TT>.<br>
Return type: <TT>edges_size_type</TT>
</td>
</TR>

<tr>
<TD><TT>source(e, g)</TT></TD>
<TD>
Returns the vertex descriptor for <i>u</i> of the edge <i>(u,v)</i>
represented by <TT>e</TT>.<br>
Return type: <TT>vertex_descriptor</TT>
</td>
</tr>

<tr>
<TD><TT>target(e, g)</TT></TD>
<TD>
Returns the vertex descriptor for 
<i>v</i> of the edge <i>(u,v)</i> represented by  <TT>e</TT>.<br>
Return type: <TT>vertex_descriptor</TT>
</TD>
</TR>

</TABLE>


<H3>Models</H3>

<UL>
<LI><a href="./adjacency_list.html"><TT>adjacency_list</TT></a></LI>
<LI><a href="./edge_list.html"><TT>edge_list</TT></a></LI>
</UL>


<H3>Complexity guarantees</H3>

The <TT>edges()</TT>, <TT>source()</TT>, and <TT>target()</TT> functions
must all return in constant time.


<H3>See Also</H3>

<a href="./graph_concepts.html">Graph concepts</a>

<H3>Concept Checking Class</H3>

<P>
<PRE>
  template &lt;class G&gt;
  struct EdgeListGraphConcept
  {
    typedef typename boost::graph_traits&lt;G&gt;::edge_iterator 
      edge_iterator;
    void constraints() {
      function_requires&lt; GraphConcept&lt;G&gt; &gt;();
      function_requires&lt; MultiPassInputIteratorConcept&lt;edge_iterator&gt; &gt;();

      p = edges(g);
      E = num_edges(g);
      e = *p.first;
      u = source(e, g);
      v = target(e, g);
      const_constraints(g);
    }
    void const_constraints(const G&amp; g) {
      p = edges(g);
      E = num_edges(g);
      e = *p.first;
      u = source(e, g);
      v = target(e, g);
    }
    std::pair&lt;edge_iterator,edge_iterator&gt; p;
    typename boost::graph_traits&lt;G&gt;::vertex_descriptor u, v;
    typename boost::graph_traits&lt;G&gt;::edge_descriptor e;
    typename boost::graph_traits&lt;G&gt;::edges_size_type E;
    G g;
  };
</PRE>


<br>
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy 2000-2001</TD><TD>
<A HREF="../../../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>