mirror of
https://github.com/boostorg/graph.git
synced 2026-01-24 18:02:19 +00:00
137 lines
3.5 KiB
HTML
137 lines
3.5 KiB
HTML
<HTML>
|
|
<!--
|
|
-- Copyright (c) Jeremy Siek 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. Silicon Graphics makes no
|
|
-- representations about the suitability of this software for any
|
|
-- purpose. It is provided "as is" without express or implied warranty.
|
|
-->
|
|
<Head>
|
|
<Title>VertexListGraph</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>
|
|
|
|
|
|
<H2><A NAME="concept:VertexListGraph">
|
|
VertexListGraph
|
|
</H2>
|
|
|
|
The VertexListGraph</I> concept refines the <a
|
|
href="./AdjacencyGraph.html">AdjacencyGraph</a> concept, and adds the
|
|
requirement for efficient traversal of all the vertices in the graph.
|
|
|
|
<H3>Refinement of</H3>
|
|
|
|
<a href="./AdjacencyGraph.html">AdjacencyGraph</a>
|
|
|
|
<H3>Associated Types</H3>
|
|
|
|
<Table border>
|
|
|
|
<TR>
|
|
<TD><tt>boost::graph_traits<G>::vertex_iterator</tt><br><br>
|
|
A vertex iterator (obtained via <TT>vertices(g)</TT>) provides access
|
|
to all of the vertices in a graph. A vertex iterator type must meet
|
|
the requirements of <a
|
|
href="../../utility/MultiPassInputIterator.html">MultiPassInputIterator</a>. The
|
|
value type of the vertex iterator must be the vertex descriptor of the
|
|
graph.
|
|
</TD>
|
|
</TR>
|
|
|
|
<tr>
|
|
<td><tt>boost::graph_traits<G>::vertices_size_type</tt><br><br>
|
|
The unsigned integer type used to represent the number of vertices
|
|
in the graph.
|
|
</td>
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<h3>Valid Expressions</h3>
|
|
|
|
<table border>
|
|
|
|
<tr>
|
|
<th>Name</th><th>Expression</th><th>Return Type</th><th>Description</th>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>Vertex Set of the Graph</td>
|
|
<td><a name="sec:vertices"><TT>vertices(g)</TT></a></TD>
|
|
<TD><TT>std::pair<vertex_iterator, vertex_iterator></TT></TD>
|
|
<TD>
|
|
Returns an iterator-range providing access to all the vertices in the
|
|
graph<TT>g</TT>.
|
|
</TD>
|
|
</TR>
|
|
|
|
<tr>
|
|
<td>Number of Vertices in the Graph </td>
|
|
<td><TT>num_vertices(g)</TT></TD>
|
|
<TD><TT>vertices_size_type</TT></TD>
|
|
<TD>Returns the number of vertices in the graph <TT>g</TT>.</TD>
|
|
</TR>
|
|
|
|
</TABLE>
|
|
|
|
|
|
<H3>Complexity guarantees</H3>
|
|
|
|
<P>
|
|
The <TT>vertices()</TT> function must return in constant time.
|
|
|
|
<H3>See Also</H3>
|
|
|
|
<a href="./graph_concepts.html">Graph concepts</a>
|
|
|
|
|
|
<H3>Concept Checking Class</H3>
|
|
|
|
<P>
|
|
<PRE>
|
|
template <class G>
|
|
struct VertexListGraphConcept
|
|
{
|
|
typedef typename boost::graph_traits<G>::vertex_iterator
|
|
vertex_iterator;
|
|
void constraints() {
|
|
function_requires< AdjacencyGraphConcept<G> >();
|
|
function_requires< MultiPassInputIteratorConcept<vertex_iterator> >();
|
|
|
|
p = vertices(g);
|
|
V = num_vertices(g);
|
|
v = *p.first;
|
|
const_constraints(g);
|
|
}
|
|
void const_constraints(const G& g) {
|
|
p = vertices(g);
|
|
V = num_vertices(g);
|
|
v = *p.first;
|
|
}
|
|
std::pair<vertex_iterator, vertex_iterator> p;
|
|
typename boost::graph_traits<G>::vertex_descriptor v;
|
|
typename boost::graph_traits<G>::vertices_size_type V;
|
|
G g;
|
|
};
|
|
</PRE>
|
|
|
|
<br>
|
|
<HR>
|
|
<TABLE>
|
|
<TR valign=top>
|
|
<TD nowrap>Copyright © 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>)
|
|
</TD></TR></TABLE>
|
|
|
|
</BODY>
|
|
</HTML>
|