Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

added boost

File size: 2.4 KB
Line 
1<HTML>
2<!--
3  -- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 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.  We make 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: opposite</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><A NAME="sec:opposite"></A>
23<TT>opposite</TT>
24</H1>
25
26<P>
27<DIV ALIGN="left">
28<TABLE CELLPADDING=3 border>
29
30<TR><TH ALIGN="LEFT"><B>Complexity:</B></TH>
31<TD ALIGN="LEFT"><i>O(1)</i>
32</TD>
33</TR>
34
35<TR><TH ALIGN="LEFT"><B>Where Defined:</B></TH>
36<TD ALIGN="LEFT">
37<a href="../../../boost/graph/graph_utility.hpp"><TT>boost/graph/graph_utility.hpp</TT></a>
38</TD>
39
40</TABLE>
41</DIV>
42
43<P>
44<PRE>
45  template &lt;class Graph&gt;
46  typename graph_traits&lt;Graph&gt;::vertex_descriptor
47  opposite(typename graph_traits&lt;Graph&gt;::edge_descriptor e,
48           typename graph_traits&lt;Graph&gt;::vertex_descriptor v,
49           const Graph& g)
50</pre>
51
52Given an edge and a vertex which must be incident to the edge, this
53function returns the opposite vertex. So if <tt>v</tt> is the source
54vertex, this function returns the target vertex. If <tt>v</tt> is the
55target, then this function returns the source vertex.
56
57<h3>Example</h3>
58
59<pre>
60edge_descriptor e;
61...
62vertex_descriptor u, v;
63tie(u, v) = incident(e, g);
64assert(v == opposite(e, u, g));
65assert(u == opposite(e, v, g));
66</pre>
67
68<br>
69<HR>
70<TABLE>
71<TR valign=top>
72<TD nowrap>Copyright &copy 2000-2001</TD><TD>
73<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>,
74Indiana University (<A
75HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)<br>
76<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>
77<A HREF=http://www.osl.iu.edu/~lums>Andrew Lumsdaine</A>,
78Indiana University (<A
79HREF="mailto:lums@osl.iu.edu">lums@osl.iu.edu</A>)
80</TD></TR></TABLE>
81
82</BODY>
83</HTML> 
Note: See TracBrowser for help on using the repository browser.