2
0
mirror of https://github.com/boostorg/graph.git synced 2026-01-24 18:02:19 +00:00
Files
graph/doc/IncidenceGraph.html
2000-12-08 22:18:53 +00:00

182 lines
4.7 KiB
HTML

<HTML>
<!--
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 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. We make no
-- representations about the suitability of this software for any
-- purpose. It is provided "as is" without express or implied warranty.
-->
<Head>
<Title>IncidenceGraph</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>
<H1><A NAME="concept:IncidenceGraph"></A>
IncidenceGraph
</H1>
The IncidenceGraph concept provides an interface for
efficient access to the out-edges of each vertex 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 IncidenceGraph.</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>
<TR>
<TD><tt>v</tt></TD>
<TD>An object of type <tt>boost::graph_traits&lt;G&gt;::vertex_descriptor</tt>.</TD>
</TR>
</table>
<H3>Associated Types</H3>
<Table border>
<TR>
<TD>
<pre>boost::graph_traits&lt;G&gt;::out_edge_iterator</pre>
An out-edge iterator for a vertex <i>v</i> provides access to the
out-edges of the vertex. As such, the value type of an out-edge
iterator is the edge descriptor type of its graph. An out-edge
iterator must meet the requirements of <a
href="../../utility/MultiPassInputIterator.html">MultiPassInputIterator</a>.
</TD>
</TR>
<TR>
<TD><pre>boost::graph_traits&lt;G&gt;::degree_size_type</pre>
The unsigned intergral type used for representing the number
out-edges or incident edges of a vertex.
</TD>
</TR>
</table>
<h3>Valid Expressions</h3>
<Table border>
<tr>
<td><a name="sec:source"><TT>source(e, g)</TT></a></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><a name="sec:target"><TT>target(e, g)</TT></a></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>
<tr>
<td><a name="sec:out-edges"><TT>out_edges(v, g)</TT></a></TD>
<TD>Returns an iterator-range providing access to the
out-edges (for directed graphs) or incident edges (for
undirected graphs) of vertex <TT>v</TT> in graph <TT>g</TT>.<br>
Return type: <TT>std::pair&lt;out_edge_iterator, out_edge_iterator&gt;</TT>
</TD>
</tr>
<tr>
<TD><TT>out_degree(v, g)</TT></TD>
<TD>Returns the number of out-edges (for directed graphs) or the
number of incident edges (for undirected graphs) of vertex <TT>v</TT>
in graph <TT>g</TT>.<br>
Return type: <TT>degree_size_type</TT>
</TD>
</TR>
</TABLE>
<P>
<H3>Complexity guarantees</H3>
<P>
The <TT>source()</TT>, <TT>target()</TT>, and <TT>out_edges()</TT>
functions must all be constant time. The <tt>out_degree()</tt>
function must be linear in the number of out-edges.
<P>
<H3>See Also</H3>
<a href="./graph_concepts.html">Graph concepts</a>
<H3>Concept Checking Class</H3>
<PRE>
template &lt;class G&gt;
struct IncidenceGraphConcept
{
typedef typename boost::graph_traits&lt;G&gt;::out_edge_iterator out_edge_iterator;
void constraints() {
function_requires&lt; GraphConcept&lt;G&gt; &gt;();
function_requires&lt; MultiPassInputIteratorConcept&lt;out_edge_iterator&gt; &gt;();
p = out_edges(v, g);
e = *p.first;
u = source(e, g);
v = target(e, g);
}
void const_constraints(const G&amp; g) {
p = out_edges(v, g);
e = *p.first;
u = source(e, g);
v = target(e, g);
}
std::pair&lt;out_edge_iterator, out_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;
G g;
};
</PRE>
<br>
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy 2000</TD><TD>
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>,
Univ.of Notre Dame (<A
HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)<br>
<A HREF="../../../people/liequan_lee.htm">Lie-Quan Lee</A>, Univ.of Notre Dame (<A HREF="mailto:llee1@lsc.nd.edu">llee1@lsc.nd.edu</A>)<br>
<A HREF=http://www.lsc.nd.edu/~lums>Andrew Lumsdaine</A>,
Univ.of Notre Dame (<A
HREF="mailto:lums@lsc.nd.edu">lums@lsc.nd.edu</A>)
</TD></TR></TABLE>
</BODY>
</HTML>