3 Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000
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)
10 <Title>Boost Graph Library: opposite
</Title>
11 <BODY BGCOLOR=
"#ffffff" LINK=
"#0000ee" TEXT=
"#000000" VLINK=
"#551a8b"
13 <IMG SRC=
"../../../boost.png"
14 ALT=
"C++ Boost" width=
"277" height=
"86">
18 <H1><A NAME=
"sec:opposite"></A>
24 <TABLE CELLPADDING=
3 border
>
26 <TR><TH ALIGN=
"LEFT"><B>Complexity:
</B></TH>
27 <TD ALIGN=
"LEFT"><i>O(
1)
</i>
31 <TR><TH ALIGN=
"LEFT"><B>Where Defined:
</B></TH>
33 <a href=
"../../../boost/graph/graph_utility.hpp"><TT>boost/graph/graph_utility.hpp
</TT></a>
41 template
<class Graph
>
42 typename graph_traits
<Graph
>::vertex_descriptor
43 opposite(typename graph_traits
<Graph
>::edge_descriptor e,
44 typename graph_traits
<Graph
>::vertex_descriptor v,
48 Given an edge and a vertex which must be incident to the edge, this
49 function returns the opposite vertex. So if
<tt>v
</tt> is the source
50 vertex, this function returns the target vertex. If
<tt>v
</tt> is the
51 target, then this function returns the source vertex.
58 vertex_descriptor u, v;
59 boost::tie(u, v) = incident(e, g);
60 assert(v == opposite(e, u, g));
61 assert(u == opposite(e, v, g));
68 <TD nowrap
>Copyright
© 2000-
2001</TD><TD>
69 <A HREF=
"http://www.boost.org/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=
"http://www.boost.org/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>)