1 | <HTML> |
---|
2 | <!-- |
---|
3 | -- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000 |
---|
4 | -- |
---|
5 | -- Distributed under the Boost Software License, Version 1.0. |
---|
6 | -- (See accompanying file LICENSE_1_0.txt or copy at |
---|
7 | -- http://www.boost.org/LICENSE_1_0.txt) |
---|
8 | --> |
---|
9 | <Head> |
---|
10 | <Title>Boost Graph Library: incident</Title> |
---|
11 | <BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b" |
---|
12 | ALINK="#ff0000"> |
---|
13 | <IMG SRC="../../../boost.png" |
---|
14 | ALT="C++ Boost" width="277" height="86"> |
---|
15 | |
---|
16 | <BR Clear> |
---|
17 | |
---|
18 | <H1><A NAME="sec:incident"></A> |
---|
19 | <TT>incident</TT> |
---|
20 | </H1> |
---|
21 | |
---|
22 | <P> |
---|
23 | <DIV ALIGN="left"> |
---|
24 | <TABLE CELLPADDING=3 border> |
---|
25 | |
---|
26 | <TR><TH ALIGN="LEFT"><B>Complexity:</B></TH> |
---|
27 | <TD ALIGN="LEFT"><i>O(1)</i> |
---|
28 | </TD> |
---|
29 | </TR> |
---|
30 | |
---|
31 | <TR><TH ALIGN="LEFT"><B>Where Defined:</B></TH> |
---|
32 | <TD ALIGN="LEFT"> |
---|
33 | <a href="../../../boost/graph/graph_utility.hpp"><TT>boost/graph/graph_utility.hpp</TT></a> |
---|
34 | </TD> |
---|
35 | |
---|
36 | </TABLE> |
---|
37 | </DIV> |
---|
38 | |
---|
39 | <P> |
---|
40 | <PRE> |
---|
41 | template <class Graph> |
---|
42 | std::pair<typename graph_traits<Graph>::vertex_descriptor, |
---|
43 | typename graph_traits<Graph>::vertex_descriptor> |
---|
44 | incident(typename graph_traits<Graph>::edge_descriptor e, Graph& g) |
---|
45 | </pre> |
---|
46 | |
---|
47 | This function takes and edge descriptor and returns the pair of |
---|
48 | vertices that are <i>incident</i> to the edge. For directed graphs, |
---|
49 | the <tt>first</tt> vertex is the source and the <tt>second</tt> vertex |
---|
50 | is the target. This function is equivalent to the expression |
---|
51 | <tt>std::make_pair(source(e, g), target(e, g))</tt>. |
---|
52 | |
---|
53 | |
---|
54 | <h3>Example</h3> |
---|
55 | |
---|
56 | <pre> |
---|
57 | edge_descriptor e; |
---|
58 | vertex_descriptor u, v; |
---|
59 | ... |
---|
60 | tie(u, v) = incident(e, g); |
---|
61 | </pre> |
---|
62 | |
---|
63 | |
---|
64 | <br> |
---|
65 | <HR> |
---|
66 | <TABLE> |
---|
67 | <TR valign=top> |
---|
68 | <TD nowrap>Copyright © 2000-2001</TD><TD> |
---|
69 | <A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, |
---|
70 | Indiana University (<A |
---|
71 | HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)<br> |
---|
72 | <A HREF="../../../people/liequan_lee.htm">Lie-Quan Lee</A>, Indiana University (<A HREF="mailto:llee@cs.indiana.edu">llee@cs.indiana.edu</A>)<br> |
---|
73 | <A HREF=http://www.osl.iu.edu/~lums>Andrew Lumsdaine</A>, |
---|
74 | Indiana University (<A |
---|
75 | HREF="mailto:lums@osl.iu.edu">lums@osl.iu.edu</A>) |
---|
76 | </TD></TR></TABLE> |
---|
77 | |
---|
78 | </BODY> |
---|
79 | </HTML> |
---|