incident.html 2.1 KB

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