Author: alai04 Date: Wed Jul 15 23:13:51 2009 New Revision: 281 Modified: trunk/libs/graph/doc/AStarVisitor.html trunk/libs/graph/doc/BFSVisitor.html trunk/libs/graph/doc/BellmanFordVisitor.html trunk/libs/graph/doc/DFSVisitor.html trunk/libs/graph/doc/DijkstraVisitor.html trunk/libs/graph/doc/EventVisitor.html trunk/libs/graph/doc/EventVisitorList.html trunk/libs/graph/doc/PlanarFaceVisitor.html trunk/libs/graph/doc/TSPTourVisitor.html trunk/libs/graph/doc/adjacency_list.html trunk/libs/graph/doc/adjacency_matrix.html trunk/libs/graph/doc/astar_visitor.html trunk/libs/graph/doc/bellman_visitor.html trunk/libs/graph/doc/bfs_visitor.html trunk/libs/graph/doc/compressed_sparse_row.html trunk/libs/graph/doc/dfs_visitor.html trunk/libs/graph/doc/dijkstra_visitor.html trunk/libs/graph/doc/distance_recorder.html trunk/libs/graph/doc/predecessor_recorder.html trunk/libs/graph/doc/property_writer.html trunk/libs/graph/doc/time_stamper.html trunk/libs/graph/doc/tsp_tour_len_visitor.html trunk/libs/graph/doc/tsp_tour_visitor.html trunk/libs/graph/doc/visitor_concepts.html Log: graph 库文档第14-17章 Modified: trunk/libs/graph/doc/AStarVisitor.html ============================================================================== --- trunk/libs/graph/doc/AStarVisitor.html (original) +++ trunk/libs/graph/doc/AStarVisitor.html Wed Jul 15 23:13:51 2009 @@ -1,213 +1,176 @@ -<HTML> -<!-- +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">+<html><head><meta content="text/html; charset=UTF-8" http-equiv="content-type"><!--
-- Copyright (c) 2004 Kris Beevers -- -- Distributed under the Boost Software License, Version 1.0. -- (See accompanying file LICENSE_1_0.txt or copy at -- http://www.boost.org/LICENSE_1_0.txt) --> -<Head> -<Title>Boost Graph Library: AStarVisitor</Title> -<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b" - ALINK="#ff0000"> -<IMG SRC="../../../boost.png" - ALT="C++ Boost" width="277" height="86"> +<title>Boost Graph Library: AStarVisitor</title></head>+<body alink="#ff0000" bgcolor="#ffffff" link="#0000ee" text="#000000" vlink="#551a8b">
+<img src="../../../boost.png" alt="C++ Boost" height="86" width="277"> -<BR Clear> +<br clear=""> -<H1>AStar Visitor Concept</H1> +<h1>AStar Visitor Concept A星遍历器概念</h1> -This concept defines the visitor interface for <a -href="./astar_search.html"><tt>astar_search()</tt></a>. Users can -define a class with the AStar Visitor interface and pass an object of -the class to <tt>astar_search()</tt>, thereby augmenting the actions -taken during the graph search.+这个概念定义了用于 <a href="./astar_search.html"><tt>astar_search()</tt></a> 的遍历器接口。用户可 以定义一个具有AStar遍历器接口的类,将传递一个该类的对象给 <tt>astar_search()</tt>,从而在图搜索的期间增加动作。
-<h3>Refinement of</h3> +<h3>Refinement of 精化自</h3> -<a href="../../utility/CopyConstructible.html">Copy Constructible</a> -(copying a visitor should be a lightweight operation).+<a href="../../utility/CopyConstructible.html">可复制构造 Copy Constructible</a>
+(遍历器的复制应该是一个轻量级的操作)。 -<h3>Notation</h3> +<h3>Notation 记号</h3> -<Table> -<TR> -<TD><tt>V</tt></TD> -<TD>A type that is a model of AStar Visitor.</TD> -</TR> - -<TR> -<TD><tt>vis</tt></TD> -<TD>An object of type <tt>V</tt>.</TD> -</TR> - -<TR> -<TD><tt>G</tt></TD> -<TD>A type that is a model of Graph.</TD> -</TR> +<table> +<tbody><tr> +<td><tt>V</tt></td> +<td>一个以 AStar 遍历器为模的类型。</td> +</tr> -<TR> -<TD><tt>g</tt></TD> -<TD>An object of type <tt>G</tt>.</TD> -</TR> +<tr> +<td><tt>vis</tt></td> +<td>一个类型为 <tt>V</tt> 的对象。</td> +</tr> -<TR> -<TD><tt>e</tt></TD>-<TD>An object of type <tt>boost::graph_traits<G>::edge_descriptor</tt>.</TD>
-</TR> +<tr> +<td><tt>G</tt></td> +<td>一个以 Graph 为模的类型。</td> +</tr> -<TR> -<TD><tt>s,u,v</tt></TD>-<TD>An object of type <tt>boost::graph_traits<G>::vertex_descriptor</tt>.</TD>
-</TR> +<tr> +<td><tt>g</tt></td> +<td>一个类型为 <tt>G</tt> 的对象。</td> +</tr> -<TR> -<TD><tt>d</tt></TD> -<TD>An object of type <tt>DistanceMap</tt>.</TD> -</TR> +<tr> +<td><tt>e</tt></td>+<td>一个类型为 <tt>boost::graph_traits<G>::edge_descriptor</tt> 的对象。</td>
+</tr> -<TR> -<TD><tt>WeightMap</tt></TD> -<TD>A type that is a model of <a -href="../../property_map/ReadablePropertyMap.html">Readable Property -Map</a>.</TD> -</TR> +<tr> +<td><tt>s,u,v</tt></td>+<td>一个类型为 <tt>boost::graph_traits<G>::vertex_descriptor</tt> 的对象。</td>
+</tr> -<TR> -<TD><tt>w</tt></TD> -<TD>An object of type <tt>WeightMap</tt>.</TD> -</TR> +<tr> +<td><tt>d</tt></td> +<td>一个类型为 <tt>DistanceMap</tt> 的对象。</td> +</tr> -</table> +<tr> +<td><tt>WeightMap</tt></td>+<td>一个以 <a href="../../property_map/ReadablePropertyMap.html">可读属性映 射Readable Property
+Map</a> 为模的类型。</td> +</tr> -<h3>Associated Types</h3> +<tr> +<td><tt>w</tt></td> +<td>一个类型为 <tt>WeightMap</tt> 的对象。</td> +</tr> -none -<p> +</tbody></table> -<h3>Valid Expressions</h3> +<h3>Associated Types 关联类型</h3>无 +<h3>Valid Expressions 有效表达式</h3> -<table border> -<tr> +<table border="1"> +<tbody><tr> <th>Name</th><th>Expression</th><th>Return Type</th><th>Description</th> </tr> <tr> -<td>Initialize Vertex</td> +<td>顶点初始化</td> <td><tt>vis.initialize_vertex(u, g)</tt></td> <td><tt>void</tt></td> -<td> -This is invoked on each vertex of the graph when it is first -initialized (i.e., when its property maps are initialized). +<td>在首次初始化时(即初始化属性映射时)对图中每个顶点调用。 </td> </tr> <tr> -<td>Discover Vertex</td> +<td>顶点发现</td> <td><tt>vis.discover_vertex(u, g)</tt></td> <td><tt>void</tt></td> -<td> -This is invoked when a vertex is first discovered and is added to the -OPEN list. +<td>当某个顶点被首次发现并增加至 +OPEN 列表时对其调用。 </td> </tr> <tr> -<td>Examine Vertex</td> +<td>顶点检查</td> <td><tt>vis.examine_vertex(u, g)</tt></td> <td><tt>void</tt></td> -<td> -This is invoked on a vertex as it is popped from the queue (i.e. it -has the lowest cost on the OPEN list). This happens immediately before -<tt>examine_edge()</tt> is invoked on each of the out-edges of vertex -<tt>u</tt>.+<td>当某个顶点从队列中弹出时(即它具有 OPEN 列表中的最小代价)对其调用。在对 顶点 <tt>u</tt> 的每条出边调用 <tt>examine_edge()</tt> 前发生。
</td> </tr> <tr> -<td>Examine Edge</td> +<td>边检查</td> <td><tt>vis.examine_edge(e, g)</tt></td> <td><tt>void</tt></td> -<td> -This is invoked on every out-edge of each vertex after it is -examined. +<td>在每个顶点被检查后,对其每条出边调用。 </td> </tr> <tr> -<td>Edge Relaxed</td> +<td>边松驰</td> <td><tt>vis.edge_relaxed(e, g)</tt></td> <td><tt>void</tt></td> -<td> -Upon examination, if the following condition holds then the edge is -relaxed (the distance of its target vertex is reduced) and this method -is invoked:+<td>在检查的时候,如果满足以下条件,则该边被松驰(其目标顶点的距离被减少 ),且调用该方法:
<blockquote> -<pre> -tie(u, s) = incident(e, g); -D d_u = get(d, u), d_v = get(d, s); -W w_e = get(w, e); -assert(compare(combine(d_u, w_e), d_s)); -</pre>+<pre>tie(u, s) = incident(e, g);<br>D d_u = get(d, u), d_v = get(d, s);<br>W w_e = get(w, e);<br>assert(compare(combine(d_u, w_e), d_s));<br></pre>
</blockquote> </td> </tr> <tr> -<td>Edge Not Relaxed</td> +<td>边未松驰</td> <td><tt>vis.edge_not_relaxed(e, g)</tt></td> <td><tt>void</tt></td> -<td> -Upon examination, if an edge is not relaxed (see above), then this -method is invoked. +<td>在检查的时候,如果一条边不被松驰(见上),则调用该方法。 </td> </tr> <tr> -<td>Black Target</td> +<td>黑色目标</td> <td><tt>vis.black_target(e, g)</tt></td> <td><tt>void</tt></td> -<td> -This is invoked when a vertex that is on the CLOSED list is -``rediscovered'' via a more efficient path, and is re-added to the -OPEN list. +<td>当一个位于 CLOSED 列表中的顶点被更高效的路径"重新发现"并重新加入到 +OPEN 列表中时调用。 </td> </tr> <tr> -<td>Finish Vertex</td> +<td>顶点结束</td> <td><tt>vis.finish_vertex(u, g)</tt></td> <td><tt>void</tt></td> -<td> -This is invoked on a vertex when it is added to the CLOSED list, which -happens after all of its out edges have been examined. +<td>当一个顶点被加至 CLOSED 列表时调用,在其所有出边都检查完毕时发生。 </td> </tr> -</table> +</tbody></table> -<h3>Models</h3> +<h3>Models 模型</h3> <ul> <li><a href="./astar_visitor.html"><tt>astar_visitor</tt></a> -</ul> +</li></ul> -<h3>See also</h3> +<h3>See also 参见</h3> -<a href="./visitor_concepts.html">Visitor concepts</a> +<a href="./visitor_concepts.html">遍历器概念 Visitor concepts</a> <br> -<HR> -<TABLE> -<TR valign=top> -<TD nowrap>Copyright © 2004</TD><TD> -<A HREF="http://www.cs.rpi.edu/~beevek/";>Kristopher Beevers</A>, -Rensselaer Polytechnic Institute (<A -HREF="mailto:beevek@xxxxxxxxxx";>beevek@xxxxxxxxxx</A>) -</TD></TR></TABLE> +<hr> +<table> +<tbody><tr valign="top"> +<td nowrap="nowrap">Copyright (c) 2004</td><td> +<a href="http://www.cs.rpi.edu/%7Ebeevek/";>Kristopher Beevers</a>,+Rensselaer Polytechnic Institute (<a href="mailto:beevek@xxxxxxxxxx";>beevek@xxxxxxxxxx</a>)
+</td></tr></tbody></table> -</BODY> -</HTML> +</body></html> \ No newline at end of file Modified: trunk/libs/graph/doc/BFSVisitor.html ============================================================================== --- trunk/libs/graph/doc/BFSVisitor.html (original) +++ trunk/libs/graph/doc/BFSVisitor.html Wed Jul 15 23:13:51 2009 @@ -1,220 +1,168 @@ -<HTML> -<!-- +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">+<html><head><meta content="text/html; charset=UTF-8" http-equiv="content-type"><!--
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000 -- -- Distributed under the Boost Software License, Version 1.0. -- (See accompanying file LICENSE_1_0.txt or copy at -- http://www.boost.org/LICENSE_1_0.txt) --> -<Head> -<Title>Boost Graph Library: BFSVisitor</Title> -<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b" - ALINK="#ff0000"> -<IMG SRC="../../../boost.png" - ALT="C++ Boost" width="277" height="86"> +<title>Boost Graph Library: BFSVisitor</title></head> -<BR Clear>+<body alink="#ff0000" bgcolor="#ffffff" link="#0000ee" text="#000000" vlink="#551a8b">
+<img src="../../../boost.png" alt="C++ Boost" height="86" width="277"> -<H1><img src="figs/python.gif" alt="(Python)"/>BFS Visitor Concept</H1> +<br clear=""> -This concept defines the visitor interface for <a -href="./breadth_first_search.html"><tt>breadth_first_search()</tt></a>. -Users can define a class with the BFS Visitor interface and pass and -object of the class to <tt>breadth_first_search()</tt>, thereby -augmenting the actions taken during the graph search.+<h1><img src="figs/python.gif" alt="(Python)">BFS Visitor Concept 广度优先 遍历器概念</h1>这个概念为 <a href="./breadth_first_search.html"><tt>breadth_first_search()</tt></a> 定义 了遍历器接口。用户可以定义一个具有BFS遍历器接口的类,并将该类的一个对象传递 给 <tt>breadth_first_search()</tt>,从而在图搜索期间增加一些动作。
-<h3>Refinement of</h3> +<h3>Refinement of 精化自</h3> -<a href="../../utility/CopyConstructible.html">Copy Constructible</a> -(copying a visitor should be a lightweight operation).+<a href="../../utility/CopyConstructible.html">可复制构造 Copy Constructible</a>
+(遍历器的复制应该是一个轻量级的操作)。 -<h3>Notation</h3> +<h3>Notation 记号</h3> -<Table> -<TR> -<TD><tt>V</tt></TD> -<TD>A type that is a model of BFS Visitor.</TD> -</TR> - -<TR> -<TD><tt>vis</tt></TD> -<TD>An object of type <tt>V</tt>.</TD> -</TR> - -<TR> -<TD><tt>G</tt></TD> -<TD>A type that is a model of Graph.</TD> -</TR> +<table> +<tbody><tr> +<td><tt>V</tt></td> +<td>一个以BFS遍历器为模的类型。</td> +</tr> -<TR> -<TD><tt>g</tt></TD> -<TD>An object of type <tt>G</tt>.</TD> -</TR> +<tr> +<td><tt>vis</tt></td> +<td>一个类型为 <tt>V</tt> 的对象。</td> +</tr> -<TR> -<TD><tt>e</tt></TD>-<TD>An object of type <tt>boost::graph_traits<G>::edge_descriptor</tt>.</TD>
-</TR> +<tr> +<td><tt>G</tt></td> +<td>一个以 Graph 为模的类型。</td> +</tr> -<TR> -<TD><tt>s,u</tt></TD>-<TD>An object of type <tt>boost::graph_traits<G>::vertex_descriptor</tt>.</TD>
-</TR> +<tr> +<td><tt>g</tt></td> +<td>一个类型为 <tt>G</tt> 的对象。</td> +</tr> -</table> +<tr> +<td><tt>e</tt></td>+<td>一个类型为 <tt>boost::graph_traits<G>::edge_descriptor</tt> 的对 象。</td>
+</tr> -<h3>Associated Types</h3> +<tr> +<td><tt>s,u</tt></td>+<td>一个类型为 <tt>boost::graph_traits<G>::vertex_descriptor</tt> 的 对象。</td>
+</tr> -none -<p> +</tbody></table> -<h3>Valid Expressions</h3> +<h3>Associated Types 关联类型</h3>无 +<h3>Valid Expressions 有效表达式</h3> -<table border> -<tr> +<table border="1"> +<tbody><tr> <th>Name</th><th>Expression</th><th>Return Type</th><th>Description</th> </tr> <tr> -<td>Initialize Vertex</td> +<td>顶点初始化</td> <td><tt>vis.initialize_vertex(s, g)</tt></td> <td><tt>void</tt></td> -<td> -This is invoked on every vertex of the graph before the start of the -graph search. +<td>在开始图搜索之前,对图中的每个点调用。 </td> </tr> <tr> -<td>Discover Vertex</td> +<td>发现顶点</td> <td><tt>vis.discover_vertex(u, g)</tt></td> <td><tt>void</tt></td> -<td> -This is invoked when a vertex is encountered for the first time. +<td>当首次遇到某个顶点时调用。 </td> </tr> <tr> -<td>Examine Vertex</td> +<td>顶点检查</td> <td><tt>vis.examine_vertex(u, g)</tt></td> <td><tt>void</tt></td> -<td> -This is invoked on a vertex as it is popped from the queue. This -happens immediately before <tt>examine_edge()</tt> is invoked -on each of the out-edges of vertex <tt>u</tt>.+<td>当某个顶点从队列中弹出时调用。在对顶点 <tt>u</tt> 的每条出边调用 <tt>examine_edge()</tt> 前发生。
</td> </tr> <tr> -<td>Examine Edge</td> +<td>边检查</td> <td><tt>vis.examine_edge(e, g)</tt></td> <td><tt>void</tt></td> -<td> -This is invoked on every out-edge of each vertex after it is discovered. +<td>在每个顶点被发现后,对其每条出边调用。 </td> </tr> <tr> -<td>Tree Edge</td> +<td>树边</td> <td><tt>vis.tree_edge(e, g)</tt></td> <td><tt>void</tt></td> -<td> -This is invoked on each edge as it becomes a member of the edges that -form the search tree.</td> +<td>在某条边成为搜索树的边成员时调用。</td> </tr> <tr> -<td>Non-Tree Edge</td> +<td>非树边</td> <td><tt>vis.non_tree_edge(e, g)</tt></td> <td><tt>void</tt></td> -<td> -This is invoked on back or cross edges for directed graphs and cross -edges for undirected graphs. +<td>对有向图的反向边或交叉边以及无向图的交叉边调用。 </td> </tr> <tr> -<td>Gray Target</td> +<td>灰色目标</td> <td><tt>vis.gray_target(e, g)</tt></td> <td><tt>void</tt></td> -<td> -This is invoked on the subset of non-tree edges who's target vertex is -colored gray at the time of examination. The color gray indicates -that the vertex is currently in the queue.+<td>对非树边的一个子集调用,该子集由检查时目标顶点为灰色的边组成。灰色表示 该顶点当前在队列中。
</td> </tr> <tr> -<td>Black Target</td> +<td>黑色目标</td> <td><tt>vis.black_target(e, g)</tt></td> <td><tt>void</tt></td> -<td> -This is invoked on the subset of non-tree edges who's target vertex is -colored black at the time of examination. The color black indicates -that the vertex has been removed from the queue.+<td>对非树边的一个子集调用,该子集由检查时目标顶点为黑色的边组成。黑色表示 该顶点已从队列中移除。
</td> </tr> <tr> -<td>Finish Vertex</td> +<td>结束顶点</td> <td><tt>vis.finish_vertex(u, g)</tt></td> <td><tt>void</tt></td> -<td> -This invoked on a vertex after all of its out edges have been added to the -search tree and all of the adjacent vertices have been discovered -(but before the out-edges of the adjacent vertices have been examined).+<td>在某个顶点的所有出边被加至搜索树且所有邻接顶点被发现后(但在邻接顶点的出 边被检查之前)对该顶点调用。
</td> </tr> -</table> +</tbody></table> -<h3>Models</h3> +<h3>Models 模型</h3> <ul> <li><a href="./bfs_visitor.html"><tt>bfs_visitor</tt></a> -</ul> +</li></ul> ++<a name="python"></a><h3>Python</h3>要在Python中实现一个 <tt>BFSVisitor</tt>概念的模型,应创建一个从图的 <tt>BFSVisitor</tt> 类型(名 为 <tt><i>GraphType</i>.BFSVisitor</tt>)派生的新类。事件和语法与C++中的遍历 器相同。以下是一个
+Python <tt>bgl.Graph</tt> 图类型的例子: -<a name="python"></a><h3>Python</h3> -To implement a model of the <tt>BFSVisitor</tt> concept in Python, -create a new class that derives from the <tt>BFSVisitor</tt> type of -the graph, which will be -named <tt><i>GraphType</i>.BFSVisitor</tt>. The events and syntax are -the same as with visitors in C++. Here is an example for the -Python <tt>bgl.Graph</tt> graph type: - -<pre> -class count_tree_edges_bfs_visitor(bgl.Graph.BFSVisitor): - def __init__(self, name_map): - bgl.Graph.BFSVisitor.__init__(self) - self.name_map = name_map - - def tree_edge(self, e, g): - (u, v) = (g.source(e), g.target(e)) - print "Tree edge ", - print self.name_map[u], - print " -> ", - print self.name_map[v] -</pre>+<pre>class count_tree_edges_bfs_visitor(bgl.Graph.BFSVisitor):<br> def __init__(self, name_map):<br> bgl.Graph.BFSVisitor.__init__(self)<br> self.name_map = name_map<br><br> def tree_edge(self, e, g):<br> (u, v) = (g.source(e), g.target(e))<br> print "Tree edge ",<br> print self.name_map[u],<br> print " -> ",<br> print self.name_map[v]<br></pre>
-<h3>See also</h3> +<h3>See also 参见</h3> -<a href="./visitor_concepts.html">Visitor concepts</a> +<a href="./visitor_concepts.html">遍历器概念 Visitor concepts</a> <br> -<HR> -<TABLE> -<TR valign=top> -<TD nowrap>Copyright © 2000-2001</TD><TD> -<A HREF="http://www.boost.org/people/jeremy_siek.htm";>Jeremy Siek</A>, -Indiana University (<A -HREF="mailto:jsiek@xxxxxxxxxx";>jsiek@xxxxxxxxxx</A>)<br>-<A HREF="http://www.boost.org/people/liequan_lee.htm";>Lie-Quan Lee</A>, Indiana University (<A HREF="mailto:llee@xxxxxxxxxxxxxx";>llee@xxxxxxxxxxxxxx</A>)<br>
-<A HREF="http://www.osl.iu.edu/~lums";>Andrew Lumsdaine</A>, -Indiana University (<A -HREF="mailto:lums@xxxxxxxxxx";>lums@xxxxxxxxxx</A>) -</TD></TR></TABLE> +<hr> +<table> +<tbody><tr valign="top"> +<td nowrap="nowrap">Copyright (c) 2000-2001</td><td> +<a href="http://www.boost.org/people/jeremy_siek.htm";>Jeremy Siek</a>,+Indiana University (<a href="mailto:jsiek@xxxxxxxxxx";>jsiek@xxxxxxxxxx</a>)<br> +<a href="http://www.boost.org/people/liequan_lee.htm";>Lie-Quan Lee</a>, Indiana University (<a href="mailto:llee@xxxxxxxxxxxxxx";>llee@xxxxxxxxxxxxxx</a>)<br>
+<a href="http://www.osl.iu.edu/%7Elums";>Andrew Lumsdaine</a>, +Indiana University (<a href="mailto:lums@xxxxxxxxxx";>lums@xxxxxxxxxx</a>) +</td></tr></tbody></table> -</BODY> -</HTML> +</body></html> \ No newline at end of file Modified: trunk/libs/graph/doc/BellmanFordVisitor.html ============================================================================== --- trunk/libs/graph/doc/BellmanFordVisitor.html (original) +++ trunk/libs/graph/doc/BellmanFordVisitor.html Wed Jul 15 23:13:51 2009 @@ -1,97 +1,82 @@ -<HTML> -<!-- +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">+<html><head><meta content="text/html; charset=UTF-8" http-equiv="content-type"><!--
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000 -- -- Distributed under the Boost Software License, Version 1.0. -- (See accompanying file LICENSE_1_0.txt or copy at -- http://www.boost.org/LICENSE_1_0.txt) --> -<Head> -<Title>Boost Graph Library: Bellman Ford Visitor</Title> -<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b" - ALINK="#ff0000"> -<IMG SRC="../../../boost.png" - ALT="C++ Boost" width="277" height="86"> +<title>Boost Graph Library: Bellman Ford Visitor</title></head>+<body alink="#ff0000" bgcolor="#ffffff" link="#0000ee" text="#000000" vlink="#551a8b">
+<img src="../../../boost.png" alt="C++ Boost" height="86" width="277"> -<BR Clear> +<br clear="">-<H1><img src="figs/python.gif" alt="(Python)"/>Bellman Ford Visitor Concept</H1> +<h1><img src="figs/python.gif" alt="(Python)">Bellman Ford 遍历器概念 </h1>这个概念定义了用于 <a href="./bellman_ford_shortest.html"><tt>bellman_ford_shortest_paths()</tt></a> 的遍历器接口。用户可以定义一个具有Bellman Ford遍历器接口的类,并将该类的一个 对象传递给 <tt>bellman_ford_shortest_paths()</tt>,从而在图搜索期间增加动 作。
-This concept defines the visitor interface for <a -href="./bellman_ford_shortest.html"><tt>bellman_ford_shortest_paths()</tt></a>. -Users can define a class with the Bellman Ford Visitor interface and -pass and object of the class to <tt>bellman_ford_shortest_paths()</tt>, -thereby augmenting the actions taken during the graph search. +<h3>Refinement of 精代自</h3> -<h3>Refinement of</h3>+<a href="../../utility/CopyConstructible.html">可复制构造 Copy Constructible</a>
+(遍历器的复制应该是一个轻量级的操作)。 -<a href="../../utility/CopyConstructible.html">Copy Constructible</a> -(copying a visitor should be a lightweight operation). +<h3>Notation 记号</h3> -<h3>Notation</h3> - -<Table> -<TR> -<TD><tt>V</tt></TD> -<TD>A type that is a model of Bellman Ford Visitor.</TD> -</TR> - -<TR> -<TD><tt>vis</tt></TD> -<TD>An object of type <tt>V</tt>.</TD> -</TR> - -<TR> -<TD><tt>G</tt></TD> -<TD>A type that is a model of Graph.</TD> -</TR> +<table> +<tbody><tr> +<td><tt>V</tt></td> +<td>一个以Bellman Ford遍历器为模的类型。</td> +</tr> -<TR> -<TD><tt>g</tt></TD> -<TD>An object of type <tt>G</tt>.</TD> -</TR> +<tr> +<td><tt>vis</tt></td> +<td>一个类型为 <tt>V</tt> 的对象。</td> +</tr> -<TR> -<TD><tt>e</tt></TD>-<TD>An object of type <tt>boost::graph_traits<G>::edge_descriptor</tt>.</TD>
-</TR> +<tr> +<td><tt>G</tt></td> +<td>一个以 Graph 为模的类型。</td> +</tr> -<TR> -<TD><tt>s,u</tt></TD>-<TD>An object of type <tt>boost::graph_traits<G>::vertex_descriptor</tt>.</TD>
-</TR> +<tr> +<td><tt>g</tt></td> +<td>一个类型为 <tt>G</tt> 的对象。</td> +</tr> -</table> +<tr> +<td><tt>e</tt></td>+<td>一个类型为 <tt>boost::graph_traits<G>::edge_descriptor</tt> 的对 象。</td>
+</tr> -<h3>Associated Types</h3> +<tr> +<td><tt>s,u</tt></td>+<td>一个类型为 <tt>boost::graph_traits<G>::vertex_descriptor</tt> 的 对象。</td>
+</tr> -none -<p> +</tbody></table> -<h3>Valid Expressions</h3> +<h3>Associated Types 关联类型</h3>无 +<h3>Valid Expressions 有效表达式</h3> -<table border> -<tr> +<table border="1"> +<tbody><tr> <th>Name</th><th>Expression</th><th>Return Type</th><th>Description</th> </tr> <tr> -<td>Examine Edge</td> +<td>边检查</td> <td><tt>vis.examine_edge(e, g)</tt></td> <td><tt>void</tt></td> <td> -This is invoked on every edge in the graph <tt>num_vertices(g)</tt> times. +对图中每条边调用,共 <tt>num_vertices(g)</tt> 次。 </td> </tr> <tr> -<td>Edge Relaxed</td> +<td>边松驰</td> <td><tt>vis.edge_relaxed(e, g)</tt></td> <td><tt>void</tt></td> -<td> -Upon examination, if the following condition holds then the edge -is relaxed (its distance is reduced), and this method is invoked.<br>+<td>在检查的时候,如果满足以下条件,则该边被松驰(其距离被减少),并调用该方 法。<br>
<tt> tie(u,v) = incident(e, g);<br> D d_u = get(d, u), d_v = get(d, v);<br> @@ -102,83 +87,54 @@ </tr> <tr> -<td>Edge Not Relaxed</td> +<td>边未松驰</td> <td><tt>edge_not_relaxed(e, g)</tt></td> <td><tt>void</tt></td> -<td> -Upon examination, if the edge is not relaxed (see above) then -this method is invoked. +<td>在检查的时候,如果边未被松驰(见上),则调用该方法。 </td> </tr> <tr> -<td>Edge Minimized</td> +<td>边最小化</td> <td><tt>vis.edge_minimized(e, g)</tt></td> <td><tt>void</tt></td> -<td> -After the <tt>num_vertices(g)</tt> iterations through the edge set -of the graph is complete, one last iteration is made to test whether -each edge was minimized. If the edge is minimized then this function -is invoked.+<td>在对图的边集进行 <tt>num_vertices(g)</tt> 次迭代完成后,最后一次迭代要 测试每条边是否已最小化。如果该边是最小化则调用该方法。
</td> </tr> <tr> -<td>Edge Not Minimized</td> +<td>边非最小化</td> <td><tt>edge_not_minimized(e, g)</tt></td> <td><tt>void</tt></td> -<td> -If the edge is not minimized, this function is invoked. This happens -when there is a negative cycle in the graph. +<td>如果该边非最小化,则调用该方法。在图中存在负循环时发生。 </td> </tr> -</table> +</tbody></table> -<h3>Models</h3> +<h3>Models 模型</h3> <ul> <li><a href="./bellman_visitor.html"><tt>bellman_visitor</tt></a> -</ul> +</li></ul> <a name="python"></a> -<h3>Python</h3>+<h3>Python</h3>要在Python中实现一个<tt>BellmanFordVisitor</tt><tt></tt>概念 的模型,应创建一个从图的 <tt>BellmanFordVisitor</tt><tt></tt> 类型(名 为 <tt><i>GraphType</i>.</tt><tt>BellmanFordVisitor</tt>)派生的新类。事件和 语法与C++中的遍历器相同。以下是一个
+Python <tt>bgl.Graph</tt> 图类型的例子: -To implement a model of the <tt>BellmanFordVisitor</tt> concept in Python,-create a new class that derives from the <tt>BellmanFordVisitor</tt> type of
-the graph, which will be-named <tt><i>GraphType</i>.BellmanFordVisitor</tt>. The events and syntax are
-the same as with visitors in C++. Here is an example for the -Python <tt>bgl.Graph</tt> graph type: - -<pre> -class count_tree_edges_bellman_ford_visitor(bgl.Graph.BellmanFordVisitor): - def __init__(self, name_map): - bgl.Graph.BellmanFordVisitor.__init__(self) - self.name_map = name_map - - def edge_relaxed(self, e, g): - (u, v) = (g.source(e), g.target(e)) - print "Relaxed edge ", - print self.name_map[u], - print " -> ", - print self.name_map[v] -</pre>+<pre>class count_tree_edges_bellman_ford_visitor(bgl.Graph.BellmanFordVisitor):<br> def __init__(self, name_map):<br> bgl.Graph.BellmanFordVisitor.__init__(self)<br> self.name_map = name_map<br><br> def edge_relaxed(self, e, g):<br> (u, v) = (g.source(e), g.target(e))<br> print "Relaxed edge ",<br> print self.name_map[u],<br> print " -> ",<br> print self.name_map[v]<br></pre>
<br> -<HR> -<TABLE> -<TR valign=top> -<TD nowrap>Copyright © 2000-2001</TD><TD> -<A HREF="http://www.boost.org/people/jeremy_siek.htm";>Jeremy Siek</A>, -Indiana University (<A -HREF="mailto:jsiek@xxxxxxxxxx";>jsiek@xxxxxxxxxx</A>)<br>-<A HREF="http://www.boost.org/people/liequan_lee.htm";>Lie-Quan Lee</A>, Indiana University (<A HREF="mailto:llee@xxxxxxxxxxxxxx";>llee@xxxxxxxxxxxxxx</A>)<br>
-<A HREF="http://www.osl.iu.edu/~lums";>Andrew Lumsdaine</A>, -Indiana University (<A -HREF="mailto:lums@xxxxxxxxxx";>lums@xxxxxxxxxx</A>) -</TD></TR></TABLE> +<hr> +<table> +<tbody><tr valign="top"> +<td nowrap="nowrap">Copyright (c) 2000-2001</td><td> +<a href="http://www.boost.org/people/jeremy_siek.htm";>Jeremy Siek</a>,+Indiana University (<a href="mailto:jsiek@xxxxxxxxxx";>jsiek@xxxxxxxxxx</a>)<br> +<a href="http://www.boost.org/people/liequan_lee.htm";>Lie-Quan Lee</a>, Indiana University (<a href="mailto:llee@xxxxxxxxxxxxxx";>llee@xxxxxxxxxxxxxx</a>)<br>
+<a href="http://www.osl.iu.edu/%7Elums";>Andrew Lumsdaine</a>, +Indiana University (<a href="mailto:lums@xxxxxxxxxx";>lums@xxxxxxxxxx</a>) +</td></tr></tbody></table> -</BODY> -</HTML> +</body></html> \ No newline at end of file Modified: trunk/libs/graph/doc/DFSVisitor.html ============================================================================== --- trunk/libs/graph/doc/DFSVisitor.html (original) +++ trunk/libs/graph/doc/DFSVisitor.html Wed Jul 15 23:13:51 2009 @@ -1,212 +1,159 @@ -<HTML> -<!-- +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">+<html><head><meta content="text/html; charset=UTF-8" http-equiv="content-type"><!--
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000 -- -- Distributed under the Boost Software License, Version 1.0. -- (See accompanying file LICENSE_1_0.txt or copy at -- http://www.boost.org/LICENSE_1_0.txt) --> -<Head> -<Title>DFS Visitor</Title> -<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b" - ALINK="#ff0000"> -<IMG SRC="../../../boost.png" - ALT="C++ Boost" width="277" height="86"> +<title>DFS Visitor</title></head> -<BR Clear>+<body alink="#ff0000" bgcolor="#ffffff" link="#0000ee" text="#000000" vlink="#551a8b">
+<img src="../../../boost.png" alt="C++ Boost" height="86" width="277"> -<H1><img src="figs/python.gif" alt="(Python)"/>DFS Visitor Concept</H1> +<br clear=""> -This concept defines the visitor interface for <a -href="./depth_first_search.html"><tt>depth_first_search()</tt></a>. -Users can define a class with the DFS Visitor interface and pass an -object of the class to <tt>depth_first_search()</tt>, thereby -augmenting the actions taken during the graph search.+<h1><img src="figs/python.gif" alt="(Python)">DFS Visitor Concept 深度优先 遍历器概念</h1>该概念定义了用于 <a href="./depth_first_search.html"><tt>depth_first_search()</tt></a> 的遍历器 接口。用户可以定义一个具有DFS遍历器接口的类,并将该类的一个对象传递给 <tt>depth_first_search()</tt>,从而在图搜索期间增加相应的动作。
-<h3>Refinement of</h3> +<h3>Refinement of 精化自</h3> -<a href="../../utility/CopyConstructible.html">Copy Constructible</a> -(copying a visitor should be a lightweight operation).+<a href="../../utility/CopyConstructible.html">可复制构造 Copy Constructible</a>
+(遍历器的复制应该是一个轻量级的操作)。 -<h3>Notation</h3> +<h3>Notation 记号</h3> -<Table> -<TR> -<TD><tt>V</tt></TD> -<TD>A type that is a model of DFS Visitor.</TD> -</TR> - -<TR> -<TD><tt>vis</tt></TD> -<TD>An object of type <tt>V</tt>.</TD> -</TR> - -<TR> -<TD><tt>G</tt></TD> -<TD>A type that is a model of Graph.</TD> -</TR> +<table> +<tbody><tr> +<td><tt>V</tt></td> +<td>一个以DFS遍历器为模的类型。</td> +</tr> -<TR> -<TD><tt>g</tt></TD> -<TD>An object of type <tt>G</tt>.</TD> -</TR> +<tr> +<td><tt>vis</tt></td> +<td>一个类型为 <tt>V</tt> 的对象。</td> +</tr> -<TR> -<TD><tt>e</tt></TD>-<TD>An object of type <tt>boost::graph_traits<G>::edge_descriptor</tt>.</TD>
-</TR> +<tr> +<td><tt>G</tt></td> +<td>一个以 Graph 为模的类型。</td> +</tr> -<TR> -<TD><tt>s,u</tt></TD>-<TD>An object of type <tt>boost::graph_traits<G>::vertex_descriptor</tt>.</TD>
-</TR> +<tr> +<td><tt>g</tt></td> +<td>一个类型为 <tt>G</tt> 的对象。</td> +</tr> -</table> +<tr> +<td><tt>e</tt></td>+<td>一个类型为 <tt>boost::graph_traits<G>::edge_descriptor</tt> 的对 象。</td>
+</tr> -<h3>Associated Types</h3> +<tr> +<td><tt>s,u</tt></td>+<td>一个类型为 <tt>boost::graph_traits<G>::vertex_descriptor</tt> 的 对象。</td>
+</tr> -none -<p> +</tbody></table> -<h3>Valid Expressions</h3> +<h3>Associated Types 关联类型</h3>无 +<h3>Valid Expressions 有效表达式</h3> -<table border> -<tr> +<table border="1"> +<tbody><tr> <th>Name</th><th>Expression</th><th>Return Type</th><th>Description</th> </tr> <tr> -<td>Initialize Vertex</td> +<td>顶点初始化</td> <td><tt>vis.initialize_vertex(s, g)</tt></td> <td><tt>void</tt></td> -<td> -This is invoked on every vertex of the graph before the start of the -graph search. +<td>在开始图搜索之前,对图中的每个点调用。 + </td> </tr> <tr> -<td>Start Vertex</td> +<td>顶点开始</td> <td><tt>vis.start_vertex(s, g)</tt></td> <td><tt>void</tt></td> -<td> -This is invoked on the source vertex once before the start of the -search. +<td>在开始搜索之前,对源顶点调用一次。 </td> </tr> <tr> -<td>Discover Vertex</td> +<td>顶点发现</td> <td><tt>vis.discover_vertex(u, g)</tt></td> <td><tt>void</tt></td> -<td> -This is invoked when a vertex is encountered for the first time. +<td>当首次遇到某个顶点时调用。 + </td> </tr> <tr> -<td>Examine Edge</td> +<td>边检查</td> <td><tt>vis.examine_edge(e, g)</tt></td> <td><tt>void</tt></td> -<td> -This is invoked on every out-edge of each vertex after it is discovered. +<td>在每个顶点被发现后,对其每条出边调用。 </td> </tr> <tr> -<td>Tree Edge</td> +<td>树边</td> <td><tt>vis.tree_edge(e, g)</tt></td> <td><tt>void</tt></td> -<td> -This is invoked on each edge as it becomes a member of the edges that -form the search tree.</td> +<td>在某条边成为搜索树的边成员时调用。</td> </tr> <tr> -<td>Back Edge</td> +<td>反向边</td> <td><tt>vis.back_edge(e, g)</tt></td> <td><tt>void</tt></td> -<td> -This is invoked on the back edges in the graph. For an undirected -graph there is some ambiguity between tree edges and back edges since -the edge <i>(u,v)</i> and <i>(v,u)</i> are the same edge, but both the -<tt>tree_edge()</tt> and <tt>back_edge()</tt> functions will be -invoked. One way to resolve this ambiguity is to record the tree -edges, and then disregard the back-edges that are already marked as -tree edges. An easy way to record tree edges is to record -predecessors at the <tt>tree_edge</tt> event point.+<td>对图中的反向边调用。对于无向图,由于边 <i>(u,v)</i> 和 <i>(v,u)</i> 是 同一条边,所以树边和反向边有些歧义,不过 +<tt>tree_edge()</tt> 和 <tt>back_edge()</tt> 两个函数都会被调用。解决这个歧 义的一个办法是将树边记录下来,然后忽略那些已被标记为树边的反向边。记录树边的 一个简单方法是在 <tt>tree_edge</tt> 事件点上记录其先辈。
</td> </tr> <tr> -<td>Forward or Cross Edge</td> +<td>前向边或交叉边</td> <td><tt>vis.forward_or_cross_edge(e, g)</tt></td> <td><tt>void</tt></td> -<td> -This is invoked on forward or cross edges in the graph. In an -undirected graph this method is never called. +<td>对图中的前向边或交叉边调用。在无向图中,该方法不会被调用。 </td> </tr> <tr> -<td>Finish Vertex</td> +<td>顶点结束</td> <td><tt>vis.finish_vertex(u, g)</tt></td> <td><tt>void</tt></td> -<td> -This is invoked on vertex <tt>u</tt> after <tt>finish_vertex</tt> has -been called for all the vertices in the DFS-tree rooted at vertex -<tt>u</tt>. If vertex <tt>u</tt> is a leaf in the DFS-tree, then -the <tt>finish_vertex</tt> function is call on <tt>u</tt> after -all the out-edges of <tt>u</tt> have been examined.+<td>当DFS树中以顶点 u 为根的所有顶点都调用了 <tt>finish_vertex</tt> 后,对 顶点 u 调用。如果顶点 <tt>u</tt> 是DFS树的一片叶子,则 <tt>finish_vertex</tt> 函数在 <tt>u</tt> 的所有出边被检查后对 <tt>u</tt> 调 用。
</td> </tr> -</table> +</tbody></table> -<h3>Models</h3> +<h3>Models 模型</h3> <ul> <li><a href="./dfs_visitor.html"><tt>dfs_visitor</tt></a> -</ul> +</li></ul> <a name="python"></a> -<h3>Python</h3>+<h3>Python</h3>要在Python中实现一个<tt>DFSVisitor</tt>概念的模型,应创建一 个从图的 <tt>DFSVisitor</tt> 类型(名为 <tt><i>GraphType</i>.DFSVisitor</tt>)派生的新类。事件和语法与C++中的遍历器相 同。以下是一个
+Python <tt>bgl.Graph</tt> 图类型的例子: -To implement a model of the <tt>DFSVisitor</tt> concept in Python, -create a new class that derives from the <tt>DFSVisitor</tt> type of -the graph, which will be -named <tt><i>GraphType</i>.DFSVisitor</tt>. The events and syntax are -the same as with visitors in C++. Here is an example for the -Python <tt>bgl.Graph</tt> graph type: - -<pre> -class count_tree_edges_dfs_visitor(bgl.Graph.DFSVisitor): - def __init__(self, name_map): - bgl.Graph.DFSVisitor.__init__(self) - self.name_map = name_map - - def tree_edge(self, e, g): - (u, v) = (g.source(e), g.target(e)) - print "Tree edge ", - print self.name_map[u], - print " -> ", - print self.name_map[v] -</pre>+<pre>class count_tree_edges_dfs_visitor(bgl.Graph.DFSVisitor):<br> def __init__(self, name_map):<br> bgl.Graph.DFSVisitor.__init__(self)<br> self.name_map = name_map<br><br> def tree_edge(self, e, g):<br> (u, v) = (g.source(e), g.target(e))<br> print "Tree edge ",<br> print self.name_map[u],<br> print " -> ",<br> print self.name_map[v]<br></pre>
<br> -<HR> -<TABLE> -<TR valign=top> -<TD nowrap>Copyright © 2000-2001</TD><TD> -<A HREF="http://www.boost.org/people/jeremy_siek.htm";>Jeremy Siek</A>, -Indiana University (<A -HREF="mailto:jsiek@xxxxxxxxxx";>jsiek@xxxxxxxxxx</A>)<br>-<A HREF="http://www.boost.org/people/liequan_lee.htm";>Lie-Quan Lee</A>, Indiana University (<A HREF="mailto:llee@xxxxxxxxxxxxxx";>llee@xxxxxxxxxxxxxx</A>)<br>
-<A HREF="http://www.osl.iu.edu/~lums";>Andrew Lumsdaine</A>, -Indiana University (<A -HREF="mailto:lums@xxxxxxxxxx";>lums@xxxxxxxxxx</A>) -</TD></TR></TABLE> +<hr> +<table> +<tbody><tr valign="top"> +<td nowrap="nowrap">Copyright (c) 2000-2001</td><td> +<a href="http://www.boost.org/people/jeremy_siek.htm";>Jeremy Siek</a>,+Indiana University (<a href="mailto:jsiek@xxxxxxxxxx";>jsiek@xxxxxxxxxx</a>)<br> +<a href="http://www.boost.org/people/liequan_lee.htm";>Lie-Quan Lee</a>, Indiana University (<a href="mailto:llee@xxxxxxxxxxxxxx";>llee@xxxxxxxxxxxxxx</a>)<br>
+<a href="http://www.osl.iu.edu/%7Elums";>Andrew Lumsdaine</a>, +Indiana University (<a href="mailto:lums@xxxxxxxxxx";>lums@xxxxxxxxxx</a>) +</td></tr></tbody></table> -</BODY> -</HTML> +</body></html> \ No newline at end of file Modified: trunk/libs/graph/doc/DijkstraVisitor.html ============================================================================== --- trunk/libs/graph/doc/DijkstraVisitor.html (original) +++ trunk/libs/graph/doc/DijkstraVisitor.html Wed Jul 15 23:13:51 2009 @@ -1,147 +1,127 @@ -<HTML> -<!-- +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">+<html><head><meta content="text/html; charset=UTF-8" http-equiv="content-type"><!--
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000 -- -- Distributed under the Boost Software License, Version 1.0. -- (See accompanying file LICENSE_1_0.txt or copy at -- http://www.boost.org/LICENSE_1_0.txt) --> -<Head> -<Title>Boost Graph Library: Dijkstra Visitor</Title> -<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b" - ALINK="#ff0000"> -<IMG SRC="../../../boost.png" - ALT="C++ Boost" width="277" height="86"> +<title>Boost Graph Library: Dijkstra Visitor</title></head>+<body alink="#ff0000" bgcolor="#ffffff" link="#0000ee" text="#000000" vlink="#551a8b">
+<img src="../../../boost.png" alt="C++ Boost" height="86" width="277"> -<BR Clear> +<br clear="">-<H1><img src="figs/python.gif" alt="(Python)"/>Dijkstra Visitor Concept</H1> +<h1><img src="figs/python.gif" alt="(Python)">Dijkstra 遍历器概念</h1>这个 概念定义了 <a href="./dijkstra_shortest_paths.html"><tt>dijkstra_shortest_paths()</tt></a> +及相关算法所用的遍历器接口。用户可以创建一个符合该接口的类,然后传递一个该 类的对象给
+<tt>dijkstra_shortest_paths()</tt> 以增加在搜索期间的动作。 -This concept defines the visitor interface for <a -href="./dijkstra_shortest_paths.html"><tt>dijkstra_shortest_paths()</tt></a> -and related algorithms. The user can create a class that matches this -interface, and then pass objects of the class into -<tt>dijkstra_shortest_paths()</tt> to augment the actions taken during -the search. +<h3>Refinement of 精化自</h3> -<h3>Refinement of</h3>+<a href="../../utility/CopyConstructible.html">可复制构造 Copy Constructible</a>
+(遍历器的复制应该是一个轻量级的操作)。 -<a href="../../utility/CopyConstructible.html">Copy Constructible</a> -(copying a visitor should be a lightweight operation). +<h3>Notation 记号</h3> -<h3>Notation</h3> - -<Table> -<TR> -<TD><tt>V</tt></TD> -<TD>A type that is a model of Dijkstra Visitor.</TD> -</TR> - -<TR> -<TD><tt>vis</tt></TD> -<TD>An object of type <tt>V</tt>.</TD> -</TR> - -<TR> -<TD><tt>G</tt></TD> -<TD>A type that is a model of Graph.</TD> -</TR> +<table> +<tbody><tr> +<td><tt>V</tt></td> +<td>一个以 Dijkstra 遍历器为模的类型。</td> +</tr> -<TR> -<TD><tt>g</tt></TD> -<TD>An object of type <tt>G</tt>.</TD> -</TR> +<tr> +<td><tt>vis</tt></td> +<td>一个类型为 <tt>V</tt> 的对象。</td> +</tr> -<TR> -<TD><tt>e</tt></TD>-<TD>An object of type <tt>boost::graph_traits<G>::edge_descriptor</tt>.</TD>
-</TR> +<tr> +<td><tt>G</tt></td> +<td>一个以 Graph 为模的类型。</td> +</tr> -<TR> -<TD><tt>s,u,v</tt></TD>-<TD>An object of type <tt>boost::graph_traits<G>::vertex_descriptor</tt>.</TD>
-</TR> +<tr> +<td><tt>g</tt></td> +<td>一个类型为 <tt>G</tt> 的对象。</td> +</tr> -<TR> -<TD><tt>DistanceMap</tt></TD>-<TD>A type that is a model of <a href="../../property_map/ReadWritePropertyMap.html">Read/Write Property Map</a>.</TD>
-</TR> +<tr> +<td><tt>e</tt></td>+<td>一个类型为 <tt>boost::graph_traits<G>::edge_descriptor</tt> 的对 象。</td>
+</tr> -<TR> -<TD><tt>d</tt></TD> -<TD>An object of type <tt>DistanceMap</tt>.</TD> -</TR> +<tr> +<td><tt>s,u,v</tt></td>+<td>一个类型为 <tt>boost::graph_traits<G>::vertex_descriptor</tt> 的 对象。</td>
+</tr> -<TR> -<TD><tt>WeightMap</tt></TD>-<TD>A type that is a model of <a href="../../property_map/ReadWritePropertyMap.html">Readable Property Map</a>.</TD>
-</TR> +<tr> +<td><tt>DistanceMap</tt></td>+<td>一个以 <a href="../../property_map/ReadWritePropertyMap.html">Read/Write Property Map</a> 为模的类型。</td>
+</tr> -<TR> -<TD><tt>w</tt></TD> -<TD>An object of type <tt>DistanceMap</tt>.</TD> -</TR> +<tr> +<td><tt>d</tt></td> +<td>一个类型为 <tt>DistanceMap</tt> 的对象。</td> +</tr> -</table> +<tr> +<td><tt>WeightMap</tt></td>+<td>一个以 <a href="../../property_map/ReadWritePropertyMap.html">Readable Property Map</a> 为模的类型。</td>
+</tr> -<h3>Associated Types</h3> +<tr> +<td><tt>w</tt></td> +<td>一个类型为 <tt>WeightMap</tt><tt></tt> 的对象。</td> +</tr> -none -<p> +</tbody></table> -<h3>Valid Expressions</h3> +<h3>Associated Types 关联类型</h3>无 +<h3>Valid Expressions 有效表达式</h3> -<table border> -<tr> +<table border="1"> +<tbody><tr> <th>Name</th><th>Expression</th><th>Return Type</th><th>Description</th> </tr> <tr> -<td>Initialize Vertex</td> +<td>顶点初始化</td> <td><tt>vis.initialize_vertex(u, g)</tt></td> <td><tt>void</tt></td> -<td> -This is invoked one each vertex of the graph when it is initialized. +<td>在图初始化时对图中每个顶点调用。 </td> </tr> <tr> -<td>Examine Vertex</td> +<td>顶点检查</td> <td><tt>vis.examine_vertex(u, g)</tt></td> <td><tt>void</tt></td> -<td> -This is invoked on a vertex as it is popped from the queue. This -happens immediately before <tt>examine_edge()</tt> is invoked -on each of the out-edges of vertex <tt>u</tt>.+<td>当某个顶点从队列中弹出时调用。在对顶点 <tt>u</tt> 的每条出边调用 <tt>examine_edge()</tt> 之前发生。
</td> </tr> <tr> -<td>Examine Edge</td> +<td>边检查</td> <td><tt>vis.examine_edge(e, g)</tt></td> <td><tt>void</tt></td> -<td> -This is invoked on every out-edge of each vertex after it is discovered. +<td>在每个顶点被发现后,对其每条出边调用。 </td> </tr> <tr> -<td>Discover Vertex</td> +<td>顶点发现</td> <td><tt>vis.discover_vertex(u, g)</tt></td> <td><tt>void</tt></td> -<td> -This is invoked when a vertex is encountered for the first time. +<td>当首次遇到某个顶点时调用。 </td> </tr> <tr> -<td>Edge Relaxed</td> +<td>边松驰</td> <td><tt>vis.edge_relaxed(e, g)</tt></td> <td><tt>void</tt></td> -<td> -Upon examination, if the following condition holds then the edge -is relaxed (its distance is reduced), and this method is invoked.<br>+<td>在检查时,如果满足以下条件,则该边被松驰(其距离被减少),并调用该方法。 <br>
<tt> tie(u,v) = incident(e, g);<br> D d_u = get(d, u), d_v = get(d, v);<br> @@ -152,17 +132,15 @@ </tr> <tr> -<td>Edge Not Relaxed</td> +<td>边未松驰</td> <td><tt>vis.edge_not_relaxed(e, g)</tt></td> <td><tt>void</tt></td> -<td> -Upon examination, if the edge is not relaxed (see above) then -this method is invoked. +<td>在检查时,如果该边未被松驰(见上),则调用该方法。 </td> </tr> <tr> -<td>Finish Vertex</td> +<td>顶点结束</td> <td><tt>vis.finish_vertex(u, g)</tt></td> <td><tt>void</tt></td> <td> @@ -172,51 +150,30 @@ </td> </tr> -</table> +</tbody></table> -<h3>Models</h3> +<h3>Models 模型</h3> <ul> <li><a href="./dijkstra_visitor.html"><tt>dijkstra_visitor</tt></a> -</ul> +</li></ul> <a name="python"></a> -<h3>Python</h3>+<h3>Python</h3>要在Python中实现一个<tt>DijkstraVisitor</tt>概念的模型,应创 建一个从图的 <tt>DijkstraVisitor</tt> 类型(名为 <tt><i>GraphType</i>.</tt><tt>DijkstraVisitor</tt>)派生的新类。事件和语法与 C++中的遍历器相同。以下是一个
+Python <tt>bgl.Graph</tt> 图类型的例子: -To implement a model of the <tt>DijkstraVisitor</tt> concept in Python, -create a new class that derives from the <tt>DijkstraVisitor</tt> type of -the graph, which will be -named <tt><i>GraphType</i>.DijkstraVisitor</tt>. The events and syntax are -the same as with visitors in C++. Here is an example for the -Python <tt>bgl.Graph</tt> graph type: - -<pre> -class count_tree_edges_dijkstra_visitor(bgl.Graph.DijkstraVisitor): - def __init__(self, name_map): - bgl.Graph.DijkstraVisitor.__init__(self) - self.name_map = name_map - - def edge_relaxed(self, e, g): - (u, v) = (g.source(e), g.target(e)) - print "Relaxed edge ", - print self.name_map[u], - print " -> ", - print self.name_map[v] -</pre>+<pre>class count_tree_edges_dijkstra_visitor(bgl.Graph.DijkstraVisitor):<br> def __init__(self, name_map):<br> bgl.Graph.DijkstraVisitor.__init__(self)<br> self.name_map = name_map<br><br> def edge_relaxed(self, e, g):<br> (u, v) = (g.source(e), g.target(e))<br> print "Relaxed edge ",<br> print self.name_map[u],<br> print " -> ",<br> print self.name_map[v]<br></pre>
<br> -<HR> -<TABLE> -<TR valign=top> -<TD nowrap>Copyright © 2000-2001</TD><TD> -<A HREF="http://www.boost.org/people/jeremy_siek.htm";>Jeremy Siek</A>, -Indiana University (<A -HREF="mailto:jsiek@xxxxxxxxxx";>jsiek@xxxxxxxxxx</A>)<br>-<A HREF="http://www.boost.org/people/liequan_lee.htm";>Lie-Quan Lee</A>, Indiana University (<A HREF="mailto:llee@xxxxxxxxxxxxxx";>llee@xxxxxxxxxxxxxx</A>)<br>
-<A HREF="http://www.osl.iu.edu/~lums";>Andrew Lumsdaine</A>, -Indiana University (<A -HREF="mailto:lums@xxxxxxxxxx";>lums@xxxxxxxxxx</A>) -</TD></TR></TABLE> +<hr> +<table> +<tbody><tr valign="top"> +<td nowrap="nowrap">Copyright (c) 2000-2001</td><td> +<a href="http://www.boost.org/people/jeremy_siek.htm";>Jeremy Siek</a>,+Indiana University (<a href="mailto:jsiek@xxxxxxxxxx";>jsiek@xxxxxxxxxx</a>)<br> +<a href="http://www.boost.org/people/liequan_lee.htm";>Lie-Quan Lee</a>, Indiana University (<a href="mailto:llee@xxxxxxxxxxxxxx";>llee@xxxxxxxxxxxxxx</a>)<br>
+<a href="http://www.osl.iu.edu/%7Elums";>Andrew Lumsdaine</a>, +Indiana University (<a href="mailto:lums@xxxxxxxxxx";>lums@xxxxxxxxxx</a>) +</td></tr></tbody></table> -</BODY> -</HTML> +</body></html> \ No newline at end of file Modified: trunk/libs/graph/doc/EventVisitor.html ============================================================================== --- trunk/libs/graph/doc/EventVisitor.html (original) +++ trunk/libs/graph/doc/EventVisitor.html Wed Jul 15 23:13:51 2009 @@ -1,161 +1,122 @@ -<HTML> -<!-- +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">+<html><head><meta content="text/html; charset=UTF-8" http-equiv="content-type"><!--
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000 -- -- Distributed under the Boost Software License, Version 1.0. -- (See accompanying file LICENSE_1_0.txt or copy at -- http://www.boost.org/LICENSE_1_0.txt) --> -<Head> -<Title>Boost Graph Library: EventVisitor</Title> -<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b" - ALINK="#ff0000"> -<IMG SRC="../../../boost.png" - ALT="C++ Boost" width="277" height="86"> - -<BR Clear> - -<H1>EventVisitor Concept</H1> - -This concept defines the interface for single-event visitors. An -EventVisitor has an apply member function (<tt>operator()</tt>) which -is invoked within the graph algorithm at the event-point specified by -the <tt>event_filter</tt> typedef within the -EventVisitor. EventVisitor's can be combined into an <a -href="./EventVisitorList.html">EventVistorList</a>. - -<p> -The following is the list of event tags that can be invoked in BGL -algorithms. Each tag corresponds to a member function of the visitor -for an algorithm. For example, the <a -href="./BFSVisitor.html">BFSVisitor</a> of <a -href="./breadth_first_search.html"><tt>breadth_first_search()</tt></a> -has a <tt>cycle_edge()</tt> member function. The corresponding tag is -<tt>on_cycle_edge</tt>. The first argument is the event visitor's -<tt>operator()</tt> must be either an edge or vertex descriptor -depending on the event tag. - -<pre> -namespace boost { - struct on_initialize_vertex { }; - struct on_start_vertex { }; - struct on_discover_vertex { }; - struct on_examine_edge { }; - struct on_tree_edge { }; - struct on_cycle_edge { }; - struct on_finish_vertex { }; - struct on_forward_or_cross_edge { }; - struct on_back_edge { }; - struct on_edge_relaxed { }; - struct on_edge_not_relaxed { }; - struct on_edge_minimized { }; - struct on_edge_not_minimized { }; -} // namespace boost -</pre> - - -<h3>Refinement of</h3> - -<a href="../../utility/CopyConstructible.html">Copy Constructible</a> -(copying a visitor should be a lightweight operation). - -<h3>Notation</h3> - -<Table> -<TR> -<TD><tt>G</tt></TD> -<TD>A type that is a model of <a href="./Graph.html">Graph</a>.</TD> -</TR> - -<TR> -<TD><tt>g</tt></TD> -<TD>An object of type <tt>G</tt>.</TD> -</TR> - -<TR> -<TD><tt>V</tt></TD> -<TD>A type that is a model of EventVisitor.</TD> -</TR> - -<TR> -<TD><tt>vis</tt></TD> -<TD>An object of type <tt>V</tt>.</TD> -</TR> - -<TR> -<TD><tt>x</tt></TD> -<TD>An object of type -<tt>boost::graph_traits<G>::vertex_descriptor</tt> -or <tt>boost::graph_traits<G>::edge_descriptor</tt>.</TD> -</TR> - -</table> - -<h3>Associated Types</h3> - -<Table border> - -<TR> -<TD>Event Filter </TD> -<TD><TT>V::event_filter</TT></TD> -<TD> -A tag struct to specify on which event the visitor should be invoked. -</TD> -</TR> +<title>Boost Graph Library: EventVisitor</title></head> -</table>+<body alink="#ff0000" bgcolor="#ffffff" link="#0000ee" text="#000000" vlink="#551a8b">
+<img src="../../../boost.png" alt="C++ Boost" height="86" width="277"> -<h3>Valid Expressions</h3> +<br clear=""> -<Table border>+<h1>EventVisitor Concept 事件遍历器概念</h1>这个概念定义了单事件遍历器的接 口。事件遍历器(EventVisitor)具有一个应用成员函数(<tt>operator()</tt>),它在 图算法的内部被调用,调用的时间点是由事件遍历器内的 <tt>event_filter</tt> typedef 所指定的事件点。多个事件遍历器可以合并 到一个 <a href="./EventVisitorList.html">事件遍历器列表EventVistorList</a> 中。
++<p>以下是可以在BGL算法中调用的事件标签列表。每个标签对应于用于某个算法的遍 历器的一个成员函数。例如,<a href="breadth_first_search.html"><tt>breadth_first_search()</tt></a> 的 <a href="./BFSVisitor.html">BFSVisitor</a> 有一个 <tt>cycle_edge()</tt> 成员函 数。对应的标签是
+<tt>on_cycle_edge</tt>。事件遍历器的+<tt>operator()</tt> 的第一个参数必须是边描述符或顶点描述符,取决于事件标 签。
++</p><pre>namespace boost {<br> struct on_initialize_vertex { };<br> struct on_start_vertex { };<br> struct on_discover_vertex { };<br> struct on_examine_edge { };<br> struct on_tree_edge { };<br> struct on_cycle_edge { };<br> struct on_finish_vertex { };<br> struct on_forward_or_cross_edge { };<br> struct on_back_edge { };<br> struct on_edge_relaxed { };<br> struct on_edge_not_relaxed { };<br> struct on_edge_minimized { };<br> struct on_edge_not_minimized { };<br>} // namespace boost<br></pre>
+ + +<h3>Refinement of 精化自</h3> ++<a href="../../utility/CopyConstructible.html">可复制构造 Copy Constructible</a>
+(遍历器的复制应该是一个轻量级的操作)。 + +<h3>Notation 记号</h3> + +<table> +<tbody><tr> +<td><tt>G</tt></td> +<td>一个以 <a href="./Graph.html">Graph</a> 为模的类型。</td> +</tr> + +<tr> +<td><tt>g</tt></td> +<td>一个类型为 <tt>G</tt> 的对象。</td> +</tr> + +<tr> +<td><tt>V</tt></td> +<td>一个以 EventVisitor 为模的类型。</td> +</tr> <tr> +<td><tt>vis</tt></td> +<td>一个类型为 <tt>V</tt> 的对象。</td> +</tr> + +<tr> +<td><tt>x</tt></td>+<td>一个类型为 <tt>boost::graph_traits<G>::vertex_descriptor</tt> 或 <tt>boost::graph_traits<G>::edge_descriptor</tt> 的对象。</td>
+</tr> + +</tbody></table> + +<h3>Associated Types 关联类型</h3> + +<table border="1"> + +<tbody><tr> +<td>Event Filter </td> +<td><tt>V::event_filter</tt></td> +<td> +一个指定遍历器应在哪个事件上调用的标签结构。 +</td> +</tr> + +</tbody></table> + +<h3>Valid Expressions 有效表达式</h3> + +<table border="1"> + +<tbody><tr> <th>Name</th><th>Expression</th><th>Return Type</th><th>Description</th> </tr> <tr> -<td>Apply Visitor</td> -<td><TT>vis(x, g)</TT></TD> -<TD><TT>void</TT></TD> -<TD> -Invokes the visitor operation on object <tt>x</tt>, which is -either a vertex or edge descriptor of the graph. -</TD> -</TR> +<td>遍历器应用</td> +<td><tt>vis(x, g)</tt></td> +<td><tt>void</tt></td> +<td> +对对象 <tt>x</tt> 调用遍历器操作,<tt>x</tt> 是图的顶点描述符或边描述符。 +</td> +</tr> -</table> +</tbody></table> -<h3>Models</h3> +<h3>Models 模型</h3> <ul> - <li><a - href="./predecessor_recorder.html"><tt>predecessor_recorder</tt></a> - <li><a href="./distance_recorder.html"><tt>distance_recorder</tt></a> - <li><a href="./time_stamper.html"><tt>time_stamper</tt></a> - <li><a href="./property_writer.html"><tt>property_writer</tt></a> - <li><a href="./null_visitor.html"><tt>null_visitor</tt></a> -</ul>+ <li><a href="./predecessor_recorder.html"><tt>predecessor_recorder</tt></a>
+ </li><li><a href="./distance_recorder.html"><tt>distance_recorder</tt></a> + </li><li><a href="./time_stamper.html"><tt>time_stamper</tt></a> + </li><li><a href="./property_writer.html"><tt>property_writer</tt></a> + </li><li><a href="./null_visitor.html"><tt>null_visitor</tt></a> +</li></ul> -<h3>See Also</h3> +<h3>See Also 参见</h3> -<a href="./EventVisitorList.html">EventVisitorList</a>, -<a href="./visitor_concepts.html">Visitor concepts</a> +<a href="./EventVisitorList.html">事件遍历器列表 EventVisitorList</a>, +<a href="./visitor_concepts.html">遍历器概念 Visitor concepts</a> <br> -<HR> -<TABLE> -<TR valign=top> -<TD nowrap>Copyright © 2000-2001</TD><TD> -<A HREF="http://www.boost.org/people/jeremy_siek.htm";>Jeremy Siek</A>, -Indiana University (<A -HREF="mailto:jsiek@xxxxxxxxxx";>jsiek@xxxxxxxxxx</A>)<br>-<A HREF="http://www.boost.org/people/liequan_lee.htm";>Lie-Quan Lee</A>, Indiana University (<A HREF="mailto:llee@xxxxxxxxxxxxxx";>llee@xxxxxxxxxxxxxx</A>)<br>
-<A HREF="http://www.osl.iu.edu/~lums";>Andrew Lumsdaine</A>, -Indiana University (<A -HREF="mailto:lums@xxxxxxxxxx";>lums@xxxxxxxxxx</A>) -</TD></TR></TABLE> +<hr> +<table> +<tbody><tr valign="top"> +<td nowrap="nowrap">Copyright (c) 2000-2001</td><td> +<a href="http://www.boost.org/people/jeremy_siek.htm";>Jeremy Siek</a>,+Indiana University (<a href="mailto:jsiek@xxxxxxxxxx";>jsiek@xxxxxxxxxx</a>)<br> +<a href="http://www.boost.org/people/liequan_lee.htm";>Lie-Quan Lee</a>, Indiana University (<a href="mailto:llee@xxxxxxxxxxxxxx";>llee@xxxxxxxxxxxxxx</a>)<br>
+<a href="http://www.osl.iu.edu/%7Elums";>Andrew Lumsdaine</a>, +Indiana University (<a href="mailto:lums@xxxxxxxxxx";>lums@xxxxxxxxxx</a>) +</td></tr></tbody></table> -</BODY> -</HTML> +</body></html> \ No newline at end of file Modified: trunk/libs/graph/doc/EventVisitorList.html ============================================================================== --- trunk/libs/graph/doc/EventVisitorList.html (original) +++ trunk/libs/graph/doc/EventVisitorList.html Wed Jul 15 23:13:51 2009 @@ -1,127 +1,57 @@ -<HTML> -<!-- +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">+<html><head><meta content="text/html; charset=UTF-8" http-equiv="content-type"><!--
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000 -- -- Distributed under the Boost Software License, Version 1.0. -- (See accompanying file LICENSE_1_0.txt or copy at -- http://www.boost.org/LICENSE_1_0.txt) --> -<Head> -<Title>Boost Graph Library: EventVisitorList</Title> -<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b" - ALINK="#ff0000"> -<IMG SRC="../../../boost.png" - ALT="C++ Boost" width="277" height="86"> - -<BR Clear> - -<H1>EventVisitorList Concept</H1> - -An EventVisitorList is either an <a -href="./EventVisitor.html">EventVisitor</a>, or a list of -EventVisitor's combined using <tt>std::pair</tt>. Each graph algorithm -defines visitor adaptors that convert an EventVisitorList into the -particular kind of visitor needed by the algorithm. - -In the following example we will show how to combine event visitors -into a list using <tt>std::pair</tt> and how to use an algorithm's -visitor adaptor class. - -<p> -Suppose we would like to print out the parenthesis -structure of the discover/finish times of vertices in a <a -href="./graph_theory_review.html#sec:dfs-algorithm">depth-first -search</a>. We can use the BGL algorithm <a -href="./depth_first_search.html"><tt>depth_first_search()</tt></a> and -two event visitors to accomplish this. The complete source code for -the following example is in <a href="../example/dfs_parenthesis.cpp"> -<tt>examples/dfs_parenthesis.cpp</tt></a>. First we define the two -event visitors. We use <tt>on_discover_vertex</tt> and -<tt>on_finish_vertex</tt> as the event points, selected from the list -of event points specified in <a -href="./DFSVisitor.html">DFSVisitor</a>. - -<pre> -struct open_paren : public base_visitor<open_paren> { - typedef on_discover_vertex event_filter; - template <class Vertex, class Graph> - void operator()(Vertex v, Graph& G) { - std::cout << "(" << v; - } -}; -struct close_paren : public base_visitor<close_paren> { - typedef on_finish_vertex event_filter; - template <class Vertex, class Graph> - void operator()(Vertex v, Graph& G) { - std::cout << v << ")"; - } -}; -</pre> - -Next we create two event visitor objects and make an EventVisitorList -out of them using a <tt>std::pair</tt> which created by -<tt>std::make_pair</tt>. - -<pre> -std::make_pair(open_paren(), close_paren()) -</pre> - -Next we want to pass this list into <tt>depth_first_search()</tt>, but -<tt>depth_first_search()</tt> is expecting a <a -href="./DFSVisitor.html">DFSVisitor</a>, not a EventVisitorList. We -therefore use the <a -href="./dfs_visitor.html"><tt>dfs_visitor</tt></a> adaptor which turns -an EventVisitor list into a DFSVisitor. Like all of the visitor -adaptors, <tt>dfs_visitor</tt> has a creation function called -<tt>make_dfs_visitor()</tt>. - -<pre> -make_dfs_visitor(std::make_pair(open_paren(), close_paren())) -</pre> - -Now we can pass the resulting visitor object into -<tt>depth_first_search()</tt> as follows. - -<pre> - // graph object G is created ... - - std::vector<default_color_type> color(num_vertices(G)); -- depth_first_search(G, make_dfs_visitor(std::make_pair(open_paren(), close_paren())),
- color.begin()); -</pre> - -For creating a list of more than two event visitors, nest calls to -<tt>std::make_pair</tt> in the following way: - -<pre> -std::make_pair(<i>visitor1</i>, - std::make_pair(<i>visitor2</i>, - ... - std::make_pair(<i>visitorN-1</i>, <i>visitorN</i>)...)); -</pre> +<title>Boost Graph Library: EventVisitorList</title></head>+<body alink="#ff0000" bgcolor="#ffffff" link="#0000ee" text="#000000" vlink="#551a8b">
+<img src="../../../boost.png" alt="C++ Boost" height="86" width="277"> +<br clear=""> -<h3>See Also</h3>+<h1>EventVisitorList Concept 事件遍历器列表概念</h1>事件遍历器列表 (EventVisitorList)是一个 <a href="./EventVisitor.html">事件遍历器 EventVisitor</a> 或一列用 <tt>std::pair</tt> 组合起来的事件遍历器。每个图算 法都定义了遍历器适配器,用于将一个事件遍历器列表转换为该算法所需的特定类型的 遍历器。在以下的例子中,我们将示范如何用 <tt>std::pair</tt> 将多个事件遍历器 组合成一个列表,以及如何使用算法的遍历器适配器类。
-<a href="./EventVisitor.html">EventVisitor</a>, -<a href="./visitor_concepts.html">Visitor concepts</a>+<p>假定我们要在一个 <a href="./graph_theory_review.html#sec:dfs-algorithm">深度优先搜索</a> 中以括 号结构打印各顶点的发现/完成时间。我们可以使用BGL算法 <a href="./depth_first_search.html"><tt>depth_first_search()</tt></a> 和两个事 件遍历器来做到这一点。以下例子的完整代码在 <a href="../example/dfs_parenthesis.cpp"> +<tt>examples/dfs_parenthesis.cpp</tt></a> 中。首先我们定义两个事件遍历器。 我们用 <tt>on_discover_vertex</tt> 和 +<tt>on_finish_vertex</tt> 作为事件点,它们是从 <a href="./DFSVisitor.html">DFS遍历器</a> 所规定的事件点列表中选出来的。
++</p><pre>struct open_paren : public base_visitor<open_paren> {<br> typedef on_discover_vertex event_filter;<br> template <class Vertex, class Graph><br> void operator()(Vertex v, Graph& G) {<br> std::cout << "(" << v;<br> }<br>};<br>struct close_paren : public base_visitor<close_paren> {<br> typedef on_finish_vertex event_filter;<br> template <class Vertex, class Graph><br> void operator()(Vertex v, Graph& G) {<br> std::cout << v << ")";<br> }<br>};<br></pre>接下来我们创建两个事件遍历器对象,并通过 +<tt>std::make_pair</tt> 用一个 <tt>std::pair</tt> 将它们组合成一个事件遍历 器列表。
++<pre>std::make_pair(open_paren(), close_paren())<br></pre>接下来我们要将这 个列表传入 <tt>depth_first_search()</tt>,但是 +<tt>depth_first_search()</tt> 要的是一个<a href="./DFSVisitor.html">DFS遍历 器</a>,而不是一个事件遍历器列表。因此我们要用 <a href="./dfs_visitor.html"><tt>dfs_visitor</tt></a> 适配器将事件遍历器列表变 为DFS遍历器。和所有遍历器适配器一样,<tt>dfs_visitor</tt> 有一个名为
+<tt>make_dfs_visitor()</tt> 的创建函数。 ++<pre>make_dfs_visitor(std::make_pair(open_paren(), close_paren()))<br></pre>现在我们可以如下将得到的遍历器对象传入
+<tt>depth_first_search()</tt> 了。 ++<pre> // 图对象 G 已创建 ...<br><br> std::vector<default_color_type> color(num_vertices(G));<br><br> depth_first_search(G, make_dfs_visitor(std::make_pair(open_paren(), close_paren())),<br> color.begin());<br></pre>要对两个以 上事件遍历器创建列表的话,需要按以下方法嵌套调用
+<tt>std::make_pair</tt>: ++<pre>std::make_pair(<i>visitor1</i>,<br> std::make_pair(<i>visitor2</i>,<br> ...<br> std::make_pair(<i>visitorN-1</i>, <i>visitorN</i>)...));<br></pre>
+ + + +<h3>See Also 参见</h3> + +<a href="./EventVisitor.html">事件遍历器 EventVisitor</a>, +<a href="./visitor_concepts.html">遍历器概念 Visitor concepts</a> <br> -<HR> -<TABLE> -<TR valign=top> -<TD nowrap>Copyright © 2000-2001</TD><TD> -<A HREF="http://www.boost.org/people/jeremy_siek.htm";>Jeremy Siek</A>, -Indiana University (<A -HREF="mailto:jsiek@xxxxxxxxxx";>jsiek@xxxxxxxxxx</A>)<br>-<A HREF="http://www.boost.org/people/liequan_lee.htm";>Lie-Quan Lee</A>, Indiana University (<A HREF="mailto:llee@xxxxxxxxxxxxxx";>llee@xxxxxxxxxxxxxx</A>)<br>
-<A HREF="http://www.osl.iu.edu/~lums";>Andrew Lumsdaine</A>, -Indiana University (<A -HREF="mailto:lums@xxxxxxxxxx";>lums@xxxxxxxxxx</A>) -</TD></TR></TABLE> +<hr> +<table> +<tbody><tr valign="top"> +<td nowrap="nowrap">Copyright (c) 2000-2001</td><td> +<a href="http://www.boost.org/people/jeremy_siek.htm";>Jeremy Siek</a>,+Indiana University (<a href="mailto:jsiek@xxxxxxxxxx";>jsiek@xxxxxxxxxx</a>)<br> +<a href="http://www.boost.org/people/liequan_lee.htm";>Lie-Quan Lee</a>, Indiana University (<a href="mailto:llee@xxxxxxxxxxxxxx";>llee@xxxxxxxxxxxxxx</a>)<br>
+<a href="http://www.osl.iu.edu/%7Elums";>Andrew Lumsdaine</a>, +Indiana University (<a href="mailto:lums@xxxxxxxxxx";>lums@xxxxxxxxxx</a>) +</td></tr></tbody></table> -</BODY> -</HTML> +</body></html> \ No newline at end of file Modified: trunk/libs/graph/doc/PlanarFaceVisitor.html ============================================================================== --- trunk/libs/graph/doc/PlanarFaceVisitor.html (original) +++ trunk/libs/graph/doc/PlanarFaceVisitor.html Wed Jul 15 23:13:51 2009 @@ -1,64 +1,56 @@ -<HTML> -<!-- Copyright 2007 Aaron Windsor +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">+<html><head><meta content="text/html; charset=UTF-8" http-equiv="content-type"><!-- Copyright 2007 Aaron Windsor
-- -- Distributed under the Boost Software License, Version 1.0. -- (See accompanying file LICENSE_1_0.txt or copy at -- http://www.boost.org/LICENSE_1_0.txt) -- --> -<HEAD> -<TITLE>Planar Face Visitor Concept</TITLE> -</HEAD> -<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b" - ALINK="#ff0000"> -<IMG SRC="../../../boost.png" - ALT="C++ Boost" width="277" height="86"> - -<BR Clear> - -<H1>Planar Face Visitor Concept</H1> - -This concept defines the visitor interface for -<a href="./planar_face_traversal.html"><tt>planar_face_traversal</tt></a>. -Users can define a class with the Planar Face Visitor interface and pass an-object of the class to <tt>planar_face_traversal</tt>, thereby augmenting the
-actions taken during the traversal. Note that objects passed to -<tt>planar_face_traversal</tt> are passed by reference. +<title>Planar Face Visitor Concept</title></head> -<h3>Notation</h3>+<body alink="#ff0000" bgcolor="#ffffff" link="#0000ee" text="#000000" vlink="#551a8b">
+<img src="../../../boost.png" alt="C++ Boost" height="86" width="277"> + +<br clear=""> + +<h1>Planar Face Visitor Concept 平面遍历器概念</h1>这个概念定义了用于+<a href="./planar_face_traversal.html"><tt>planar_face_traversal</tt></a> 的遍历器接口。用户可以定义一个具有平面遍历器接口的类,并传递该类的一个对象 给 <tt>planar_face_traversal</tt>,从而在遍历时增加动作。注意,传递给
+<tt>planar_face_traversal</tt> 的对象是以引用方式传递的。 + +<h3>Notation 记号</h3> <table> <tbody><tr> <td><tt>V</tt></td> -<td>A type that is a model of Planar Face Visitor.</td> +<td>一个以平面遍历器为模的类型。</td> </tr> <tr> <td><tt>vis</tt></td> -<td>An object of type <tt>V</tt>.</td> +<td>一个类型为 <tt>V</tt> 的对象。</td> </tr> <tr> <td><tt>G</tt></td> -<td>A type that is a model of Graph.</td> +<td>一个以 Graph 为模的类型。</td> </tr> <tr> <td><tt>e</tt></td>-<td>An object of type <tt>boost::graph_traits<G>::edge_descriptor</tt>. +<td>一个类型为 <tt>boost::graph_traits<G>::edge_descriptor</tt> 的对 象。
</td> </tr> <tr> <td><tt>v</tt></td>-<td>An object of type <tt>boost::graph_traits<G>::vertex_descriptor</tt>. +<td>一个类型为 <tt>boost::graph_traits<G>::vertex_descriptor</tt> 的 对象。
</td> </tr> </tbody></table> -<h3>Valid Expressions</h3> +<h3>Valid Expressions 有效表达式</h3> <table border="1"> <tbody><tr> @@ -66,83 +58,69 @@ </tr> <tr> -<td>Begin Traversal</td> +<td>遍历开始</td> <td><tt>vis.begin_traversal()</tt></td> <td><tt>void</tt></td> -<td> -This is invoked once per traversal, before the traversal begins. +<td>每次遍历调用一次,在遍历开始之前。 </td> </tr> <tr> -<td>Begin Face</td> +<td>面开始</td> <td><tt>vis.begin_face()</tt></td> <td><tt>void</tt></td> -<td>-This is invoked once for each face, before any vertices or edges on the face
-are visited. +<td>对每个面调用一次,在该面的任一顶点或边被访问之前。 </td> </tr> <tr> -<td>Next Vertex</td> +<td>下一顶点</td> <td><tt>vis.next_vertex(v)</tt></td> <td><tt>void</tt></td> -<td> -This is invoked when a vertex is encountered while traversing a face. +<td>在遍历一个面时,当遇到一个顶点时调用。 </td> </tr> <tr> -<td>Next Edge</td> +<td>下一边</td> <td><tt>vis.next_edge(e)</tt></td> <td><tt>void</tt></td> -<td> -This is invoked when an edge is encountered while traversing a face. +<td>在遍历一个面时,当遇到一条边时调用。 </td> </tr> <tr> -<td>End Face</td> +<td>面结束</td> <td><tt>vis.end_face()</tt></td> <td><tt>void</tt></td> -<td>-This is invoked once for each face, after all vertices and edges on the face
-are visited. +<td>对每个面调用一次,在该面的所有顶点和边被访问之后。 </td> </tr> <tr> -<td>End Traversal</td> +<td>遍历结束</td> <td><tt>vis.end_traversal()</tt></td> <td><tt>void</tt></td> -<td> -This is invoked once per traversal, after the traversal ends. +<td>每次遍历调用一次,在遍历结束以后。 </td> </tr> </tbody></table> -<h3>Models</h3> +<h3>Models 模型</h3> <ul> - <li> The file <a href="../../../boost/graph/planar_face_traversal.hpp"> -<tt>planar_face_traversal.hpp</tt></a> contains a class -<tt>planar_face_traversal_visitor</tt> that implements empty actions for-all event points of a Planar Face Visitor. In the case where only a few of the -event points of Planar Face Visitor need to be implemented, one can derive from -<tt>planar_face_traversal_visitor</tt> and only implement the necessary event
-points. <li> The implementation of <a href="./make_maximal_planar.html">-<tt>make_maximal_planar</tt></a> uses a <tt>triangulation_visitor</tt> that is
-a model of Planar Face Visitor. + <li>文件 <a href="../../../boost/graph/planar_face_traversal.hpp"> +<tt>planar_face_traversal.hpp</tt></a> 包含了一个类+<tt>planar_face_traversal_visitor</tt>,它对平面遍历器的所有事件点均实现了 空操作。在平面遍历器只有少量事件点需要实现的情况下,你可以从 +<tt>planar_face_traversal_visitor</tt> 继承并只实现所需的事件点。 </li><li><a href="./make_maximal_planar.html"><tt>make_maximal_planar</tt></a> 的实现使 用了一个 <tt>triangulation_visitor</tt>,它就是以平面遍历器为模型的。
</li> </ul> <br> -<HR>-Copyright © 2007 Aaron Windsor (<a href="mailto:aaron.windsor@xxxxxxxxx";>
+<hr> +Copyright (c) 2007 Aaron Windsor (<a href="mailto:aaron.windsor@xxxxxxxxx";> aaron.windsor@xxxxxxxxx</a>) -</BODY> -</HTML> +</body></html> \ No newline at end of file Modified: trunk/libs/graph/doc/TSPTourVisitor.html ============================================================================== --- trunk/libs/graph/doc/TSPTourVisitor.html (original) +++ trunk/libs/graph/doc/TSPTourVisitor.html Wed Jul 15 23:13:51 2009 @@ -1,99 +1,85 @@ -<HTML> -<!-- +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">+<html><head><meta content="text/html; charset=UTF-8" http-equiv="content-type"><!--
Copyright (c) Matyas Egyhazy 2008 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) --> -<Head> -<Title>Boost Graph Library: TSP Tour Visitor</Title> -<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b" - ALINK="#ff0000"> -<IMG SRC="../../../boost.png" - ALT="C++ Boost" width="277" height="86"> +<title>Boost Graph Library: TSP Tour Visitor</title></head> -<BR Clear>+<body alink="#ff0000" bgcolor="#ffffff" link="#0000ee" text="#000000" vlink="#551a8b">
+<img src="../../../boost.png" alt="C++ Boost" height="86" width="277"> -<H1>TSP Tour Visitor concept</H1> +<br clear=""> -This concept defines the visitor interface for <a -href="./metric_tsp_approx.html"><tt>metric_tsp_approx()</tt></a> -and related algorithms. The user can create a class that matches this -interface, and then pass objects of the class into -<tt>metric_tsp_approx()</tt> to augment the actions taken during -the search.+<h1>TSP Tour Visitor concept TSP巡游遍历器概念</h1>这个概念定义了用 于 <a href="./metric_tsp_approx.html"><tt>metric_tsp_approx()</tt></a> +及其相关算法的遍历器接口。用户可以创建一个符合该接口的类,然后传递该类的一 个对象给
+<tt>metric_tsp_approx()</tt>,以增加在搜索期间的动作。 -<h3>Refinement of</h3> +<h3>Refinement of 精化自</h3>无 -none +<h3>Notation 记号</h3> -<h3>Notation</h3> - -<Table> -<TR> -<TD><tt>V</tt></TD> -<TD>A type that is a model of Dijkstra Visitor.</TD> -</TR> - -<TR> -<TD><tt>vis</tt></TD> -<TD>An object of type <tt>V</tt>.</TD> -</TR> - -<TR> -<TD><tt>G</tt></TD> -<TD>A type that is a model of Graph.</TD> -</TR> +<table> +<tbody><tr> +<td><tt>V</tt></td> +<td>一个以Dijkstra遍历器为模的类型。</td> +</tr> -<TR> -<TD><tt>g</tt></TD> -<TD>An object of type <tt>G</tt>.</TD> -</TR> +<tr> +<td><tt>vis</tt></td> +<td>一个类型为 <tt>V</tt> 的对象。</td> +</tr> -<TR> -<TD><tt>v</tt></TD>-<TD>An object of type <tt>boost::graph_traits<G>::vertex_descriptor</tt>.</TD>
-</TR> +<tr> +<td><tt>G</tt></td> +<td>一个以 Graph 为模的类型。</td> +</tr> -</table> +<tr> +<td><tt>g</tt></td> +<td>一个类型为 <tt>G</tt> 的对象。</td> +</tr> -<h3>Associated Types</h3> +<tr> +<td><tt>v</tt></td>+<td>一个类型为 <tt>boost::graph_traits<G>::vertex_descriptor</tt> 的 对象。</td>
+</tr> -none +</tbody></table> -<p> +<h3>Associated Types 关联类型</h3>无 -<h3>Valid Expressions</h3> +<h3>Valid Expressions 有效表达式</h3> -<table border> -<tr> +<table border="1"> +<tbody><tr> <th>Name</th><th>Expression</th><th>Return Type</th><th>Description</th> </tr> <tr> -<td>Visit Vertex</td> +<td>顶点访问</td> <td><tt>vis.visit_vertex(v, g)</tt></td> <td><tt>void</tt></td> <td>-This is invoked on each vertex of the graph when it is visited as part of the TSP tour.
+当图中每个顶点作为TSP巡游的一部分被访问时对其调用。 </td> </tr> -</table> +</tbody></table> -<h3>Models</h3> +<h3>Models 模型</h3> <ul> <li><a href="tsp_tour_visitor.html"><tt>tsp_tour_visitor</tt></a>- <li><a href="tsp_tour_len_visitor.html"><tt>tsp_tour_len_tsp_visitor</tt></a>
-</ul>+ </li><li><a href="tsp_tour_len_visitor.html"><tt>tsp_tour_len_tsp_visitor</tt></a>
+</li></ul> <br> -<HR> -<TABLE> -<TR valign=top> -<TD nowrap>Copyright © 2008</TD><TD> -Matyas Egyhazy</TD></TR></TABLE> +<hr> +<table> +<tbody><tr valign="top"> +<td nowrap="nowrap">Copyright (c) 2008</td><td> +Matyas Egyhazy</td></tr></tbody></table> -</BODY> -</HTML> +</body></html> \ No newline at end of file Modified: trunk/libs/graph/doc/adjacency_list.html ============================================================================== --- trunk/libs/graph/doc/adjacency_list.html (original) +++ trunk/libs/graph/doc/adjacency_list.html Wed Jul 15 23:13:51 2009 @@ -1,256 +1,165 @@ -<HTML> -<!-- +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">+<html><head><meta content="text/html; charset=UTF-8" http-equiv="content-type"><!--
-- Copyright (c) Jeremy Siek 2000 -- -- Distributed under the Boost Software License, Version 1.0. -- (See accompanying file LICENSE_1_0.txt or copy at -- http://www.boost.org/LICENSE_1_0.txt) --> -<Head> -<Title>Boost Graph Library: Adjacency List</Title> -<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b" - ALINK="#ff0000"> -<IMG SRC="../../../boost.png" - ALT="C++ Boost" width="277" height="86"> - -<BR Clear> - -<H1><A NAME="sec:adjacency-list-class"></A> -<pre> -adjacency_list<OutEdgeList, VertexList, Directed, - VertexProperties, EdgeProperties, - GraphProperties, EdgeList> -</pre> -</H1> +<title>Boost Graph Library: Adjacency List</title></head>+<body alink="#ff0000" bgcolor="#ffffff" link="#0000ee" text="#000000" vlink="#551a8b">
+<img src="../../../boost.png" alt="C++ Boost" height="86" width="277"> + +<br clear=""> + +<h1><a name="sec:adjacency-list-class"></a>+<pre>adjacency_list<OutEdgeList, VertexList, Directed,<br> VertexProperties, EdgeProperties,<br> GraphProperties, EdgeList><br></pre>
+</h1> + ++<p><tt>adjacency_list</tt> 类实现了一个泛型的邻接表图结构。其模板参数提供了 许多配置选项,你可以选择一个最符合需要的版本。基本上,<a href="graph_theory_review.html#sec:adjacency-list-representation">adjacency-list</a> +就是一个二维结构,第一维的每个元素表示一个顶点,而每个顶点包含一个一维结构 来表示该顶点的边列表。<a href="#fig:adj-list-graph">图 1</a> 示范了一个有向 图的邻接表表示法。
+ +</p> +<div align="center"><a name="fig:adj-list-graph"></a><a name="1509"></a> +<table>+<caption align="bottom"><strong>图 1:</strong> 一个有向图的邻接表表示法。 </caption> +<tbody><tr><td><img src="./figs/adj-matrix-graph2.gif" height="284" width="386"></td>
+<td><img src="./figs/adj-list2.gif" height="122" width="62"></td></tr> +</tbody></table> +</div><p><tt>adjacency_list</tt> 类的+<tt>VertexList</tt> 模板参数控制使用哪种容器作为表示出边的两维容器。 <tt>OutEdgeList</tt> 模板参数则控制使用哪种容器来表示边列表。 <tt>OutEdgeList</tt> 和 <tt>VertexList</tt> 的选择将决定图结构的空间复杂 度,也决定了某些图操作的时间复杂度。有关选择及其优缺点在 <a href="./using_adjacency_list.html#sec:choosing-graph-type">选择 <tt>Edgelist</tt> 和 <tt>VertexList</tt></a> 一节中讨论。
++</p><p>模板参数 <tt>Directed</tt> 控制该图是有向的还是无向的,或是可同时访 问入边和出边的有向图(我们称之为双向的)。双向图需要有向图的两倍空间(每条边 ),因为其每条边要同时出现在出边列表和入边列表中。<a href="#fig:undir-adj-list-graph">图 2</a> 示范了一个无向图的邻接表表示法。
+ +</p>+<div align="center"><a name="fig:undir-adj-list-graph"></a><a name="1509"></a>
+<table>+<caption align="bottom"><strong>图 2:</strong> 一个无向图的邻接表表示法。 </caption> +<tbody><tr><td><img src="./figs/undir-adj-matrix-graph2.gif" height="240" width="260"></td>
+<td><img src="./figs/undir-adj-list.gif" height="122" width="62"></td></tr> +</tbody></table> +</div> ++<p>有关如何使用 <tt>adjacency_list</tt> 类的教程,请见 <a href="./using_adjacency_list.html">使用
+<tt>adjacency_list</tt></a> 一节。 + +</p><h3>Example 示例</h3>+<p><a href="../example/family-tree-eg.cpp"><tt>examples/family-tree-eg.cpp</tt></a>
+中的例子示范了如何表示一个图的家族树。 -<P> -The <TT>adjacency_list</TT> class implements a generalized adjacency -list graph structure. The template parameters provide many -configuration options so that you can pick a version of the class that -best meets your needs. An <a -href="graph_theory_review.html#sec:adjacency-list-representation">adjacency-list</a> -is basically a two-dimensional structure, where each element of the -first dimension represents a vertex, and each of the vertices contains -a one-dimensional structure that is its edge list. <a -href="#fig:adj-list-graph">Figure 1</a> shows an adjacency list -representation of a directed graph. - -<P></P> -<DIV ALIGN="center"><A NAME="fig:adj-list-graph"></A><A NAME="1509"></A> -<TABLE>-<CAPTION ALIGN="BOTTOM"><STRONG>Figure 1:</STRONG> Adjacency List Representation of a Directed Graph.</CAPTION> -<TR><TD><IMG SRC="./figs/adj-matrix-graph2.gif" width="386" height="284"></TD>
-<TD><IMG SRC="./figs/adj-list2.gif" width="62" height="122"></TD></TR> -</TABLE> -</DIV><P></P> - -The -<TT>VertexList</TT> template parameter of the <TT>adjacency_list</TT> -class controls what kind of container is used to represent the outer -two-dimensional container. The <TT>OutEdgeList</TT> template parameter -controls what kind of container is used to represent the edge -lists. The choices for <TT>OutEdgeList</TT> and <TT>VertexList</TT> will -determine the space complexity of the graph structure, and will -determine the time complexity of the various graph operations. The -possible choices and tradeoffs are discussed in Section <A -HREF="./using_adjacency_list.html#sec:choosing-graph-type">Choosing -the <TT>Edgelist</TT> and <TT>VertexList</TT></A>. - -<P> -The <TT>Directed</TT> template parameter controls whether the graph is -directed, undirected, or directed with access to both the in-edges and -out-edges (which we call bidirectional). The bidirectional graph takes -up twice the space (per edge) of a directed graph since each edge will -appear in both an out-edge and in-edge list. <a -href="#fig:undir-adj-list-graph">Figure 2</a> shows an adjacency list -representation of an undirected graph. - -<P></P>-<DIV ALIGN="center"><A NAME="fig:undir-adj-list-graph"></A><A NAME="1509"></A>
-<TABLE>-<CAPTION ALIGN="BOTTOM"><STRONG>Figure 2:</STRONG> Adjacency List Representation of an Undirected Graph.</CAPTION> -<TR><TD><IMG SRC="./figs/undir-adj-matrix-graph2.gif" width="260" height="240"></TD>
-<TD><IMG SRC="./figs/undir-adj-list.gif" width="62" height="122"></TD></TR> -</TABLE> -</DIV><P></P> - -<P> -A tutorial on how to use the <TT>adjacency_list</TT> class is in -Section <A HREF="./using_adjacency_list.html">Using -<TT>adjacency_list</TT></A>. - -<P> - -<H3>Example</H3> - -<P> -The example in <a -href="../example/family-tree-eg.cpp"><tt>examples/family-tree-eg.cpp</tt></a> -shows how to represent a family tree with a graph. - -<H3>Template Parameters</H3> - -<P> -<TABLE border> -<TR> +</p><h3>Template Parameters 模板参数</h3> + +<p> +<table border="1"> +<tbody><tr> <th>Parameter</th><th>Description</th><th>Default</th> </tr> -<TR><TD><TT>OutEdgeList</TT></TD> -<TD>The selector for the container used to represent the - edge-list for each of the vertices.</TD> -<TD><TT>vecS</TT></TD> -</TR> - -<TR> -<TD><TT>VertexList</TT></TD> -<TD>The selector for the container used to represent the - vertex-list of the graph.</TD> -<TD><TT>vecS</TT></TD> -</TR> - -<TR> -<TD><TT>Directed</TT></TD>-<TD>A selector to choose whether the graph is directed, undirected, or directed with bidirectional edge access (access to both out-edges and in-edges). The options are <TT>directedS</TT>, <TT>undirectedS</TT>, and <TT>bidirectionalS</TT>.</TD>
-<TD><TT>directedS</TT></TD> -</TR> - -<TR> -<TD><TT>VertexProperties</TT></TD> -<TD>for specifying internal property storage.</TD> -<TD><TT>no_property</TT></TD> -</TR> - -<TR> -<TD><TT>EdgeProperties</TT></TD> -<TD>for specifying internal property storage.</TD> -<TD><TT>no_property</TT></TD> -</TR> - -<TR> -<TD><TT>GraphProperties</TT></TD> -<TD>for specifying property storage for the graph object.</TD> -<TD><TT>no_property</TT></TD> -</TR> - -<TR><TD><TT>EdgeList</TT></TD> -<TD>The selector for the container used to represent the - edge-list for the graph.</TD> -<TD><TT>listS</TT></TD> -</TR> - -</TABLE> -<P> - -<H3>Model of</H3> - -<P> -<a href="./VertexAndEdgeListGraph.html">VertexAndEdgeListGraph</a>, -<a href="./MutablePropertyGraph.html">MutablePropertyGraph</a>, -<a href="../../utility/CopyConstructible.html">CopyConstructible</a>, -<a href="../../utility/Assignable.html">Assignable</a>, -and <a href="../../serialization/doc/index.html">Serializable</a>. - - -<P> - -<H3>Where Defined</H3> - -<P>-<a href="../../../boost/graph/adjacency_list.hpp"><TT>boost/graph/adjacency_list.hpp</TT></a><br><br>
-Also, the serialization functionality is in +<tr><td><tt>OutEdgeList</tt></td> +<td>用于表示每个顶点的边列表的容器的选择子。</td> +<td><tt>vecS</tt></td> +</tr> + +<tr> +<td><tt>VertexList</tt></td> +<td>用于表示图中顶点列表的容器的选择子。</td> +<td><tt>vecS</tt></td> +</tr> + +<tr> +<td><tt>Directed</tt></td>+<td>用于选择该图为有向图、无向图或双向图(同时访问出边和入边)的选择子。选项 为 <tt>directedS</tt>, <tt>undirectedS</tt>, 和 <tt>bidirectionalS</tt>.</td>
+<td><tt>directedS</tt></td> +</tr> + +<tr> +<td><tt>VertexProperties</tt></td> +<td>用于指定内部属性存储。</td> +<td><tt>no_property</tt></td> +</tr> + +<tr> +<td><tt>EdgeProperties</tt></td> +<td>用于指定内部属性存储。</td> +<td><tt>no_property</tt></td> +</tr> + +<tr> +<td><tt>GraphProperties</tt></td> +<td>用于指定图对象的属性存储。</td> +<td><tt>no_property</tt></td> +</tr> + +<tr><td><tt>EdgeList</tt></td> +<td>用于表示图中边列表的容器的选择子。</td> +<td><tt>listS</tt></td> +</tr> + +</tbody></table> +</p><h3>Model of 以...为模型</h3> + +<p>+<a href="./VertexAndEdgeListGraph.html">点边列表图 VertexAndEdgeListGraph</a>, +<a href="./MutablePropertyGraph.html">可变属性图MutablePropertyGraph</a>, <a href="../../utility/CopyConstructible.html">可复制构造 CopyConstructible</a>, +<a href="../../utility/Assignable.html">可赋值Assignable</a>, 和 <a href="../../serialization/doc/index.html">可序列化Serializable</a>。
+ + +</p><h3>Where Defined 定义于</h3> + +<p>+<a href="../../../boost/graph/adjacency_list.hpp"><tt>boost/graph/adjacency_list.hpp</tt></a><br><br>另 外,序列化函数位于 <a href="../../../boost/graph/adj_list_serialize.hpp"><tt>boost/graph/adj_list_serialize.hpp</tt></a>.
-<P> +</p><h2>Vertex and Edge Properties 顶点属性与边属性</h2> -<H2>Vertex and Edge Properties</H2>+<p>象颜色、距离、权重这样的属性,以及其它用户自定义的属性,可以关联到图的顶 点和边上。属性值可以通过由图提供的属性映射来读出或写入。属性映射通过函数 <tt>get(property, g)</tt> 获得。如何使用属性在 <a href="./using_adjacency_list.html#sec:adjacency-list-properties">内部属性 Internal +Properties </a>一节中描述。属性映射是实现了在 <a href="../../property_map/property_map.html">属性映射概念 Property Map +Concepts</a> 一节所定义的接口的对象,也可能是 <a href="bundles.html">绑定属 性 bundled properties</a>,它具有更为简洁的语法。所有属性值的类型都必须是可 复制构造、可赋值和可缺省构造的。从 +<tt>adjacency_list</tt> 类获得的属性映射符合 <a href="../../property_map/LvaluePropertyMap.html">左值属性映射 Lvalue Property +Map</a> 概念。如果 <tt>adjacency_list</tt> 是 const 的,则它的属性映射也是 常性的,否则是可变的。
++</p><p>如果图的 <tt>VertexList</tt> 是 <tt>vecS</tt>,则该图具有一个内建的 顶点索引,可以通过 <tt>vertex_index_t</tt> 属性的属性映射来访问。该索引的值 位于区间 +<tt>[0, num_vertices(g))</tt> 中且连续取值。当从图中移除一个顶点时,其它顶 点的索引将被调整,以保持这一特性。在使用这些索引来访问外部属性存储时必须是小 心。顶点索引的属性映射是一个 <a href="../../property_map/ReadablePropertyMap.html">可读属性映射Readable
+Property Map</a>。 -<P> -Properties such as color, distance, weight, and user-defined -properties can be attached to the vertices and edges of the graph -using properties. The property values can be read from and written to -via the property maps provided by the graph. The property maps are -obtained via the <TT>get(property, g)</TT> function. How to use -properties is described in Section <A -HREF="./using_adjacency_list.html#sec:adjacency-list-properties">Internal -Properties </A>. The property maps are objects that implement the -interface defined in Section <A -HREF="../../property_map/property_map.html">Property Map -Concepts</A> or may be <a href="bundles.html">bundled properties</a>, -which have a more succinct syntax. The types of all property values -must be Copy Constructible, Assignable, and Default Constructible. -The property maps obtained from the -<TT>adjacency_list</TT> class are models of the <a -href="../../property_map/LvaluePropertyMap.html">Lvalue Property -Map</a> concept. If the <TT>adjacency_list</TT> is const, -then the property map is constant, otherwise the property -map is mutable. - -<P> -If the <TT>VertexList</TT> of the graph is <TT>vecS</TT>, then the -graph has a builtin vertex indices accessed via the property map for -the <TT>vertex_index_t</TT> property. The indices fall in the range -<TT>[0, num_vertices(g))</TT> and are contiguous. When a vertex is -removed the indices are adjusted so that they retain these -properties. Some care must be taken when using these indices to access -exterior property storage. The property map for vertex index is a -model of <a href="../../property_map/ReadablePropertyMap.html">Readable -Property Map</a>. - -<P> - -<h2>Iterator and Descriptor Stability/Invalidation</h2> - -Some care must be taken when changing the structure of a graph (via -adding or removing edges). Depending on the type of -<tt>adjacency_list</tt> and on the operation, some of the iterator or -descriptor objects that point into the graph may become invalid. For -example, the following code will result in undefined (bad) behavior:+</p><h2>Iterator and Descriptor Stability/Invalidation 迭代器与描述符的稳定 性/失效性</h2>在修改一个图的结构(通过增加或删除边)时,必须要留意。根据不同的 +<tt>adjacency_list</tt> 类型以及具体的操作,有些指向该图的迭代器或描述符可 能会失效。例如,以下代码将导致未定义(坏的)行为:
-<pre>- typedef adjacency_list<listS, vecS> Graph; <b>// VertexList=vecS</b> +<pre> typedef adjacency_list<listS, vecS> Graph; <b>// VertexList=vecS</b>
Graph G(N); - <b>// Fill in the graph...</b> + <b>// 填充该图...</b> - <b>// Attempt to remove all the vertices. Wrong!</b> + <b>// 试图移除所有顶点。错误!</b> graph_traits<Graph>::vertex_iterator vi, vi_end; for (tie(vi, vi_end) = vertices(G); vi != vi_end; ++vi) remove_vertex(*vi, G); - <b>// Remove all the vertices. This is still wrong!</b> + <b>// 移除所有顶点。仍然是错的!</b> graph_traits<Graph>::vertex_iterator vi, vi_end, next; tie(vi, vi_end) = vertices(G); for (next = vi; vi != vi_end; vi = next) { ++next; remove_vertex(*vi, G); } -</pre> - -The reason this is a problem is that we are invoking -<tt>remove_vertex()</tt>, which when used with an -<tt>adjacency_list</tt> where <tt>VertexList=vecS</tt>, invalidates -all iterators and descriptors for the graph (such as <tt>vi</tt> and -<tt>vi_end</tt>), thereby causing trouble in subsequent iterations of -the loop. +</pre>这里错误的原因是,我们调用了 +<tt>remove_vertex()</tt>,当该函数用于带 <tt>VertexList=vecS</tt> 的 +<tt>adjacency_list</tt>时,会令图中所有迭代器及描述符(如 <tt>vi</tt> 和 +<tt>vi_end</tt>)失效,从而导致后续循环出错。 -<p> +<p>如果我们使用另一种不同的 <tt>adjacency_list</tt>,令+<tt>VertexList=listS</tt>,则在调用 <tt>remove_vertex</tt> 后,除了指向被移 除顶点的迭代器外,其它迭代器不会失效。以下代码为示例。
-If we use a different kind of <tt>adjacency_list</tt>, where -<tt>VertexList=listS</tt>, then the iterators are not invalidated by -calling <tt>remove_vertex</tt> unless the iterator is pointing to the -actual vertex that was removed. The following code demonstrates this. - -<pre>- typedef adjacency_list<listS, listS> Graph; <b>// VertexList=listS</b> +</p><pre> typedef adjacency_list<listS, listS> Graph; <b>// VertexList=listS</b>
Graph G(N); - <b>// Fill in the graph...</b> + <b>// 填充该图...</b> - <b>// Attempt to remove all the vertices. Wrong!</b> + <b>// 试图移除所有顶点。错误!</b> graph_traits<Graph>::vertex_iterator vi, vi_end; for (tie(vi, vi_end) = vertices(G); vi != vi_end; ++vi) remove_vertex(*vi, G); - <b>// Remove all the vertices. This is OK.</b> + <b>// 移除所有顶点。正确。</b> graph_traits<Graph>::vertex_iterator vi, vi_end, next; tie(vi, vi_end) = vertices(G); for (next = vi; vi != vi_end; vi = next) { @@ -259,70 +168,37 @@ } </pre> -<p> - -The stability issue also affects vertex and edge descriptors. For -example, suppose you use vector of vertex descriptors to keep track of -the parents (or predecessors) of vertices in a shortest paths tree -(see <a -href="../example/dijkstra-example.cpp"><tt>examples/dijkstra-example.cpp</tt></a>). -You create the parent vector with a call to -<tt>dijkstra_shortest_paths()</tt>, and then remove a vertex from the -graph. Subsequently you try to use the parent vector, but since all -vertex descriptors have become invalid, the result is incorrect. - -<pre> - std::vector<Vertex> parent(num_vertices(G)); - std::vector<Vertex> distance(num_vertices(G)); - - dijkstra_shortest_paths(G, s, distance_map(&distance[0]). - predecessor_map(&parent[0]));+<p>这个稳定性问题同样会影响顶点描述符和边描述符。例如,假设你使用了一个顶点 描述符的向量来跟踪最短路径树中的父顶点(或前趋)(参见 <a href="../example/dijkstra-example.cpp"><tt>examples/dijkstra-example.cpp</tt></a>)。 你通过调用 +<tt>dijkstra_shortest_paths()</tt> 创建了这个父顶点向量,然后从图中移除了某 个顶点。接着你又试图使用这个父顶点向量,但是由于所有顶点描述符已经失效,所以 结果是错误的。
- remove_vertex(s, G); <b>// Bad idea! Invalidates vertex descriptors in parent vector.</b> +</p><pre> std::vector<Vertex> parent(num_vertices(G));<br> std::vector<Vertex> distance(num_vertices(G));<br><br> dijkstra_shortest_paths(G, s, distance_map(&distance[0]).<br> predecessor_map(&parent[0]));<br><br> remove_vertex(s, G); <b>// 坏主 意!父顶点向量中的顶点描述符是失效的。</b>
- <b>// The following will produce incorrect results</b> + <b>// 以下代码将产生错误结果</b> for(tie(vi, vend) = vertices(G); vi != vend; ++vi) - std::cout << p[*vi] << " is the parent of " << *vi << std::endl;+ std::cout << p[*vi] << " is the parent of " << *vi << std::endl;
</pre> -<p> -Note that in this discussion iterator and descriptor invalidation is -concerned with the invalidation of iterators and descriptors that are -<b>not directly affected</b> by the operation. For example, performing -<tt>remove_edge(u, v, g)</tt> will always invalidate any edge -descriptor for <i>(u,v)</i> or edge iterator pointing to <i>(u,v)</i>, -regardless of the kind <tt>adjacency_list</tt>. In this discussion -of iterator and descriptor invalidation, we are only concerned with the -affect of <tt>remove_edge(u, v, g)</tt> on edge descriptors and -iterators that point to other edges (not <i>(u,v)</i>).+<p>注意,这里所讨论的迭代器和描述符失效,只考虑那些不是由操作直接导致的迭代 器和描述符失效。例如,执行 +<tt>remove_edge(u, v, g)</tt> 总会令 <i>(u,v)</i> 的任何边描述符或指向 <i>(u,v)</i> 的边迭代器失效,不论使用何种 <tt>adjacency_list</tt>。在这个对 迭代器和描述符失效的讨论中,我们只关心 <tt>remove_edge(u, v, g)</tt> 对那些 指向其它边(非 <i>(u,v)</i>)的描述符和迭代器的影响。
-<p> -In general, if you want your vertex and edge descriptors to be stable -(never invalidated) then use <tt>listS</tt> or <tt>setS</tt> for the -<tt>VertexList</tt> and <tt>OutEdgeList</tt> template parameters of -<tt>adjacency_list</tt>. If you are not as concerned about descriptor -and iterator stability, and are more concerned about memory -consumption and graph traversal speed, use <tt>vecS</tt> for the -<tt>VertexList</tt> and/or <tt>OutEdgeList</tt> template parameters.+</p><p>一般来说,如果你希望你的顶点描述符和边描述符是稳定的(永不失效),那么 请对
+<tt>adjacency_list</tt> 的+<tt>VertexList</tt> 和 <tt>OutEdgeList</tt> 模板参数使用 <tt>listS</tt> 或 <tt>setS</tt>。如果你不关心描述符和迭代器的稳定性,而更关心内存的消耗和图遍 历的速度,那么就对
+<tt>VertexList</tt> 和/或 <tt>OutEdgeList</tt> 模板参数使用 <tt>vecS</tt>。 -<p> -The following table summarizes which operations cause descriptors and -iterators to become invalid. In the table, <tt>EL</tt> is an -abbreviation for <tt>OutEdgeList</tt> and <tt>VL</tt> means -<tt>VertexList</tt>. The <b>Adj Iter</b> category includes the -<tt>out_edge_iterator</tt>, <tt>in_edge_iterator</tt>, and -<tt>adjacency_iterator</tt> types. A more detailed description of -descriptor and iterator invalidation is given in the documentation for -each operation.+</p><p>下表概括了哪些操作将导致描述符和迭代器失效。在该表中,<tt>EL</tt> 是 <tt>OutEdgeList</tt> 的缩写,<tt>VL</tt> 则代表
+<tt>VertexList</tt>。类别 <b>Adj Iter</b> 包括了 +<tt>out_edge_iterator</tt>, <tt>in_edge_iterator</tt>, 和+<tt>adjacency_iterator</tt> 类型。对于描述符和迭代器失效的更为详细的说 明,在各个操作的文档中给出。
-<p> +</p><p> -<table border> -<CAPTION ALIGN="BOTTOM"><STRONG>Table:</STRONG> - Summary of Descriptor and Iterator Invalidation. - </CAPTION> -<tr> +<table border="1"> +<caption align="bottom"><strong>表:</strong> + 关于描述符和迭代器失效的概括 + </caption> +<tbody><tr> <th>Function</th> <th>Vertex Desc</th> <th>Edge Desc</th> @@ -333,749 +209,400 @@ <tr> <td> <tt>add_edge()</tt></td> - <td align=center><tt>OK</tt></td> - <td align=center><tt>OK</tt></td> - <td align=center><tt>OK</tt></td>- <td align=center><tt>EL=vecS && <br>Directed=directedS</tt></td>
- <td align=center><tt>EL=vecS</tt></td> + <td align="center"><tt>OK</tt></td> + <td align="center"><tt>OK</tt></td> + <td align="center"><tt>OK</tt></td>+ <td align="center"><tt>EL=vecS && <br>Directed=directedS</tt></td>
+ <td align="center"><tt>EL=vecS</tt></td> </tr> <tr> <td><tt>remove_edge()<br>remove_edge_if()<br>remove_out_edge_if()<br> remove_in_edge_if()<br>clear_vertex()</tt> </td> - <td align=center><tt>OK</tt></td> - <td align=center><tt>OK</tt></td> - <td align=center><tt>OK</tt></td>- <td align=center><tt>EL=vecS && <br>Directed=directedS</tt></td>
- <td align=center><tt>EL=vecS</tt></td> + <td align="center"><tt>OK</tt></td> + <td align="center"><tt>OK</tt></td> + <td align="center"><tt>OK</tt></td>+ <td align="center"><tt>EL=vecS && <br>Directed=directedS</tt></td>
+ <td align="center"><tt>EL=vecS</tt></td> </tr> <tr> <td><tt>add_vertex()</tt></td> - <td align=center><tt>OK</tt></td> - <td align=center><tt>OK</tt></td> - <td align=center><tt>OK</tt></td>- <td align=center><tt>VL=vecS && <br/> Directed=directedS</tt></td> - <td align=center><tt>VL=vecS && <br/> Directed=directedS</tt></td>
+ <td align="center"><tt>OK</tt></td> + <td align="center"><tt>OK</tt></td> + <td align="center"><tt>OK</tt></td>+ <td align="center"><tt>VL=vecS && <br> Directed=directedS</tt></td> + <td align="center"><tt>VL=vecS && <br> Directed=directedS</tt></td>
</tr> <tr> <td><tt>remove_vertex()</tt></td> - <td align=center><tt>VL=vecS</tt></td> - <td align=center><tt>VL=vecS</tt></td> - <td align=center><tt>VL=vecS</tt></td> - <td align=center><tt>VL=vecS</tt></td> - <td align=center><tt>VL=vecS</tt></td> + <td align="center"><tt>VL=vecS</tt></td> + <td align="center"><tt>VL=vecS</tt></td> + <td align="center"><tt>VL=vecS</tt></td> + <td align="center"><tt>VL=vecS</tt></td> + <td align="center"><tt>VL=vecS</tt></td> </tr> -</table> +</tbody></table> -<H2>Associated Types</H2> +</p><h2>Associated Types 关联类型</h2> <hr> <tt>graph_traits<adjacency_list>::vertex_descriptor</tt> <br> -and -<br> +和 <br><tt>adjacency_list_traits<OutEdgeList, VertexList, Directed, EdgeList>::vertex_descriptor</tt>
-<br><br> -The type for the vertex descriptors associated with the -<TT>adjacency_list</TT>. +<br><br>与 +<tt>adjacency_list</tt> 相关联的顶点描述符类型。 <hr> -<tt>graph_traits<adjacency_list>::edge_descriptor</tt><br> -and<br> +<tt>graph_traits<adjacency_list>::edge_descriptor</tt><br>和<br><tt>adjacency_list_traits<OutEdgeList, VertexList, Directed, EdgeList>::edge_descriptor</tt>
<br><br> -The type for the edge descriptors associated with the -<TT>adjacency_list</TT>. +与 <tt>adjacency_list</tt> 相关联的边描述符类型。 <hr> <tt>graph_traits<adjacency_list>::vertex_iterator</tt> -<br><br> -The type for the iterators returned by <TT>vertices()</TT>. - -When <tt>VertexList=vecS</tt> then the <tt>vertex_iterator</tt> models -<a-href="http://www.sgi.com/tech/stl/RandomAccessIterator.html";>RandomAccessIterator</a>. Otherwise
-the <tt>vertex_iterator</tt> models <a -href="http://www.sgi.com/tech/stl/BidirectionalIterator.html";>BidirectionalIterator</a>.+<br><br>这是 <tt>vertices()</tt> 所返回的迭代器类型。若 <tt>VertexList=vecS</tt> 则 <tt>vertex_iterator</tt> 为 +<a href="http://www.sgi.com/tech/stl/RandomAccessIterator.html";>随机访问迭 代器</a>。否则 <tt>vertex_iterator</tt> 为 <a href="http://www.sgi.com/tech/stl/BidirectionalIterator.html";>双向迭代器 </a>。
<hr> <tt>graph_traits<adjacency_list>::edge_iterator</tt> -<br><br> -The type for the iterators returned by <TT>edges()</TT>. -The <tt>edge_iterator</tt> models <a -href="http://www.sgi.com/tech/stl/BidirectionalIterator.html";>BidirectionalIterator</a>.+<br><br>这是 <tt>edges()</tt> 所返回的迭代器类型。<tt>edge_iterator</tt> 为 <a href="http://www.sgi.com/tech/stl/BidirectionalIterator.html";>双向迭代 器</a>。
<hr> <tt>graph_traits<adjacency_list>::out_edge_iterator</tt> -<br><br> - -The type for the iterators returned by <TT>out_edges()</TT>. -When <tt>OutEdgeList=vecS</tt> then the <tt>out_edge_iterator</tt> models+<br><br>这是 <tt>out_edges()</tt> 所返回的迭代器类型。若 <tt>OutEdgeList=vecS</tt> 则 <tt>out_edge_iterator</tt> 为
<a href="http://www.sgi.com/tech/stl/RandomAccessIterator.html";> -RandomAccessIterator</a>. When <tt>OutEdgeList=slistS</tt> then the -<tt>out_edge_iterator</tt> models <a -href="http://www.sgi.com/tech/stl/ForwardIterator.html";> -ForwardIterator</a>. Otherwise the <tt>out_edge_iterator</tt> models -<a -href="http://www.sgi.com/tech/stl/BidirectionalIterator.html";> -BidirectionalIterator</a>. +随机访问迭代器</a>。若 <tt>OutEdgeList=slistS</tt> 则+<tt>out_edge_iterator</tt> 为 <a href="http://www.sgi.com/tech/stl/ForwardIterator.html";>
+前向迭代器</a>。否则 <tt>out_edge_iterator</tt> 为 +<a href="http://www.sgi.com/tech/stl/BidirectionalIterator.html";> +双向迭代器</a>。 <hr> <tt>graph_traits<adjacency_list>::adjacency_iterator</tt> -<br><br> -The type for the iterators returned by <TT>adjacent_vertices()</TT>. -The <tt>adjacency_iterator</tt> models the same iterator concept -as <tt>out_edge_iterator</tt>.+<br><br>这是 <tt>adjacent_vertices()</tt> 所返回的迭代器类型。 <tt>adjacency_iterator</tt> 为与 <tt>out_edge_iterator</tt> 相同的迭代器概 念。
<hr> <tt>adjacency_list::inv_adjacency_iterator</tt> -<br><br> -The type for the iterators returned by <TT>inv_adjacent_vertices()</TT>. -The <tt>inv_adjacency_iterator</tt> models the same iterator concept -as <tt>out_edge_iterator</tt>.+<br><br>这是 <tt>inv_adjacent_vertices()</tt> 所返回的迭代器类型。 <tt>inv_adjacency_iterator</tt> 为与 <tt>out_edge_iterator</tt> 相同的迭代器 概念。
<hr> <tt>graph_traits<adjacency_list>::directed_category</tt><br> -and<br> +和<br><tt>adjacency_list_traits<OutEdgeList, VertexList, Directed, EdgeList>::directed_category</tt>
-<br><br> -Provides information about whether the graph is -directed (<TT>directed_tag</TT>) or undirected -(<TT>undirected_tag</TT>).+<br><br>提供关于该图是有向图(<tt>directed_tag</tt>)或是无向图 (<tt>undirected_tag</tt>)的信息。
<hr> -<tt>graph_traits<adjacency_list>::edge_parallel_category</tt><br> -and<br>+<tt>graph_traits<adjacency_list>::edge_parallel_category</tt><br>和 <br> <tt>adjacency_list_traits<OutEdgeList, VertexList, Directed, EdgeList>::edge_parallel_category</tt>
-<br><br> -This describes whether the graph class allows the insertion of -parallel edges (edges with the same source and target). The two tags -are <TT>allow_parallel_edge-_tag</TT> and -<TT>disallow_parallel_edge_tag</TT>. The -<TT>setS</TT> and <TT>hash_setS</TT> variants disallow -parallel edges while the others allow parallel edges.+<br><br>用于描述该图类是否允许插入平行边(具有相同源及目标的边)。两个标签分 别为 <tt>allow_parallel_edge-_tag</tt> 和
+<tt>disallow_parallel_edge_tag</tt>。变体 +<tt>setS</tt> 和 <tt>hash_setS</tt> 不允许平行边,而其它则允许平行边。 <hr> <tt>graph_traits<adjacency_list>::vertices_size_type</tt><br> -and<br> +和<br><tt>adjacency_list_traits<OutEdgeList, VertexList, Directed_list, EdgeList>::vertices_size_type</tt><br>
-<br><br> -The type used for dealing with the number of vertices in the graph. +<br>该类型用于处理图中的顶点数量。 <hr> <tt>graph_traits<adjacency_list>::edge_size_type</tt><br> -and<br> +和<br><tt>adjacency_list_traits<OutEdgeList, VertexList, Directed_list, EdgeList>::edge_size_type</tt><br>
-<br><br> -The type used for dealing with the number of edges in the graph. +<br> +该类型用于处理图中的边数量。 <hr> <tt>graph_traits<adjacency_list>::degree_size_type</tt> -<br><br> -The type used for dealing with the number of edges incident to a vertex -in the graph. +<br><br>该类型用于处理图中与单个顶点关联的度数。 <hr> <tt>property_map<adjacency_list, Property>::type</tt><br> -and<br> +和<br> <tt>property_map<adjacency_list, Property>::const_type</tt> -<br><br> -The property map type for vertex or edge properties in the graph. The -specific property is specified by the <TT>Property</TT> template argument, -and must match one of the properties specified in the -<TT>VertexProperties</TT> or <TT>EdgeProperties</TT> for the graph.+<br><br>用于图中顶点属性或边属性的属性映射类型。特定属性由模板参数 <tt>Property</tt> 指定,必须匹配于该图的
+<tt>VertexProperties</tt> 或 <tt>EdgeProperties</tt> 中指定的某个属性。 <hr> <tt>graph_property<adjacency_list, Property>::type</tt> -<br><br> -The property value type for the graph property specified by the -<tt>Property</tt> tag. +<br><br>由 <tt>Property</tt> 标签所指定的图属性的属性值类型。 <hr> <tt>adjacency_list::out_edge_list_selector</tt> -<br><br> -The type <tt>OutEdgeListS</tt>. +<br><br>类型 <tt>OutEdgeListS</tt>. <hr> <tt>adjacency_list::vertex_list_selector</tt> -<br><br> -The type <tt>VertexListS</tt>. +<br><br>类型 <tt>VertexListS</tt>. <hr> <tt>adjacency_list::directed_selector</tt> -<br><br> -The type <tt>DirectedS</tt>. +<br><br>类型 <tt>DirectedS</tt>. <hr> <tt>adjacency_list::edge_list_selector</tt> -<br><br> -The type <tt>EdgeListS</tt>. +<br><br>类型 <tt>EdgeListS</tt>. <hr> -<H2>Member Functions</H2> +<h2>Member Functions 成员函数</h2> <hr> -<pre> -adjacency_list(const GraphProperty& p = GraphProperty()) -</pre> -Default constructor. Creates an empty graph object with zero vertices -and zero edges.+<pre>adjacency_list(const GraphProperty& p = GraphProperty())<br></pre>缺省构造函数。创建一个零顶点零边的空图对象。
<hr> -<pre> -adjacency_list(const adjacency_list& x) -</pre> -Copy constructor. Creates a new graph that is a copy of graph -<tt>x</tt>, including the edges, vertices, and properties.+<pre>adjacency_list(const adjacency_list& x)<br></pre>复制构 造函数。创建一个新的图,为图
+<tt>x</tt> 的拷贝,包括边、顶点和属性。 <hr> -<pre> -adjacency_list& operator=(const adjacency_list& x) -</pre> -Assignment operator. Makes this graph a copy of graph -<tt>x</tt>, including the edges, vertices, and properties.+<pre>adjacency_list& operator=(const adjacency_list& x)<br></pre>赋值操作符。令本图 成为图
+<tt>x</tt> 的拷贝,包括边、顶点和属性。 <hr> -<pre> -adjacency_list(vertices_size_type n, - const GraphProperty& p = GraphProperty()) -</pre> -Creates a graph object with <TT>n</TT> vertices and zero edges.+<pre>adjacency_list(vertices_size_type n,<br> const GraphProperty& p = GraphProperty())<br></pre>创建一个具 有 <tt>n</tt> 个顶点和零条边的图对象。
<hr> <a name="sec:iterator-constructor"> -<pre> -template <class EdgeIterator> -adjacency_list(EdgeIterator first, EdgeIterator last, - vertices_size_type n, - edges_size_type m = 0,- const GraphProperty& p = GraphProperty())
-</pre> -Creates a graph object with <TT>n</TT> vertices and with the edges -specified in the edge list given by the range <TT>[first, last)</TT>. -The <tt>EdgeIterator</tt> must be a model of <a -href="http://www.sgi.com/tech/stl/InputIterator.html";>InputIterator</a>. -The value type of the <TT>EdgeIterator</TT> must be a -<TT>std::pair</TT>, where the type in the pair is an integer type. The -integers will correspond to vertices, and they must all fall in the -range of <TT>[0, n)</TT>. -</a>+<pre>template <class EdgeIterator><br>adjacency_list(EdgeIterator first, EdgeIterator last,<br> vertices_size_type n,<br> edges_size_type m = 0,<br> const GraphProperty& p = GraphProperty())<br></pre> +创建一个具有 <tt>n</tt> 个顶点的图对象,并以区间 <tt>[first, last)</tt> 给 出的边列表中所指定的为边。<tt>EdgeIterator</tt> 必须为 </a><a href="http://www.sgi.com/tech/stl/InputIterator.html";>输入迭代器</a>。 <tt>EdgeIterator</tt> 的值类型必须为 +<tt>std::pair</tt>,且 pair 中的类型为整数类型。这些整数对应于各顶点,且必 须全部位于区间 <tt>[0, n)</tt> 中。
+ <hr> -<pre> -template <class EdgeIterator, class EdgePropertyIterator> -adjacency_list(EdgeIterator first, EdgeIterator last, - EdgePropertyIterator ep_iter, - vertices_size_type n, - vertices_size_type m = 0,- const GraphProperty& p = GraphProperty())
-</pre> -Creates a graph object with <TT>n</TT> vertices and with the edges -specified in the edge list given by the range <TT>[first, last)</TT>. -The <tt>EdgeIterator</tt> and <tt>EdgePropertyIterator</tt> must be a -model of <a -href="http://www.sgi.com/tech/stl/InputIterator.html";>InputIterator</a>. -The value type of the <TT>EdgeIterator</TT> must be a -<TT>std::pair</TT>, where the type in the pair is an integer type. The -integers will correspond to vertices, and they must all fall in the -range of <TT>[0, n)</TT>. The <TT>value_type</TT> of the -<TT>ep_iter</TT> should be <TT>EdgeProperties</TT>.+<pre>template <class EdgeIterator, class EdgePropertyIterator><br>adjacency_list(EdgeIterator first, EdgeIterator last,<br> EdgePropertyIterator ep_iter,<br> vertices_size_type n,<br> vertices_size_type m = 0,<br> const GraphProperty& p = GraphProperty())<br></pre>创 建一个具有 <tt>n</tt> 个顶点的图对象,并以区间 <tt>[first, last)</tt> 给出的 边列表中所指定的为边。<tt>EdgeIterator</tt> <tt>和 EdgePropertyIterator</tt> 必须为 <a href="http://www.sgi.com/tech/stl/InputIterator.html";>输入迭代器</a>。 <tt>EdgeIterator</tt> 的值类型必须为 +<tt>std::pair</tt>,且 pair 中的类型为整数类型。这些整数对应于各顶点,且必 须全部位于区间 <tt>[0, n)</tt> 中。<tt>ep_iter</tt> 的 <tt>value_type</tt> 应为 <tt>EdgeProperties</tt>。
<hr> -<pre> -void clear() -</pre> -Remove all of the edges and vertices from the graph. +<pre>void clear()<br></pre>从图中移除所有边和顶点。 <hr> -<pre> -void swap(adjacency_list& x) -</pre> -Swap the vertices, edges, and properties of this graph with the -vertices, edges, and properties of graph <tt>x</tt>.+<pre>void swap(adjacency_list& x)<br></pre>交换本图与图 <tt>x</tt> 的顶 点、边和属性。
<hr> -<P> - -<H2>Non-Member Functions</H2> +<h2>Non-Member Functions 非成员函数</h2> -<h4>Structure Access</h4> +<h4>Structure Access 结构访问</h4> <hr> -<pre> -std::pair<vertex_iterator, vertex_iterator> -vertices(const adjacency_list& g) -</pre> -Returns an iterator-range providing access to the vertex set of graph -<tt>g</tt>.+<pre>std::pair<vertex_iterator, vertex_iterator><br>vertices(const adjacency_list& g)<br></pre>返回一个迭代器区间,提供对图
+<tt>g</tt> 的顶点集的访问。 <hr> -<pre> -std::pair<edge_iterator, edge_iterator> -edges(const adjacency_list& g) -</pre> -Returns an iterator-range providing access to the edge set of graph -<tt>g</tt>.+<pre>std::pair<edge_iterator, edge_iterator><br>edges(const adjacency_list& g)<br></pre>返回一个迭代器区间,提供对图
+<tt>g</tt> 的边集的访问。 <hr> -<pre> -std::pair<adjacency_iterator, adjacency_iterator>-adjacent_vertices(vertex_descriptor u, const adjacency_list& g)
-</pre> -Returns an iterator-range providing access to the vertices adjacent to -vertex <tt>u</tt> in graph <tt>g</tt>. For example, if <tt>u -> v</tt> -is an edge in the graph, then <tt>v</tt> will be in this iterator-range.+<pre>std::pair<adjacency_iterator, adjacency_iterator><br>adjacent_vertices(vertex_descriptor u, const adjacency_list& g)<br></pre>返 回一个迭代器区间,提供对 图 <tt>g</tt> 的顶点 <tt>u</tt> 的邻接顶点的访问。例如,如果 <tt>u -> v</tt>
+是图中的一条边,则 <tt>v</tt> 将在这个迭代器区间中。 <hr> -<pre> -std::pair<inv_adjacency_iterator, inv_adjacency_iterator>-inv_adjacent_vertices(vertex_descriptor u, const adjacency_list& g)
-</pre> - -Returns an iterator-range providing access to the vertices in graph -<tt>g</tt> to which <tt>u</tt> is adjacent. (<tt>inv</tt> is for -inverse.) For example, if <tt>v -> u</tt> is an edge in the graph, -then <tt>v</tt> will be in this iterator range. This function is only -available for bidirectional and undirected <tt>adjacency_list</tt>'s.+<pre>std::pair<inv_adjacency_iterator, inv_adjacency_iterator><br>inv_adjacent_vertices(vertex_descriptor u, const adjacency_list& g)<br></pre>返 回一个迭代器区间,提供对图 +<tt>g</tt> 中那些以 <tt>u</tt> 为邻接的顶点的访问(<tt>inv</tt> 即反向)。例 如,如果 <tt>v -> u</tt> 是图中的一条边,则 <tt>v</tt> 将在这个迭代器区间 中。该函数仅对双向或无向 <tt>adjacency_list</tt> 有效。
<hr> -<pre> -std::pair<out_edge_iterator, out_edge_iterator> -out_edges(vertex_descriptor u, const adjacency_list& g) -</pre> -Returns an iterator-range providing access to the out-edges of vertex -<tt>u</tt> in graph <tt>g</tt>. If the graph is undirected, this -iterator-range provides access to all edges incident on vertex -<tt>u</tt>. For both directed and undirected graphs, for an out-edge -<tt>e</tt>, <tt>source(e, g) == u</tt> and <tt>target(e, g) == v</tt> -where <tt>v</tt> is a vertex adjacent to <tt>u</tt>.+<pre>std::pair<out_edge_iterator, out_edge_iterator><br>out_edges(vertex_descriptor u, const adjacency_list& g)<br></pre>返 回一个迭代器区间,提供对图 <tt></tt> <tt>g</tt> 的顶点
+<tt>u</tt> 的出边的访问。如果是无向图,则该迭代器区间提供对顶点 +<tt>u</tt> 的所有邻接边的访问。对于有向图和无向图的一条出边+<tt>e</tt>,都有 <tt>source(e, g) == u</tt> 且 <tt>target(e, g) == v</tt>,其中 <tt>v</tt> 为邻接于 <tt>u</tt> 的顶点。
<hr> -<pre> -std::pair<in_edge_iterator, in_edge_iterator> -in_edges(vertex_descriptor v, const adjacency_list& g) -</pre> -Returns an iterator-range providing access to the in-edges of vertex -<tt>v</tt> in graph <tt>g</tt>. This operation is only available if -<TT>bidirectionalS</TT> was specified for the <TT>Directed</TT> -template parameter. For an in-edge <tt>e</tt>, <tt>target(e, g) == v</tt> -and <tt>source(e, g) == u</tt> for some vertex <tt>u</tt> that is -adjacent to <tt>v</tt>, whether the graph is directed or undirected.+<pre>std::pair<in_edge_iterator, in_edge_iterator><br>in_edges(vertex_descriptor v, const adjacency_list& g)<br></pre>返 回一个迭代器区间,提供对 图 <tt>g</tt> 的顶点 <tt>v</tt><tt></tt> 的入边的访问。该操作仅当
+<tt>bidirectionalS</tt> 被指定为 <tt>Directed</tt>+模板参数时有效。对于一条入边 <tt>e</tt>,<tt>target(e, g) == v</tt> 且 <tt>source(e, g) == u</tt> 对于邻接于 <tt>v</tt> 的顶点 <tt>u</tt> 成立,无 论是有向图或无向图。
<hr> -<pre> -vertex_descriptor -source(edge_descriptor e, const adjacency_list& g) -</pre> -Returns the source vertex of edge <tt>e</tt>.+<pre>vertex_descriptor<br>source(edge_descriptor e, const adjacency_list& g)<br></pre>返回边 <tt>e</tt> 的源顶点。
<hr> -<pre> -vertex_descriptor -target(edge_descriptor e, const adjacency_list& g) -</pre> -Returns the target vertex of edge <tt>e</tt>.+<pre>vertex_descriptor<br>target(edge_descriptor e, const adjacency_list& g)<br></pre>返回边 <tt>e</tt> 的目标顶 点。
<hr> -<pre> -degree_size_type -out_degree(vertex_descriptor u, const adjacency_list& g) -</pre> -Returns the number of edges leaving vertex <tt>u</tt>.+<pre>degree_size_type<br>out_degree(vertex_descriptor u, const adjacency_list& g)<br></pre>返回顶点 <tt>u</tt> 的出边数 量。
<hr> -<pre> -degree_size_type -in_degree(vertex_descriptor u, const adjacency_list& g) -</pre> -Returns the number of edges entering vertex <tt>u</tt>. This operation -is only available if <TT>bidirectionalS</TT> was specified for -the <TT>Directed</TT> template parameter.+<pre>degree_size_type<br>in_degree(vertex_descriptor u, const adjacency_list& g)<br></pre>返回顶点 <tt>u</tt> 的入边数 量。该操作仅当 <tt>bidirectionalS</tt> 被指定为 <tt>Directed</tt> 模板参数时 有效。
<hr> -<pre> -vertices_size_type -num_vertices(const adjacency_list& g) -</pre> -Returns the number of vertices in the graph <tt>g</tt>.+<pre>vertices_size_type<br>num_vertices(const adjacency_list& g)<br></pre>返回图 <tt>g</tt> 中的顶点数量。
<hr> -<pre> -edges_size_type -num_edges(const adjacency_list& g) -</pre> -Returns the number of edges in the graph <tt>g</tt>.+<pre>edges_size_type<br>num_edges(const adjacency_list& g)<br></pre>返 回图 <tt>g</tt> 中的边数量。
<hr> -<pre> -vertex_descriptor -vertex(vertices_size_type n, const adjacency_list& g) -</pre> -Returns the nth vertex in the graph's vertex list.+<pre>vertex_descriptor<br>vertex(vertices_size_type n, const adjacency_list& g)<br></pre>返回图的顶点列表中的第 n 个 顶点。
<hr> -<pre> -std::pair<edge_descriptor, bool> -edge(vertex_descriptor u, vertex_descriptor v, - const adjacency_list& g) -</pre> -Returns an edge connecting vertex <tt>u</tt> to vertex <tt>v</tt> in -graph <tt>g</tt>.+<pre>std::pair<edge_descriptor, bool><br>edge(vertex_descriptor u, vertex_descriptor v,<br> const adjacency_list& g)<br></pre>返回图 <tt>g</tt> 中连接顶 点 <tt>u</tt> 和 <tt>v</tt> 的一条边。
<hr> -<pre> -std::pair<out_edge_iterator, out_edge_iterator> -edge_range(vertex_descriptor u, vertex_descriptor v, - const adjacency_list& g) -</pre> -Returns a pair of out-edge iterators that give the range for -all the parallel edges from <tt>u</tt> to <tt>v</tt>. This -function only works when the <tt>OutEdgeList</tt> for the -<tt>adjacency_list</tt> is a container that sorts the -out edges according to target vertex, and allows for -parallel edges. The <tt>multisetS</tt> selector chooses -such a container.+<pre>std::pair<out_edge_iterator, out_edge_iterator><br>edge_range(vertex_descriptor u, vertex_descriptor v,<br> const adjacency_list& g)<br></pre>返回一对出边迭代器,给出表示 从 <tt>u</tt> 到 <tt>v</tt> 的所有平行边的区间。该函数仅当 +<tt>adjacency_list</tt> 的 <tt>OutEdgeList</tt> 是一个根据目标顶点对出边进 行排序的容器,且允许平行边时可用。<tt>multisetS</tt> 选择子可指定这样的容 器。
<hr> -<h4>Structure Modification</h4> +<h4>Structure Modification 结构改变</h4> <hr> -<pre> -std::pair<edge_descriptor, bool> -add_edge(vertex_descriptor u, vertex_descriptor v, - adjacency_list& g) -</pre> -Adds edge <i>(u,v)</i> to the graph and returns the edge descriptor -for the new edge. For graphs that do not allow parallel edges, if the -edge is already in the graph then a duplicate will not be added and -the <TT>bool</TT> flag will be <TT>false</TT>. When the flag is -<TT>false</TT>, the -returned edge descriptor points to the already existing edge.+<pre>std::pair<edge_descriptor, bool><br>add_edge(vertex_descriptor u, vertex_descriptor v,<br> adjacency_list& g)<br></pre>将边 <i>(u,v)</i> 增加至图中,并返回新边的边描述符。对于不允许平行边的图,如果要 加入的边已在图中,则不会加入且 <tt>bool</tt> 标志为 <tt>false</tt>。标志为
+<tt>false</tt> 时,返回的边描述符指向已存在的边。 -<p> -The placement of the new edge in the out-edge list is in general -unspecified, though ordering of the out-edge list can be accomplished -through the choice of <tt>OutEdgeList</tt>. - -If the <tt>VertexList</tt> selector is -<tt>vecS</tt>, and if either vertex descriptor <tt>u</tt> or -<tt>v</tt> (which are integers) has a value greater than the current -number of vertices in the graph, the graph is enlarged so that the -number of vertices is <tt>std::max(u,v) + 1</tt>.+<p>新边在出边列表中的位置通常是不确定的,不过通过选择适当的 <tt>OutEdgeList</tt> 可以令出边列表有序。如果 <tt>VertexList</tt> 选择 子为
+<tt>vecS</tt>,且顶点描述符 <tt>u</tt> 或+<tt>v</tt> (为整数)具有大于当前图中顶点数的值,则该图被增大至顶点数为 <tt>std::max(u,v) + 1</tt>。
-<p> -If the <TT>OutEdgeList</TT> selector is <TT>vecS</TT> then this operation -will invalidate any <tt>out_edge_iterator</tt> for vertex -<i>u</i>. This also applies if the <TT>OutEdgeList</TT> is a user-defined -container that invalidates its iterators when <TT>push(container, -x)</TT> is invoked (see Section <A -HREF="./using_adjacency_list.html#sec:custom-storage">Customizing the -Adjacency List Storage</A>). If the graph is also bidirectional then -any <tt>in_edge_iterator</tt> for <i>v</i> is also invalidated. If -instead the graph is undirected then any <tt>out_edge_iterator</tt> -for <i>v</i> is also invalidated. If instead the graph is directed, -then <tt>add_edge()</tt> also invalidates any <tt>edge_iterator</tt>. +</p><p>如果 <tt>OutEdgeList</tt> 选择子为 <tt>vecS</tt>,则该操作会令顶点+<i>u</i> 的所有 <tt>out_edge_iterator</tt> 失效。如果 <tt>OutEdgeList</tt> 是一个在调用 <tt>push(container, +x)</tt> 时会令其迭代器失效的用户自定义容器(参见 <a href="using_adjacency_list.html#sec:custom-storage">定制邻接列表存储</a> 一 节),则同样会如此。如果该图是双向的,则<tt></tt> <i>v</i> 的 <tt>in_edge_iterator</tt> 也会失效。如果该图是无向的,则<tt></tt> <i>v</i> 的所有 <tt>out_edge_iterator</tt> 也会失效。如果图是有向的,则 <tt>add_edge()</tt> 也会令所有 <tt>edge_iterator</tt> 失效。
-<hr> +</p><hr> -<pre> -std::pair<edge_descriptor, bool> -add_edge(vertex_descriptor u, vertex_descriptor v, - const EdgeProperties& p, - adjacency_list& g) -</pre> -Adds edge <i>(u,v)</i> to the graph and attaches <TT>p</TT> as the -value of the edge's internal property storage. Also see the previous -<TT>add_edge()</TT> member function for more details.+<pre>std::pair<edge_descriptor, bool><br>add_edge(vertex_descriptor u, vertex_descriptor v,<br> const EdgeProperties& p,<br> adjacency_list& g)<br></pre>将 边 <i>(u,v)</i> 增加至图中,并将 <tt>p</tt> 附加为该边的内部属性存储值。具体细节请参见前一个
+<tt>add_edge()</tt> 成员函数。 <hr> -<pre> -void remove_edge(vertex_descriptor u, vertex_descriptor v, - adjacency_list& g) -</pre> -Removes the edge <i>(u,v)</i> from the graph. -<p> -This operation causes any outstanding edge descriptors or iterators -that point to edge <i>(u,v)</i> to become invalid. In addition, if -the <TT>OutEdgeList</TT> selector is <TT>vecS</TT> then this operation -will invalidate any iterators that point into the edge-list for vertex -<i>u</i> and also for vertex <i>v</i> in the undirected and -bidirectional case. Also, for directed graphs this invalidates any -<tt>edge_iterator</tt>.+<pre>void remove_edge(vertex_descriptor u, vertex_descriptor v,<br> adjacency_list& g)<br></pre>从图中删除边 <i>(u,v)</i>。 +<p>该操作会令所有指向边 <i>(u,v)</i> 的外部边描述符或迭代器失效。另外,如 果 <tt>OutEdgeList</tt> 选择子为 <tt>vecS</tt>,则该操作会令所有指向顶点 +<i>u</i> 的边列表的迭代器失效,对于无向图和双向图,则指向顶点 <i>v</i> 的同 样会失效。还有,对于有向图,则所有
+<tt>edge_iterator</tt> 失效。 -<hr> +</p><hr> -<pre> -void remove_edge(edge_descriptor e, adjacency_list& g) -</pre> -Removes the edge <tt>e</tt> from the graph. This differs from the -<tt>remove_edge(u, v, g)</tt> function in the case of a -multigraph. This <tt>remove_edge(e, g)</tt> function removes a single -edge, whereas the <tt>remove_edge(u, v, g)</tt> function removes all -edges <i>(u,v)</i>. -<p> -This operation invalidates any outstanding edge descriptors and -iterators for the same edge pointed to by descriptor <tt>e</tt>. In -addition, this operation will invalidate any iterators that point into -the edge-list for the <tt>target(e, g)</tt>. Also, for directed -graphs this invalidates any <tt>edge_iterator</tt> for the graph.+<pre>void remove_edge(edge_descriptor e, adjacency_list& g)<br></pre>从 图中删除边 <tt>e</tt>。本函数与 +<tt>remove_edge(u, v, g)</tt> 函数的差别在于多重图的情况。 <tt>remove_edge(e, g)</tt> 函数只删除一条边,而 <tt>remove_edge(u, v, g)</tt> 函数则删除所有边 <i>(u,v)</i>。 +<p>该操作会令指向描述符 <tt>e</tt> 所指的同一条边的所有外部边描述符和迭代器 失效。另外,该操作会令指向 <tt>target(e, g)</tt> 的边列表的所有迭代器失效。 还有,对于有向图,则所有图的 <tt>edge_iterator</tt> 失效。
-<hr> +</p><hr> -<pre> -void remove_edge(out_edge_iterator iter, adjacency_list& g) -</pre> -This has the same effect as <tt>remove_edge(*iter, g)</tt>. The -difference is that this function has constant time complexity -in the case of directed graphs, whereas <tt>remove_edge(e, g)</tt> -has time complexity <i>O(E/V)</i>.+<pre>void remove_edge(out_edge_iterator iter, adjacency_list& g)<br></pre>与 <tt>remove_edge(*iter, g)</tt> 作用相同。差别在于该函数对于有 向图具有常量时间复杂度,而 <tt>remove_edge(e, g)</tt>
+的时间复杂度为 <i>O(E/V)</i>. <hr> -<pre>-template <class <a href="http://www.sgi.com/tech/stl/Predicate.html";>Predicate</a>>
-void remove_out_edge_if(vertex_descriptor u, Predicate predicate, - adjacency_list& g) -</pre> -Removes all out-edges of vertex <i>u</i> from the graph that satisfy -the <tt>predicate</tt>. That is, if the predicate returns true when -applied to an edge descriptor, then the edge is removed. -<p> -The affect on descriptor and iterator stability is the same as that of -invoking <tt>remove_edge()</tt> on each of the removed edges. - -<hr>+<pre>template <class <a href="http://www.sgi.com/tech/stl/Predicate.html";>Predicate</a>><br>void remove_out_edge_if(vertex_descriptor u, Predicate predicate,<br> adjacency_list& g)<br></pre>从图中 删除顶点 <i>u</i> 的所有满足断言的出边。即,如果断言对于某个边描述符返回 true,则该边被删除。 +<p>对描述符和迭代器稳定性的影响与对每条被删边调用 <tt>remove_edge()</tt> 一 样。
-<pre> -template <class <a -href="http://www.sgi.com/tech/stl/Predicate.html";>Predicate</a>> -void remove_in_edge_if(vertex_descriptor v, Predicate predicate, - adjacency_list& g) -</pre> -Removes all in-edges of vertex <i>v</i> from the graph that satisfy -the <tt>predicate</tt>. That is, if the predicate returns true when -applied to an edge descriptor, then the edge is removed. -<p> -The affect on descriptor and iterator stability is the -same as that of invoking <tt>remove_edge()</tt> on each of the -removed edges. -<p> -This operation is available for undirected and bidirectional -<tt>adjacency_list</tt> graphs, but not for directed. +</p><hr> -<hr>+<pre>template <class <a href="http://www.sgi.com/tech/stl/Predicate.html";>Predicate</a>><br>void remove_in_edge_if(vertex_descriptor v, Predicate predicate,<br> adjacency_list& g)<br></pre>从图中 删除顶点 <i>v</i> 的所有满足断言的入边。即,如果断言对于某个边描述符返回 true,则该边被删除。 +<p>对描述符和迭代器稳定性的影响与对每条被删边调用 <tt>remove_edge()</tt> 一 样。
+</p><p>该操作对无向和双向 +<tt>adjacency_list</tt> 图有效,而对有向图无效。 -<pre>-template <class <a href="http://www.sgi.com/tech/stl/Predicate.html";>Predicate</a>>
-void remove_edge_if(Predicate predicate, adjacency_list& g) -</pre> -Removes all edges from the graph that satisfy -the <tt>predicate</tt>. That is, if the predicate returns true when -applied to an edge descriptor, then the edge is removed. -<p> -The affect on descriptor and iterator stability is the same as that of -invoking <tt>remove_edge()</tt> on each of the removed edges. +</p><hr> -<hr>+<pre>template <class <a href="http://www.sgi.com/tech/stl/Predicate.html";>Predicate</a>><br>void remove_edge_if(Predicate predicate, adjacency_list& g)<br></pre>从图中删 除所有满足断言的边。即,如果断言对于某个边描述符返回 true,则该边被删除。 +<p>对描述符和迭代器稳定性的影响与对每条被删边调用 <tt>remove_edge()</tt> 一 样。<br></p><hr>
<a name="sec:add-vertex"> -<pre> -vertex_descriptor -add_vertex(adjacency_list& g) -</pre> -Adds a vertex to the graph and returns the vertex descriptor for the -new vertex. +<pre>vertex_descriptor<br>add_vertex(adjacency_list& g)<br></pre> +向图中增加一个顶点,并返回新顶点的顶点描述符。 </a> <hr> -<pre> -vertex_descriptor -add_vertex(const VertexProperties& p, - adjacency_list& g) -</pre> -Adds a vertex to the graph with the specified properties. Returns the -vertex descriptor for the new vertex. -</a>+<pre>vertex_descriptor<br>add_vertex(const VertexProperties& p,<br> adjacency_list& g)<br></pre>向图中增加一个顶点及指定的属性。返回新顶点的 顶点描述符。
+ <hr> -<pre> -void clear_vertex(vertex_descriptor u, adjacency_list& g) -</pre> -Removes all edges to and from vertex <i>u</i>. The vertex still appears -in the vertex set of the graph. -<p> -The affect on descriptor and iterator stability is the -same as that of invoking <tt>remove_edge()</tt> for all of -the edges that have <tt>u</tt> as the source or target.+<pre>void clear_vertex(vertex_descriptor u, adjacency_list& g)<br></pre>删除顶点 <i>u</i> 的所有出边和入边。该顶点则仍然保留在图的顶点集 中。 +<p>对描述符和迭代器稳定性的影响与对以 <tt>u</tt> 作为源或目标的所有边调用 <tt>remove_edge()</tt> 一样。
-<hr> +</p><hr> -<pre> -void clear_out_edges(vertex_descriptor u, adjacency_list& g) -</pre> -Removes all out-edges from vertex <i>u</i>. The vertex still appears -in the vertex set of the graph. -<p> -The affect on descriptor and iterator stability is the -same as that of invoking <tt>remove_edge()</tt> for all of -the edges that have <tt>u</tt> as the source. -<p> -This operation is not applicable to undirected graphs -(use <tt>clear_vertex()</tt> instead).+<pre>void clear_out_edges(vertex_descriptor u, adjacency_list& g)<br></pre>删除顶点 <i>u</i> 的所有出边。该顶点则仍然保留在图的顶点集中。 +<p>对描述符和迭代器稳定性的影响与对以 <tt>u</tt> 作为源的所有边调用 <tt>remove_edge()</tt> 一样。
+</p><p>该操作不能应用于无向图(请使用 <tt>clear_vertex()</tt> 代替)。 -<hr> +</p><hr> -<pre> -void clear_in_edges(vertex_descriptor u, adjacency_list& g) -</pre> -Removes all in-edges from vertex <i>u</i>. The vertex still appears -in the vertex set of the graph. -<p> -The affect on descriptor and iterator stability is the -same as that of invoking <tt>remove_edge()</tt> for all of -the edges that have <tt>u</tt> as the target. -<p> -This operation is only applicable to bidirectional graphs.+<pre>void clear_in_edges(vertex_descriptor u, adjacency_list& g)<br></pre>删除顶点 <i>u</i> 的所有入边。该顶点则仍然保留在图的顶点集中。 +<p>对描述符和迭代器稳定性的影响与对以 <tt>u</tt> 作为目标的所有边调用 <tt>remove_edge()</tt> 一样。
+</p><p>该操作只能应用于双向图。 -<hr> +</p><hr> -<pre> -void remove_vertex(vertex_descriptor u, adjacency_list& g) -</pre> -Remove vertex <i>u</i> from the vertex set of the graph. It is assumed -that there are no edges to or from vertex <i>u</i> when it is removed. -One way to make sure of this is to invoke <TT>clear_vertex()</TT> -beforehand. -<p> -If the <TT>VertexList</TT> template parameter of the -<TT>adjacency_list</TT> was <TT>vecS</TT>, then all vertex -descriptors, edge descriptors, and iterators for the graph are -invalidated by this operation. The builtin -<tt>vertex_index_t</tt> property for each vertex is renumbered so that -after the operation the vertex indices still form a contiguous range -<TT>[0, num_vertices(g))</TT>. If you are using external property -storage based on the builtin vertex index, then the external storage -will need to be adjusted. Another option is to not use the builtin -vertex index, and instead use a property to add your own vertex index -property. If you need to make frequent use of the -<TT>remove_vertex()</TT> function the <TT>listS</TT> selector is a -much better choice for the <TT>VertexList</TT> template parameter.+<pre>void remove_vertex(vertex_descriptor u, adjacency_list& g)<br></pre>从图的顶点集中删除顶点 <i>u</i>。它假定顶点 <i>u</i> 在被删除时 没有出边和入边。确保此条件的一个方法是,在此之前先调用 <tt>clear_vertex()</tt>。
+<p>如果该+<tt>adjacency_list</tt> 的 <tt>VertexList</tt> 模板参数为 <tt>vecS</tt>,则 该操作会令图的所有顶点描述符、边描述符和迭代器均失效。各顶点的内建 +<tt>vertex_index_t</tt> 属性被重编码,使得在操作后顶点索引仍然形成一个连续 的区间 +<tt>[0, num_vertices(g))</tt>。如果你使用了基于内建顶点索引的外部属性存 储,则该外部存储需要调整。另一个选择是,不要使用内建顶点索引,而是使用一个属 性来加入你自己的顶点索引属性。如果你需要频繁使用 +<tt>remove_vertex()</tt> 函数,则 <tt>listS</tt> 选择子是 <tt>VertexList</tt> 模板参数的最佳选择。
-<hr> +</p><hr> -<h4><a name="property-map-accessors">Property Map Accessors</a></h4>+<h4><a name="property-map-accessors">Property Map Accessors 属性映射访问 </a></h4>
<hr> -<pre> -template <class <a href="./PropertyTag.html">PropertyTag</a>> -property_map<adjacency_list, PropertyTag>::type -get(PropertyTag, adjacency_list& g) - -template <class <a href="./PropertyTag.html">PropertyTag</a>> -property_map<adjacency_list, Tag>::const_type -get(PropertyTag, const adjacency_list& g) -</pre> -Returns the property map object for the vertex property specified by -<TT>PropertyTag</TT>. The <TT>PropertyTag</TT> must match one of the -properties specified in the graph's <TT>VertexProperty</TT> template -argument.+<pre>template <class <a href="./PropertyTag.html">PropertyTag</a>><br>property_map<adjacency_list, PropertyTag>::type<br>get(PropertyTag, adjacency_list& g)<br><br>template <class <a href="./PropertyTag.html">PropertyTag</a>><br>property_map<adjacency_list, Tag>::const_type<br>get(PropertyTag, const adjacency_list& g)<br></pre>返回由 +<tt>PropertyTag</tt> 指定的顶点属性的属性映射对象。<tt>PropertyTag</tt> 必 须与在该图的 <tt>VertexProperty</tt> 模板参数中所指定的某一个属性相匹配。
<hr> -<pre>-template <class <a href="./PropertyTag.html">PropertyTag</a>, class X> -typename property_traits<property_map<adjacency_list, PropertyTag>::const_type>::value_type
-get(PropertyTag, const adjacency_list& g, X x) -</pre> -This returns the property value for <tt>x</tt>, where <tt>x</tt> is either -a vertex or edge descriptor.+<pre>template <class <a href="./PropertyTag.html">PropertyTag</a>, class X><br>typename property_traits<property_map<adjacency_list, PropertyTag>::const_type&gt::value_type<br>get(PropertyTag, const adjacency_list& g, X x)<br></pre>返回 <tt>x</tt> 的属性值,其中 <tt>x</tt> 是一个顶点描述符或边描述符。
<hr> -<pre>-template <class <a href="./PropertyTag.html">PropertyTag</a>, class X, class Value>
-void -put(PropertyTag, const adjacency_list& g, X x, const Value& value) -</pre> -This sets the property value for <tt>x</tt> to -<tt>value</tt>. <tt>x</tt> is either a vertex or edge descriptor. -<tt>Value</tt> must be convertible to-<tt>typename property_traits<property_map<adjacency_list, PropertyTag>::type>::value_type</tt> +<pre>template <class <a href="./PropertyTag.html">PropertyTag</a>, class X, class Value><br>void<br>put(PropertyTag, const adjacency_list& g, X x, const Value& value)<br></pre>将 <tt>x</tt> 的属性值设为 +<tt>value</tt>。<tt>x</tt> 是一个顶点描述符或边描述符。<tt>Value</tt> 必须 可以转换为 +<tt>typename property_traits<property_map<adjacency_list, PropertyTag>::type&gt::value_type</tt>
<hr> -<pre>-template <class GraphProperties, class <a href="./PropertyTag.html#GraphPropertyTag">GraphPropertyTag</a>>
-typename graph_property<adjacency_list, GraphPropertyTag>::type& -get_property(adjacency_list& g, GraphPropertyTag); -</pre> -Return the property specified by <tt>GraphPropertyTag</tt> that is -attached to the graph object <tt>g</tt>. The <tt>graph_property</tt> -traits class is defined in <a -href="../../../boost/graph/adjacency_list.hpp"><tt>boost/graph/adjacency_list.hpp</tt></a>.+<pre>template <class GraphProperties, class <a href="./PropertyTag.html#GraphPropertyTag">GraphPropertyTag</a>><br>typename graph_property<adjacency_list, GraphPropertyTag>::type&<br>get_property(adjacency_list& g, GraphPropertyTag);<br></pre>返回由 <tt>GraphPropertyTag</tt> 所指定的关联至 图对象 <tt>g</tt> 的属性。该 <tt>graph_property</tt> +traits 类定义于 <a href="../../../boost/graph/adjacency_list.hpp"><tt>boost/graph/adjacency_list.hpp</tt></a>.
<hr> -<pre>-template <class GraphProperties, class <a href="./PropertyTag.html#GraphPropertyTag">GraphPropertyTag</a>> -const typename graph_property<adjacency_list, GraphPropertyTag>::type&
-get_property(const adjacency_list& g, GraphPropertyTag); -</pre> -Return the property specified by <tt>GraphPropertyTag</tt> that is -attached to the graph object <tt>g</tt>. The <tt>graph_property</tt> -traits class is defined in <a -href="../../../boost/graph/adjacency_list.hpp"><tt>boost/graph/adjacency_list.hpp</tt></a>.+<pre>template <class GraphProperties, class <a href="./PropertyTag.html#GraphPropertyTag">GraphPropertyTag</a>><br>const typename graph_property<adjacency_list, GraphPropertyTag>::type&<br>get_property(const adjacency_list& g, GraphPropertyTag);<br></pre>返回由 <tt>GraphPropertyTag</tt> 所指定的关联 至图对象 <tt>g</tt> 的属性。该 <tt>graph_property</tt> +traits 类定义于 <a href="../../../boost/graph/adjacency_list.hpp"><tt>boost/graph/adjacency_list.hpp</tt></a>.
<!-- add the shortcut property functions --> @@ -1083,32 +610,18 @@ -<h4><a name="serialization">Serialization</a></h4> +<h4><a name="serialization">Serialization 序列化</a></h4> <hr> -<pre>-template<class <a href="../../serialization/doc/archives.html#saving_interface">SavingArchive</a>> -SavingArchive& operator<<(SavingArchive& ar, const adjacency_list& graph);
-</pre>-Serializes the graph into the archive. Requires the vertex and edge properties of the
-graph to be <a href="../../serialization/doc/index.html">Serializable</a>. -<br>-Include <a href="../../../boost/graph/adj_list_serialize.hpp"><tt>boost/graph/adj_list_serialize.hpp</tt></a>. +<pre>template<class <a href="../../serialization/doc/archives.html#saving_interface">SavingArchive</a>><br>SavingArchive& operator<<(SavingArchive& ar, const adjacency_list& graph);<br></pre>将图序列化至存档中。要求图的顶点描述符和边描述符为 <a href="../../serialization/doc/index.html">可序列化Serializable</a>。<br>包 含 <a href="../../../boost/graph/adj_list_serialize.hpp"><tt>boost/graph/adj_list_serialize.hpp</tt></a>.
<hr> -<pre>-template<class <a href="../../serialization/doc/archives.html#loading_interface">LoadingArchive</a>> -LoadingArchive& operator>>(LoadingArchive& ar, const adjacency_list& graph);
-</pre>-Reads the graph from the archive. Requires the vertex and edge properties of the
-graph to be <a href="../../serialization/doc/index.html">Serializable</a>. -<br>-Include <a href="../../../boost/graph/adj_list_serialize.hpp"><tt>boost/graph/adj_list_serialize.hpp</tt></a>. +<pre>template<class <a href="../../serialization/doc/archives.html#loading_interface">LoadingArchive</a>><br>LoadingArchive& operator>>(LoadingArchive& ar, const adjacency_list& graph);<br></pre>从存档中读出图。要求图的顶点描述符和边描述符为 <a href="../../serialization/doc/index.html">可序列化Serializable</a>。<br>包含 <a href="../../../boost/graph/adj_list_serialize.hpp"><tt>boost/graph/adj_list_serialize.hpp</tt></a>.
<hr> -<h3>See Also</h3> +<h3>See Also 参见</h3> <a href="./adjacency_list_traits.html"><tt>adjacency_list_traits</tt></a>, <a href="./property_map.html"><tt>property_map</tt></a>, @@ -1117,21 +630,17 @@ <br> -<HR> -<TABLE> -<TR valign=top> -<TD nowrap>Copyright © 2000-2001</TD><TD> -<A HREF="http://www.boost.org/people/jeremy_siek.htm";>Jeremy Siek</A>, -Indiana University (<A -HREF="mailto:jsiek@xxxxxxxxxx";>jsiek@xxxxxxxxxx</A>)<br>-<A HREF="http://www.boost.org/people/liequan_lee.htm";>Lie-Quan Lee</A>, Indiana University (<A HREF="mailto:llee@xxxxxxxxxxxxxx";>llee@xxxxxxxxxxxxxx</A>)<br>
-<A HREF="http://www.osl.iu.edu/~lums";>Andrew Lumsdaine</A>, -Indiana University (<A -HREF="mailto:lums@xxxxxxxxxx";>lums@xxxxxxxxxx</A>) -</TD></TR></TABLE> +<hr> +<table> +<tbody><tr valign="top"> +<td nowrap="nowrap">Copyright (c) 2000-2001</td><td> +<a href="http://www.boost.org/people/jeremy_siek.htm";>Jeremy Siek</a>,+Indiana University (<a href="mailto:jsiek@xxxxxxxxxx";>jsiek@xxxxxxxxxx</a>)<br> +<a href="http://www.boost.org/people/liequan_lee.htm";>Lie-Quan Lee</a>, Indiana University (<a href="mailto:llee@xxxxxxxxxxxxxx";>llee@xxxxxxxxxxxxxx</a>)<br>
+<a href="http://www.osl.iu.edu/%7Elums";>Andrew Lumsdaine</a>, +Indiana University (<a href="mailto:lums@xxxxxxxxxx";>lums@xxxxxxxxxx</a>) +</td></tr></tbody></table> -</BODY> -</HTML><!-- LocalWords: gif ALT OutEdgeList EdgeList VertexList html VertexProperties EdgeProperties
--><!-- LocalWords: GraphPropertyTag cpp enum ai cout endl VertexAndEdgeListGraph
@@ -1144,3 +653,4 @@ --> <!-- LocalWords: multigraph typename htm Univ Quan Lumsdaine --> +</body></html> \ No newline at end of file Modified: trunk/libs/graph/doc/adjacency_matrix.html ============================================================================== --- trunk/libs/graph/doc/adjacency_matrix.html (original) +++ trunk/libs/graph/doc/adjacency_matrix.html Wed Jul 15 23:13:51 2009 @@ -1,584 +1,312 @@ -<HTML> -<!-- +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">+<html><head><meta content="text/html; charset=UTF-8" http-equiv="content-type"><!--
-- Copyright (c) Jeremy Siek 2000 -- -- Distributed under the Boost Software License, Version 1.0. -- (See accompanying file LICENSE_1_0.txt or copy at -- http://www.boost.org/LICENSE_1_0.txt) --> -<Head> -<Title>Boost Graph Library: Adjacency Matrix</Title> -<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b" - ALINK="#ff0000"> -<IMG SRC="../../../boost.png" - ALT="C++ Boost" width="277" height="86"> - -<BR Clear> - -<H1><A NAME="sec:adjacency-matrix-class"></A> -<pre> -adjacency_matrix<Directed, VertexProperty, - EdgeProperty, GraphProperty, - Allocator> -</pre> -</H1> - -The <tt>adjacency_matrix</tt> class implements the BGL graph interface -using the traditional adjacency matrix storage format. For a graph -with <i>V</i> vertices, a <i>V x V</i> matrix is used, where each -element <i>a<sub>ij</sub></i> is a boolean flag that says whether -there is an edge from vertex <i>i</i> to vertex <i>j</i>. <a -href="#fig:adj-matrix-graph">Figure 1</a> shows the adjacency matrix -representation of a graph. - -<P></P> -<DIV ALIGN="center"><A NAME="fig:adj-matrix-graph"></A><A NAME="1509"></A> -<TABLE>-<CAPTION ALIGN="BOTTOM"><STRONG>Figure 1:</STRONG> Adjacency Matrix Representation of a Directed Graph.</CAPTION> -<TR><TD><IMG SRC="./figs/adj-matrix-graph3.gif" width="386" height="284"></TD>
-<TD><IMG SRC="./figs/adj-matrix.gif" width="135" height="136"></TD></TR> -</TABLE> -</DIV><P></P> - -The advantage of this matrix format over the adjacency list is that -edge insertion and removal is constant time. There are several -disadvantages. The first is that the amount of memory used is -<i>O(V<sup>2</sup>)</i> instead of <i>O(V + E)</i> (where <i>E</i> is -the number of edges). The second is that operations that traverse all -the out-edges of each vertex (such as breadth-first search) run in -<i>O(V<sup>2</sup>)</i> time instead of <i>O(V + E)</i> time for the -adjacency list. In short, it is better to use the -<tt>adjacency_matrix</tt> for dense graphs (where <i>E</i> is close to -<i>V<sup>2</sup></i>) and it is better to use <a -href="adjacency_list.html"><tt>adjacency_list</tt></a> for sparse -graphs (where <i>E</i> is much smaller than <i>V<sup>2</sup></i>). - -The <tt>adjacency_matrix</tt> class extends the traditional -data-structure by allowing objects to be attached to vertices and -edges using the same property template parameters supported by <a -href="adjacency_list.html"><tt>adjacency_list</tt></a>. These may be-<a href="bundles.html">bundled properties</a> or standard (backward-compatible)
-<a -href="using_adjacency_list.html#sec:adjacency-list-properties">interior -properties</a>. The types of all property values must be -Copy Constructible, Assignable and Default Constructible. - -In the case of an undirected graph, the -<tt>adjacency_matrix</tt>. class does not use a full <i>V x V</i> -matrix but instead uses a lower triangle (the diagonal and below) -since the matrix for an undirected graph is symmetric. This reduces -the storage to <i>(V<sup>2</sup>)/2</i>. <a -href="#fig:undir-adj-matrix-graph">Figure 2</a> shows an adjacency -matrix representation of an undirected graph. - -<P></P>-<DIV ALIGN="center"><A NAME="fig:undir-adj-matrix-graph"></A><A NAME="1509"></A>
-<TABLE>-<CAPTION ALIGN="BOTTOM"><STRONG>Figure 1:</STRONG> Adjacency Matrix Representation of an Undirected Graph.</CAPTION> -<TR><TD><IMG SRC="./figs/undir-adj-matrix-graph3.gif" width="260" height="240"></TD> -<TD><IMG SRC="./figs/undir-adj-matrix2.gif" width="135" height="136"></TD></TR>
-</TABLE> -</DIV><P></P> - - -<h3>Example</h3> - -Creating the graph of <a href="#fig:adj-matrix-graph">Figure 1</a>. -<pre> - enum { A, B, C, D, E, F, N }; - const char* name = "ABCDEF"; - - typedef boost::adjacency_matrix<boost::directedS> Graph; - Graph g(N); - add_edge(B, C, g); - add_edge(B, F, g); - add_edge(C, A, g); - add_edge(C, C, g); - add_edge(D, E, g); - add_edge(E, D, g); - add_edge(F, A, g); - - std::cout << "vertex set: "; - boost::print_vertices(g, name); - std::cout << std::endl; - - std::cout << "edge set: "; - boost::print_edges(g, name); - std::cout << std::endl; - - std::cout << "out-edges: " << std::endl; - boost::print_graph(g, name); - std::cout << std::endl; -</pre> -The output is: -<pre> - vertex set: A B C D E F - - edge set: (B,C) (B,F) (C,A) (C,C) (D,E) (E,D) (F,A) - - out-edges: - A --> - B --> C F - C --> A C - D --> E - E --> D - F --> A -</pre> - -Creating the graph of <a href="#fig:undir-adj-matrix-graph">Figure 2</a>. -<pre> - enum { A, B, C, D, E, F, N }; - const char* name = "ABCDEF"; - - typedef boost::adjacency_matrix<boost::undirectedS> UGraph; - UGraph ug(N); - add_edge(B, C, ug); - add_edge(B, F, ug); - add_edge(C, A, ug); - add_edge(D, E, ug); - add_edge(F, A, ug); - - std::cout << "vertex set: "; - boost::print_vertices(ug, name); - std::cout << std::endl; - - std::cout << "edge set: "; - boost::print_edges(ug, name); - std::cout << std::endl; - - std::cout << "incident edges: " << std::endl; - boost::print_graph(ug, name); - std::cout << std::endl; -</pre> -The output is: -<pre> - vertex set: A B C D E F - - edge set: (C,A) (C,B) (E,D) (F,A) (F,B) - - incident edges: - A <--> C F - B <--> C F - C <--> A B - D <--> E - E <--> D - F <--> A B -</pre> +<title>Boost Graph Library: Adjacency Matrix</title></head>+<body alink="#ff0000" bgcolor="#ffffff" link="#0000ee" text="#000000" vlink="#551a8b">
+<img src="../../../boost.png" alt="C++ Boost" height="86" width="277"> -<h3>Where Defined</h3> +<br clear=""> + +<h1><a name="sec:adjacency-matrix-class"></a>+<pre>adjacency_matrix<Directed, VertexProperty, <br> EdgeProperty, GraphProperty,<br> Allocator><br></pre> +</h1><tt>adjacency_matrix</tt> 类使用传统的邻接矩阵存储格式实现了BGL图的接 口。对于一个具有 <i>V</i> 个顶点的图,使用一个 <i>V x V</i> 的矩阵,其中每个 元素 <i>a<sub>ij</sub></i> 为一个布尔标志,表示是否存在一条从顶点 <i>i</i> 到顶点 <i>j</i> 的边。<a href="#fig:adj-matrix-graph">图 1</a> 示范了一个图 的邻接矩阵表示法。
+ + +<div align="center"><a name="fig:adj-matrix-graph"></a><a name="1509"></a> +<table>+<caption align="bottom"><strong>图 1:</strong> 一个有向图的邻接矩阵表示法。 </caption> +<tbody><tr><td><img src="./figs/adj-matrix-graph3.gif" height="284" width="386"></td>
+<td><img src="./figs/adj-matrix.gif" height="136" width="135"></td></tr> +</tbody></table>+</div>与邻接表相比,矩阵格式的优点在于,边的插入和删除是常量时间的。但是也 有几个缺点。首先是内存的总量为 +<i>O(V<sup>2</sup>)</i> 而不是 <i>O(V + E)</i> (其中 <i>E</i> 为边数量)。其 次是遍历各个顶点的所有出边(如广度优先搜索)需要 +<i>O(V<sup>2</sup>)</i> 时间,而邻接表只需要 <i>O(V + E)</i> 时间。简单地 说,对于密集图(<i>E</i> 接近于
+<i>V<sup>2</sup></i>)而言,使用+<tt>adjacency_matrix</tt> 较好,而对于稀疏图(<i>E</i> 远小于 <i>V<sup>2</sup></i>) 来说则使用 <a href="adjacency_list.html"><tt>adjacency_list</tt></a> 更好。 <tt>adjacency_matrix</tt> 类扩展了传统的数据结构,允许用 <a href="adjacency_list.html"><tt>adjacency_list</tt></a> 所支持的同样的属性模 板参数来将一些对象关联至顶点和边。可以是
+<a href="bundles.html">绑定属性bundled properties</a> 或标准的(后向兼容)+<a href="using_adjacency_list.html#sec:adjacency-list-properties">内部属性 interior +properties</a>。所有属性值的类型必须是可复制构造、可赋值和可缺省构造的。对 于无向图的情况,<tt>adjacency_matrix</tt> 类不使用完整的 <i>V x V</i> +矩阵,而是使用一个下三角(对角线以下),因为无向图的矩阵是对称的。这样存储可 减少至 <i>(V<sup>2</sup>)/2</i>。<a href="#fig:undir-adj-matrix-graph">图 2</a> 示范了一个无向图的邻接矩阵表示法。
+ ++<div align="center"><a name="fig:undir-adj-matrix-graph"></a><a name="1509"></a>
+<table>+<caption align="bottom"><strong>图 2:</strong> 一个无向图的邻接矩阵表示法。 </caption> +<tbody><tr><td><img src="./figs/undir-adj-matrix-graph3.gif" height="240" width="260"></td> +<td><img src="./figs/undir-adj-matrix2.gif" height="136" width="135"></td></tr>
+</tbody></table> +</div> + ++<h3>Example 示例</h3>创建 <a href="#fig:adj-matrix-graph">图 1</a> 所示范的 图。 +<pre> enum { A, B, C, D, E, F, N };<br> const char* name = "ABCDEF";<br> <br> typedef boost::adjacency_matrix<boost::directedS> Graph;<br> Graph g(N);<br> add_edge(B, C, g);<br> add_edge(B, F, g);<br> add_edge(C, A, g);<br> add_edge(C, C, g);<br> add_edge(D, E, g);<br> add_edge(E, D, g);<br> add_edge(F, A, g);<br><br> std::cout << "vertex set: ";<br> boost::print_vertices(g, name);<br> std::cout << std::endl;<br><br> std::cout << "edge set: ";<br> boost::print_edges(g, name);<br> std::cout << std::endl;<br><br> std::cout << "out-edges: " << std::endl;<br> boost::print_graph(g, name);<br> std::cout << std::endl;<br></pre>输 出为: +<pre> vertex set: A B C D E F <br><br> edge set: (B,C) (B,F) (C,A) (C,C) (D,E) (E,D) (F,A) <br><br> out-edges: <br> A --> <br> B --> C F <br> C --> A C <br> D --> E <br> E --> D <br> F --> A <br></pre>创建 <a href="#fig:undir-adj-matrix-graph">图 2</a> 所示范的图。 +<pre> enum { A, B, C, D, E, F, N };<br> const char* name = "ABCDEF";<br><br> typedef boost::adjacency_matrix<boost::undirectedS> UGraph;<br> UGraph ug(N);<br> add_edge(B, C, ug);<br> add_edge(B, F, ug);<br> add_edge(C, A, ug);<br> add_edge(D, E, ug);<br> add_edge(F, A, ug);<br><br> std::cout << "vertex set: ";<br> boost::print_vertices(ug, name);<br> std::cout << std::endl;<br><br> std::cout << "edge set: ";<br> boost::print_edges(ug, name);<br> std::cout << std::endl;<br><br> std::cout << "incident edges: " << std::endl;<br> boost::print_graph(ug, name);<br> std::cout << std::endl;<br></pre>输出为: +<pre> vertex set: A B C D E F <br><br> edge set: (C,A) (C,B) (E,D) (F,A) (F,B) <br><br> incident edges: <br> A <--> C F <br> B <--> C F <br> C <--> A B <br> D <--> E <br> E <--> D <br> F <--> A B <br></pre>
+ + +<h3>Where Defined 定义于</h3><a href="../../../boost/graph/adjacency_matrix.hpp"><tt>boost/graph/adjacency_matrix.hpp</tt></a>
-<h3>Template Parameters</h3> +<h3>Template Parameters 模板参数</h3> <p> -<table border> +<table border="1"> -<TR> +<tbody><tr> <th>Parameter</th><th>Description</th><th>Default</th> </tr> <tr> <td><tt>Directed</tt></td>- <td>A selector to choose whether the graph is directed or undirected. The options are <tt>directedS</tt> and <tt>undirectedS</tt>.</td> + <td>指定有向图或无向图的选择子。选项为 <tt>directedS</tt> 和 <tt>undirectedS</tt>.</td>
<td><tt>directedS</tt></td> </tr> <tr> <td><tt>VertexProperty</tt></td> - <td>for specifying internal property storage.</td> + <td>用于指定内部属性存储。</td> <td><tt>no_property</tt></td> </tr> <tr> <td><tt>EdgeProperty</tt></td> - <td>for specifying internal property storage.</td> + <td>用于指定内部属性存储。</td> <td><tt>no_property</tt></td> </tr> <tr> <td><tt>GraphProperty</tt></td> - <td>for specifying property storage for the graph object.</td> + <td>用于指定图对象的属性存储。</td> <td><tt>no_property</tt></td> </tr> -</table> +</tbody></table> -<h3>Model Of</h3> +</p><h3>Model Of 以...为模型</h3> -<a href="./VertexAndEdgeListGraph.html">VertexAndEdgeListGraph</a>, -<a href="./IncidenceGraph.html">Incidence Graph</a>, -<a href="./BidirectionalGraph.html">Bidirectional Graph</a>, -<a -href="./AdjacencyMatrix.html">AdjacencyMatrix</a>, <a -href="./MutablePropertyGraph.html">MutablePropertyGraph</a>, -<a href="../../utility/CopyConstructible.html">CopyConstructible</a>, -and <a href="../../utility/Assignable.html">Assignable</a>.+<a href="./VertexAndEdgeListGraph.html">点边列表图 VertexAndEdgeListGraph</a>,
+<a href="./IncidenceGraph.html">关联图Incidence Graph</a>, +<a href="./BidirectionalGraph.html">双向图Bidirectional Graph</a>,+<a href="./AdjacencyMatrix.html">邻接矩阵AdjacencyMatrix</a>, <a href="./MutablePropertyGraph.html">可变属性图MutablePropertyGraph</a>, +<a href="../../utility/CopyConstructible.html">可复制构造 CopyConstructible</a>, 和 <a href="../../utility/Assignable.html">可赋值 Assignable</a>。
-<h3>Associates Types</h3> +<h3>Associates Types 关联类型</h3> <hr> <tt>graph_traits<adjacency_matrix>::vertex_descriptor</tt> -<br><br> -The type for the vertex descriptors associated with the -<tt>adjacency_matrix</tt>.<br> -(Required by <a href="./Graph.html">Graph</a>.) +<br><br>与 +<tt>adjacency_matrix</tt> 关联的顶点描述符类型。<br> +(<a href="./Graph.html">图Graph</a> 的要求) <hr> <tt>graph_traits<adjacency_matrix>::edge_descriptor</tt> -<br><br> -The type for the edge descriptors associated with the - <tt>adjacency_matrix</tt>.<br> - (Required by <a href="Graph.html">Graph</a>.) +<br><br>与 +<tt>adjacency_matrix</tt> 关联的边描述符类型。<br> + (<a href="Graph.html">图Graph</a> 的要求) <hr> <tt>graph_traits<adjacency_matrix>::vertex_iterator</tt> <br><br> - The type for the iterators returned by <tt>vertices()</tt>.- The vertex iterator models <a href="http://www.sgi.com/tech/stl/RandomAccessIterator.html";>RandomAccessIterator</a>. <br>
- (Required by <a href="VertexListGraph.html">VertexListGraph</a>.)+ 由 <tt>vertices()</tt> 返回的迭代器类型。该顶点迭代器为 <a href="http://www.sgi.com/tech/stl/RandomAccessIterator.html";>随机访问迭代器 </a>。 <br>
+ (<a href="VertexListGraph.html">点边图VertexListGraph</a> 的要求) <hr> <tt>graph_traits<adjacency_matrix>::edge_iterator</tt> <br><br> - The type for the iterators returned by <tt>edges()</tt>. This- iterator models <a href="../../utility/MultiPassInputIterator.html">MultiPassInputIterator</a>.<br>
- (Required by <a href="EdgeListGraph.html">EdgeListGraph</a>.)+ 由 <tt>edges()</tt> 返回的迭代器类型。该迭代器为 <a href="../../utility/MultiPassInputIterator.html">多遍输入迭代器</a>。<br>
+ (<a href="EdgeListGraph.html">边列表图EdgeListGraph</a> 的要求) <hr> <tt>graph_traits<adjacency_matrix>::out_edge_iterator</tt> -<br><br> - The type for the iterators returned by <tt>out_edges()</tt>. This- iterator models <a href="../../utility/MultiPassInputIterator.html">MultiPassInputIterator</a>. <br>
- (Required by <a href="IncidenceGraph.html">IncidenceGraph</a>.)+<br><br>由 <tt>out_edges()</tt> 返回的迭代器类型。该迭代器为 <a href="../../utility/MultiPassInputIterator.html">多遍输入迭代器</a>。 <br>
+ (<a href="IncidenceGraph.html">关联图IncidenceGraph</a> 的要求) <hr> <tt>graph_traits<adjacency_matrix>::in_edge_iterator</tt> -<br><br> - The type for the iterators returned by <tt>in_edges()</tt>. This- iterator models <a href="../../utility/MultiPassInputIterator.html">MultiPassInputIterator</a>. <br>
- (Required by <a href="BidirectionalGraph.html">BidirectionalGraph</a>.)+<br><br>由 <tt>in_edges()</tt> 返回的迭代器类型。该迭代器为 <a href="../../utility/MultiPassInputIterator.html">多遍输入迭代器</a>。 <br>
+ (<a href="BidirectionalGraph.html">双向图BidirectionalGraph</a> 的要求) <hr> <tt>graph_traits<adjacency_matrix>::adjacency_iterator</tt> -<br><br> - The type for the iterators returned by <tt>adjacent_vertices()</tt>. This - iterator models the same concept as the out-edge iterator.<br> - (Required by <a href="AdjacencyGraph.html">AdjacencyGraph</a>.)+<br><br>由 <tt>adjacent_vertices()</tt> 返回的迭代器类型。该迭代器为与出边 迭代器相同的概念。<br>
+ (<a href="AdjacencyGraph.html">关联图AdjacencyGraph</a> 的要求) <hr> <tt>graph_traits<adjacency_matrix>::directed_category</tt> -<br><br> - Provides information about whether the graph is directed - (<tt>directed_tag</tt>) or undirected (<tt>undirected_tag</tt>).<br> - (Required by <a href="Graph.html">Graph</a>.)+<br><br>提供关于图是有向的(<tt>directed_tag</tt>)或是无向的 (<tt>undirected_tag</tt>)的信息。<br>
+ (<a href="Graph.html">图Graph</a> 的要求) <hr> <tt>graph_traits<adjacency_matrix>::edge_parallel_category</tt> -<br><br> - An adjacency matrix does not allow the insertion of - parallel edges, so this type is always - <tt>disallow_parallel_edge_tag</tt>. <br> - (Required by <a href="Graph.html">Graph</a>.) +<br><br>邻接矩阵不允许插入平行边,所以该类型总为 + <tt>disallow_parallel_edge_tag</tt>。<br> + (<a href="Graph.html">图Graph</a> 的要求) <hr> <tt>graph_traits<adjacency_matrix>::vertices_size_type</tt> -<br><br> - The type used for dealing with the number of vertices in - the graph.<br> - (Required by <a href="VertexListGraph.html">VertexListGraph</a>.) +<br><br>用于处理图中顶点数量的类型。<br> + (<a href="VertexListGraph.html">点列表图VertexListGraph</a> 的要求) <hr> <tt>graph_traits<adjacency_matrix>::edges_size_type</tt> -<br><br> - The type used for dealing with the number of edges in the graph.<br> - (Required by <a href="EdgeListGraph.html">EdgeListGraph</a>.) +<br><br>用于处理图中边数量的类型。<br> + (<a href="EdgeListGraph.html">边列表图EdgeListGraph</a> 的要求) <hr> <tt>graph_traits<adjacency_matrix>::degree_size_type</tt> -<br><br> - The type used for dealing with the number of out-edges of a vertex.<br> - (Required by <a href="IncidenceGraph.html">IncidenceGraph</a>.) +<br><br>用于处理单个顶点的出边数量的类型。<br> + (<a href="IncidenceGraph.html">关联图IncidenceGraph</a> 的要求) <hr> <tt>property_map<adjacency_matrix, PropertyTag>::type</tt><br> <tt>property_map<adjacency_matrix, PropertyTag>::const_type</tt> -<br><br> - The map type for vertex or edge properties in the graph. The - specific property is specified by the <tt>PropertyTag</tt> template - argument, and must match one of the properties specified in the - <tt>VertexProperty</tt> or <tt>EdgeProperty</tt> for the graph.<br> - (Required by <a href="PropertyGraph.html">PropertyGraph</a>.) - -<hr> - -<h3>Member Functions</h3> - -<hr> -<pre> -adjacency_matrix(vertices_size_type n, - const GraphProperty& p = GraphProperty()) -</pre> -Creates a graph object with <tt>n</tt> vertices and zero edges.<br> -(Required by <a href="MutableGraph.html">MutableGraph</a>.) - -<hr> -<pre> -template <typename EdgeIterator> -adjacency_matrix(EdgeIterator first, - EdgeIterator last, - vertices_size_type n, - const GraphProperty& p = GraphProperty()) -</pre> - Creates a graph object with <tt>n</tt> vertices with the edges - specified in the edge list given by the range <tt>[first, last)</tt>. - The value type of the <tt>EdgeIterator</tt> must be a - <tt>std::pair</tt>, where the type in the pair is an integer type. The - integers will correspond to vertices, and they must all fall in the - range of - <tt>[0, n)</tt>. <br>- (Required by <a href="IteratorConstructibleGraph.html">IteratorConstructibleGraph</a>.)
- -<hr> -<pre> -template <typename EdgeIterator, typename EdgePropertyIterator> -adjacency_matrix(EdgeIterator first, EdgeIterator last, - EdgePropertyIterator ep_iter, - vertices_size_type n, - const GraphProperty& p = GraphProperty()) -</pre> - Creates a graph object with <tt>n</tt> vertices, with the edges - specified in the edge list given by the range <tt>[first, last)</tt>. - The value type of the <tt>EdgeIterator</tt> must be a - <tt>std::pair</tt>, where the type in the pair is an integer type. The - integers will correspond to vertices, and they must all fall in the - range of <tt>[0, n)</tt>. The <tt>value_type</tt> of the - <tt>ep_iter</tt> should be <tt>EdgeProperty</tt>. - -<hr> - - -<h3>Non-Member Functions</h3> - -<hr> -<pre> -std::pair<vertex_iterator, vertex_iterator> -vertices(const adjacency_matrix& g) -</pre>-Returns an iterator-range providing access to the vertex set of graph <tt>g</tt>.<br>
-(Required by <a href="VertexListGraph.html">VertexListGraph</a>.) - -<hr> -<pre> -std::pair<edge_iterator, edge_iterator> -edges(const adjacency_matrix& g); -</pre>-Returns an iterator-range providing access to the edge set of graph <tt>g</tt>.<br>
-(Required by <a href="EdgeListGraph.html">EdgeListGraph</a>.) - -<hr> -<pre> -std::pair<adjacency_iterator, adjacency_iterator> -adjacent_vertices(vertex_descriptor v, const adjacency_matrix& g) -</pre> -Returns an iterator-range providing access to the vertices adjacent to -vertex <tt>v</tt> in graph <tt>g</tt>.<br> -(Required by <a href="AdjacencyGraph.html">AdjacencyGraph</a>.) - -<hr> -<pre> -std::pair<out_edge_iterator, out_edge_iterator> -out_edges(vertex_descriptor v, const adjacency_matrix& g) -</pre> -Returns an iterator-range providing access to the out-edges of -vertex <tt>v</tt> in graph <tt>g</tt>. If the graph is undirected, -this iterator-range provides access to all edges incident on -vertex <tt>v</tt>. <br> -(Required by <a href="IncidenceGraph.html">IncidenceGraph</a>.) - -<hr> -<pre> -vertex_descriptor -source(edge_descriptor e, const adjacency_matrix& g) -</pre> -Returns the source vertex of edge <tt>e</tt>.<br> -(Required by <a href="IncidenceGraph.html">IncidenceGraph</a>.) - -<hr> -<pre> -vertex_descriptor -target(edge_descriptor e, const adjacency_matrix& g) -</pre> -Returns the target vertex of edge <tt>e</tt>.<br> -(Required by <a href="IncidenceGraph.html">IncidenceGraph</a>.) - -<hr> -<pre> -degree_size_type -out_degree(vertex_descriptor u, const adjacency_matrix& g) -</pre> -Returns the number of edges leaving vertex <tt>u</tt>.<br> -(Required by <a href="IncidenceGraph.html">IncidenceGraph</a>.) -<hr> - -<hr> -<pre> -std::pair<in_edge_iterator, in_edge_iterator> -in_edges(vertex_descriptor v, const adjacency_matrix& g) -</pre> -Returns an iterator-range providing access to the in-edges of -vertex <tt>v</tt> in graph <tt>g</tt>. If the graph is undirected, -this iterator-range provides access to all edges incident on -vertex <tt>v</tt>. <br> -(Required by <a href="BidirectionalGraph.html">BidirectionalGraph</a>.) - -<hr> -<pre> -degree_size_type -in_degree(vertex_descriptor u, const adjacency_matrix& g) -</pre> -Returns the number of edges entering vertex <tt>u</tt>.<br> -(Required by <a href="BidirectionalGraph.html">BidirectionalGraph</a>.) -<hr> - -<hr> -<pre> -vertices_size_type num_vertices(const adjacency_matrix& g) -</pre> -Returns the number of vertices in the graph <tt>g</tt>.<br> -(Required by <a href="VertexListGraph.html">VertexListGraph</a>.) - -<hr> -<pre> -edges_size_type num_edges(const adjacency_matrix& g) -</pre> -Returns the number of edges in the graph <tt>g</tt>.<br> -(Required by <a href="EdgeListGraph.html">EdgeListGraph</a>.) - -<hr> -<pre>-vertex_descriptor vertex(vertices_size_type n, const adjacency_matrix& g)
-</pre> -Returns the nth vertex in the graph's vertex list. - -<hr> -<pre> -std::pair<edge_descriptor, bool> -edge(vertex_descriptor u, vertex_descriptor v, - const adjacency_matrix& g) -</pre>-Returns the edge connecting vertex <tt>u</tt> to vertex <tt>v</tt> in graph <tt>g</tt>.<br>
-(Required by <a href="AdjacencyMatrix.html">AdjacencyMatrix</a>.) - -<hr> -<pre> -std::pair<edge_descriptor, bool> -add_edge(vertex_descriptor u, vertex_descriptor v, - adjacency_matrix& g) -</pre> - Adds edge <tt>(u,v)</tt> to the graph and returns the edge descriptor for - the new edge. If the edge is already in the graph then a duplicate - will not be added and the <tt>bool</tt> flag will be <tt>false</tt>. - This operation does not invalidate any of the graph's iterators - or descriptors.<br> -(Required by <a href="MutableGraph.html">MutableGraph</a>.) - -<hr> -<pre> -std::pair<edge_descriptor, bool> -add_edge(vertex_descriptor u, vertex_descriptor v, - const EdgeProperty& p, - adjacency_matrix& g) -</pre> -Adds edge <tt>(u,v)</tt> to the graph and attaches <tt>p</tt> as the -value of the edge's internal property storage. Also see the previous -<tt>add_edge()</tt> member function for more details. - -<hr> -<pre> -void remove_edge(vertex_descriptor u, vertex_descriptor v, - adjacency_matrix& g) -</pre> -Removes the edge <tt>(u,v)</tt> from the graph. <br> -(Required by <a href="MutableGraph.html">MutableGraph</a>.) - -<hr> -<pre> -void remove_edge(edge_descriptor e, adjacency_matrix& g) -</pre> -Removes the edge <tt>e</tt> from the graph. This is equivalent -to calling <tt>remove_edge(source(e, g), target(e, g), g)</tt>.<br> -(Required by <a href="MutableGraph.html">MutableGraph</a>.) - -<hr> -<pre> -void clear_vertex(vertex_descriptor u, adjacency_matrix& g) -</pre> -Removes all edges to and from vertex <tt>u</tt>. The vertex still appears -in the vertex set of the graph.<br> -(Required by <a href="MutableGraph.html">MutableGraph</a>.) - -<hr> -<pre> -template <typename Property> -property_map<adjacency_matrix, Property>::type -get(Property, adjacency_matrix& g) - -template <typename Property> -property_map<adjacency_matrix, Property>::const_type -get(Property, const adjacency_matrix& g) -</pre> -Returns the property map object for the vertex property specified by -<tt>Property</tt>. The <tt>Property</tt> must match one of the -properties specified in the graph's <tt>VertexProperty</tt> template -argument.<br> -(Required by <a href="PropertyGraph.html">PropertyGraph</a>.) - -<hr> -<pre> -template <typename Property, typename X> -typename property_traits< - typename property_map<adjacency_matrix, Property>::const_type ->::value_type -get(Property, const adjacency_matrix& g, X x) -</pre> -This returns the property value for <tt>x</tt>, which is either -a vertex or edge descriptor.<br> -(Required by <a href="PropertyGraph.html">PropertyGraph</a>.) - -<hr> -<pre> -template <typename Property, typename X, typename Value> -void -put(Property, const adjacency_matrix& g, X x, const Value& value) -</pre> -This sets the property value for <tt>x</tt> to -<tt>value</tt>. <tt>x</tt> is either a vertex or edge descriptor. -<tt>Value</tt> must be convertible to+<br><br>图中顶点属性或边属性所用的映射类型。特定属性由 <tt>PropertyTag</tt> 模板参数指定,且必须与该图的 <tt>VertexProperty</tt> 或 <tt>EdgeProperty</tt> 中所指定的某个属性相匹配。<br>
+ (<a href="PropertyGraph.html">属性图PropertyGraph</a> 的要求) + +<hr> + +<h3>Member Functions 成员函数</h3> + +<hr>+<pre>adjacency_matrix(vertices_size_type n,<br> const GraphProperty& p = GraphProperty())<br></pre>创建一个具有 <tt>n</tt> 个 顶点和零边的图对象。<br>
+(<a href="MutableGraph.html">可变图MutableGraph</a> 的要求) + +<hr>+<pre>template <typename EdgeIterator><br>adjacency_matrix(EdgeIterator first,<br> EdgeIterator last,<br> vertices_size_type n,<br> const GraphProperty& p = GraphProperty())<br></pre>创建一个具有 <tt>n</tt> 个顶点的图对象,以由区间 <tt>[first, last)</tt> 所给出的边列表中的边为边。<tt>EdgeIterator</tt> 的值 类型必须是一个 + <tt>std::pair</tt>,且 pair 中的类型是一个整数类型。这些整数将对应于各顶 点,且必须位于区间
+ <tt>[0, n)</tt> 中。<br>+ (<a href="IteratorConstructibleGraph.html">可迭代器构造图 IteratorConstructibleGraph</a> 的要求)
+ +<hr>+<pre>template <typename EdgeIterator, typename EdgePropertyIterator><br>adjacency_matrix(EdgeIterator first, EdgeIterator last,<br> EdgePropertyIterator ep_iter,<br> vertices_size_type n,<br> const GraphProperty& p = GraphProperty())<br></pre>创建一个具有 <tt>n</tt> 个顶点的图对象,以由区间 <tt>[first, last)</tt> 所给出的边列表中 的边为边。<tt>EdgeIterator</tt> 的值类型必须是一个 + <tt>std::pair</tt>,且 pair 中的类型是一个整数类型。这些整数将对应于各顶 点,且必须位于区间 + <tt>[0, n)</tt> 中。<tt>ep_iter</tt> 的 <tt>value_type</tt> 应为 <tt>EdgeProperty</tt>。
+ +<hr> + + +<h3>Non-Member Functions 非成员函数</h3> + +<hr>+<pre>std::pair<vertex_iterator, vertex_iterator><br>vertices(const adjacency_matrix& g)<br></pre>返回一个迭代器区间,提供对图
+<tt>g</tt> 的顶点集的访问。 <br> +(<a href="VertexListGraph.html">点列表图VertexListGraph</a> 的要求) + +<hr>+<pre>std::pair<edge_iterator, edge_iterator><br>edges(const adjacency_matrix& g);<br></pre>返回一个迭代器区间,提供对图
+<tt>g</tt> 的边集的访问。 + +<br> +(<a href="EdgeListGraph.html">边列表图EdgeListGraph</a> 的要求) + +<hr>+<pre>std::pair<adjacency_iterator, adjacency_iterator><br>adjacent_vertices(vertex_descriptor v, const adjacency_matrix& g)<br></pre>返回一个迭代器区间,提供对图 <tt>g</tt> 的 顶点 <tt>v</tt> 的邻接顶点的访问。<br>
+(<a href="AdjacencyGraph.html">关联图AdjacencyGraph</a> 的要求) + +<hr>+<pre>std::pair<out_edge_iterator, out_edge_iterator><br>out_edges(vertex_descriptor v, const adjacency_matrix& g)<br></pre>返回一个迭代器区间,提供对图 <tt>g</tt> 的 顶点 <tt>v</tt> 的出边的访问。如果是无向图,则该迭代器区间提供对顶点 <tt>v</tt> 的所有邻接边的访问。<br>
+(<a href="IncidenceGraph.html">关联图IncidenceGraph</a> 的要求) + +<hr>+<pre>vertex_descriptor<br>source(edge_descriptor e, const adjacency_matrix& g)<br></pre>返回边 <tt>e</tt> 的源顶点。
+ +<br> +(<a href="IncidenceGraph.html">关联图IncidenceGraph</a> 的要求) + +<hr>+<pre>vertex_descriptor<br>target(edge_descriptor e, const adjacency_matrix& g)<br></pre>返回边 <tt>e</tt> 的目标顶点。
+ +<br> +(<a href="IncidenceGraph.html">关联图IncidenceGraph</a> 的要求) + +<hr>+<pre>degree_size_type<br>out_degree(vertex_descriptor u, const adjacency_matrix& g)<br></pre>返回顶点 <tt>u</tt> 的出边数量。
+ +<br> +(<a href="IncidenceGraph.html">关联图IncidenceGraph</a> 的要求) +<hr> + +<hr>+<pre>std::pair<in_edge_iterator, in_edge_iterator><br>in_edges(vertex_descriptor v, const adjacency_matrix& g)<br></pre>返回一个迭代器区间,提供对图 <tt>g</tt> 的 顶点 <tt>v</tt> 的入边的访问。如果是无向图,则该迭代器区间提供对顶点 <tt>v</tt> 的所有邻接边的访问。<br>
+(<a href="BidirectionalGraph.html">双向图BidirectionalGraph</a> 的要求) + +<hr>+<pre>degree_size_type<br>in_degree(vertex_descriptor u, const adjacency_matrix& g)<br></pre>返回顶点 <tt>u</tt> 的入边数量。<br>
+(<a href="BidirectionalGraph.html">双向图BidirectionalGraph</a> 的要求) +<hr> + +<hr>+<pre>vertices_size_type num_vertices(const adjacency_matrix& g)<br></pre>返回图 <tt>g</tt> 中的顶点数量。
+ +<br> +(<a href="VertexListGraph.html">点列表图VertexListGraph</a> 的要求) + +<hr> +<pre>edges_size_type num_edges(const adjacency_matrix& g)<br></pre> +返回图 <tt>g</tt> 中的边数量。 + +<br> +(<a href="EdgeListGraph.html">边列表图EdgeListGraph</a> 的要求) + +<hr>+<pre>vertex_descriptor vertex(vertices_size_type n, const adjacency_matrix& g)<br></pre>返回图的顶点列表中的第 n 个顶点。
+ +<hr>+<pre>std::pair<edge_descriptor, bool><br>edge(vertex_descriptor u, vertex_descriptor v,<br> const adjacency_matrix& g)<br></pre>返回图 <tt>g</tt> 中连接顶点 <tt>u</tt> 和 <tt>v</tt> 的一条边。 <br>
+(<a href="AdjacencyMatrix.html">关联图AdjacencyMatrix</a> 的要求) + +<hr>+<pre>std::pair<edge_descriptor, bool><br>add_edge(vertex_descriptor u, vertex_descriptor v,<br> adjacency_matrix& g)<br></pre>将边 <i>(u,v)</i> 增加至图中,并返回新边的边描述符。如果要加入的边已在图中,则不 会加入且 <tt>bool</tt> 标志为 <tt>false</tt>。该操作不会令图中的任何迭代器或 描述符失效。<br>
+(<a href="MutableGraph.html">可变图MutableGraph</a> 的要求) + +<hr>+<pre>std::pair<edge_descriptor, bool><br>add_edge(vertex_descriptor u, vertex_descriptor v,<br> const EdgeProperty& p,<br> adjacency_matrix& g)<br></pre>将边 <i>(u,v)</i> 增加至图中,并将 <tt>p</tt> 附加为该边的内部属性存储值。具体细节请参见前一个
+<tt>add_edge()</tt> 成员函数。 + +<hr>+<pre>void remove_edge(vertex_descriptor u, vertex_descriptor v,<br> adjacency_matrix& g)<br></pre>从图中删除边 <tt>(u,v)</tt>。<br>
+(<a href="MutableGraph.html">可变图MutableGraph</a> 的要求) + +<hr>+<pre>void remove_edge(edge_descriptor e, adjacency_matrix& g)<br></pre>从图中删除边 <tt>e</tt>。本函数等价于调用 <tt>remove_edge(source(e, g), target(e, g), g)</tt>。<br>
+(<a href="MutableGraph.html">可变图MutableGraph</a> 的要求) + +<hr>+<pre>void clear_vertex(vertex_descriptor u, adjacency_matrix& g)<br></pre>删除顶点 <tt>u</tt> 的所有出边和入边。该顶点则仍然保留在图 的顶点集中。<br>
+(<a href="MutableGraph.html">可变图MutableGraph</a> 的要求) + +<hr>+<pre>template <typename Property><br>property_map<adjacency_matrix, Property>::type<br>get(Property, adjacency_matrix& g)<br><br>template <typename Property><br>property_map<adjacency_matrix, Property>::const_type<br>get(Property, const adjacency_matrix& g)<br></pre>返回由 +<tt>PropertyTag</tt> 指定的顶点属性的属性映射对象。<tt>PropertyTag</tt> 必 须与在该图的 <tt>VertexProperty</tt> 模板参数中所指定的某一个属性相匹配。 <br>
+(<a href="PropertyGraph.html">属性图PropertyGraph</a> 的要求) + +<hr>+<pre>template <typename Property, typename X><br>typename property_traits<<br> typename property_map<adjacency_matrix, Property>::const_type<br>>::value_type<br>get(Property, const adjacency_matrix& g, X x)<br></pre>返回 <tt>x</tt> 的属性值,其中 <tt>x</tt> 是一个顶点描述符或边描述符。 <br>
+(<a href="PropertyGraph.html">属性图PropertyGraph</a> 的要求) + +<hr>+<pre>template <typename Property, typename X, typename Value><br>void<br>put(Property, const adjacency_matrix& g, X x, const Value& value)<br></pre>将 <tt>x</tt> 的属性值设为 +<tt>value</tt>。<tt>x</tt> 是一个顶点描述符或边描述符。<tt>Value</tt> 必须 可以转换为 <tt>typename property_traits<property_map<adjacency_matrix, Property>::type>::value_type</tt>.<br>
-(Required by <a href="PropertyGraph.html">PropertyGraph</a>.) +(<a href="PropertyGraph.html">属性图PropertyGraph</a> 的要求) + +<hr>+<pre>template <typename GraphProperty, typename GraphProperty><br>typename property_value<GraphProperty, GraphProperty>::type&<br>get_property(adjacency_matrix& g, GraphProperty)<br></pre>返回由 <tt>GraphProperty</tt> 所指定的关联至图对象 <tt>g</tt> 的属性。该 <tt>property_value</tt>
+traits 类定义于 <tt>boost/pending/property.hpp</tt>。 <hr> -<pre> -template <typename GraphProperty, typename GraphProperty> -typename property_value<GraphProperty, GraphProperty>::type& -get_property(adjacency_matrix& g, GraphProperty) -</pre> -Return the property specified by <tt>GraphProperty</tt> that is attached -to the graph object <tt>g</tt>. The <tt>property_value</tt> traits class -is defined in <tt>boost/pending/property.hpp</tt>. - -<hr> -<pre> -template <typename GraphProperty, typename GraphProperty>-const typename property_value<GraphProperty, GraphProperty>::type&
-get_property(const adjacency_matrix& g, GraphProperty) -</pre> -Return the property specified by <tt>GraphProperty</tt> that is -attached to the graph object <tt>g</tt>. The <tt>property_value</tt> -traits class is defined in <tt>boost/pending/property.hpp</tt>.+<pre>template <typename GraphProperty, typename GraphProperty><br>const typename property_value<GraphProperty, GraphProperty>::type&<br>get_property(const adjacency_matrix& g, GraphProperty)<br></pre>返回由 <tt>GraphProperty</tt> 所指定的关联至图对象 <tt>g</tt> 的属性。该 <tt>property_value</tt>
+traits 类定义于 <tt>boost/pending/property.hpp</tt>。 <hr> +</body></html> \ No newline at end of file Modified: trunk/libs/graph/doc/astar_visitor.html ============================================================================== --- trunk/libs/graph/doc/astar_visitor.html (original) +++ trunk/libs/graph/doc/astar_visitor.html Wed Jul 15 23:13:51 2009 @@ -1,76 +1,58 @@ -<HTML> -<!-- +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">+<html><head><meta content="text/html; charset=UTF-8" http-equiv="content-type"><!--
-- Copyright (c) 2004 Kris Beevers -- -- Distributed under the Boost Software License, Version 1.0. -- (See accompanying file LICENSE_1_0.txt or copy at -- http://www.boost.org/LICENSE_1_0.txt) --> -<Head> -<Title>Boost Graph Library: astar_visitor</Title> -<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b" - ALINK="#ff0000"> -<IMG SRC="../../../boost.png" - ALT="C++ Boost" width="277" height="86"> +<title>Boost Graph Library: astar_visitor</title></head> -<BR Clear>+<body alink="#ff0000" bgcolor="#ffffff" link="#0000ee" text="#000000" vlink="#551a8b">
+<img src="../../../boost.png" alt="C++ Boost" height="86" width="277"> -<H1> -<pre> -astar_visitor<EventVisitorList> -</pre> -</H1> +<br clear=""> -This class is an adapter that converts a list of <a -href="./EventVisitor.html">EventVisitor</a>'s (constructed using -<tt>std::pair</tt>) into a <a -href="./AStarVisitor.html">AStarVisitor</a>. +<h1> +<pre>astar_visitor<EventVisitorList><br></pre>+</h1>该类是一个适配器,将一个 <a href="./EventVisitor.html">事件遍历器</a> 列表(用 +<tt>std::pair</tt> 构造)转换为一个 <a href="./AStarVisitor.html">AStar遍历 器</a>。
-<h3>Example</h3>+<h3>Example 示例</h3>参见 <a href="./EventVisitor.html">事件遍历器</a> 的示 例。
-See the example for <a href="./EventVisitor.html">EventVisitor</a>. +<h3>Model of 以...为模型</h3> -<h3>Model of</h3> +<a href="./AStarVisitor.html">AStar遍历器</a> -<a href="./AStarVisitor.html">AStarVisitor</a> +<h3>Template Parameters 模板参数</h3> -<H3>Template Parameters</H3> - -<P> -<TABLE border> -<TR> +<p> +<table border="1"> +<tbody><tr> <th>Parameter</th><th>Description</th><th>Default</th> </tr> -<TR><TD><TT>EventVisitorList</TT></TD> -<TD> -A list of <a href="./EventVisitor.html">EventVisitor</a>'s created -with <tt>std::pair</tt>. -</TD> -<TD><TT><a href="./null_visitor.html"><tt>null_visitor</tt></a></TT></TD> -</TR> +<tr><td><tt>EventVisitorList</tt></td>+<td>用 <tt>std::pair</tt> 创建的一个 <a href="./EventVisitor.html">事件遍历 器</a> 列表。
+</td> +<td><tt><a href="./null_visitor.html"><tt>null_visitor</tt></a></tt></td> +</tr> -</table> +</tbody></table> -<H3>Where Defined</H3> +</p><h3>Where Defined 定义于</h3> -<P> +<p> <a href="../../../boost/graph/astar_search.hpp"> -<TT>boost/graph/astar_search.hpp</TT></a> - -<h3>Member Functions</h3> +<tt>boost/graph/astar_search.hpp</tt></a> -This class implements all of the member functions required by <a -href="./AStarVisitor.html">AStarVisitor</a>. In each function the -appropriate event is dispatched to the <a -href="./EventVisitor.html">EventVisitor</a>'s in the -EventVisitorList.+</p><h3>Member Functions 成员函数</h3>该类实现了 <a href="./AStarVisitor.html">AStar遍历器</a> 所要求的所有成员函数。在每个函数 中,正确的事件被分派至事件遍历器列表中的 <a href="./EventVisitor.html">事件遍历器</a>。
-<h3>Non-Member Functions</h3> +<h3>Non-Member Functions 非成员函数</h3> -<table border> -<tr> +<table border="1"> +<tbody><tr> <th>Function</th><th>Description</th> </tr> @@ -78,31 +60,25 @@ template <class EventVisitorList><br> astar_visitor<EventVisitorList><br> make_astar_visitor(EventVisitorList ev_list); -</tt></td><td> -Returns the event visitor list adapted to be an A* visitor. +</tt></td><td>返回将事件遍历器列表适配为A*遍历器的适配器。 </td></tr> -</table> +</tbody></table> -<h3>See Also</h3> +<h3>See Also 参见</h3> -<a href="./visitor_concepts.html">Visitor concepts</a> -<p> -The following are event visitors: <a - href="./predecessor_recorder.html"><tt>predecessor_recorder</tt></a>, +<a href="./visitor_concepts.html">遍历器概念 Visitor concepts</a>+<p>以下均为事件遍历器:<a href="./predecessor_recorder.html"><tt>predecessor_recorder</tt></a>,
<a href="./distance_recorder.html"><tt>distance_recorder</tt></a>, -<a href="./time_stamper.html"><tt>time_stamper</tt></a>, -and <a href="./property_writer.html"><tt>property_writer</tt></a>.+<a href="./time_stamper.html"><tt>time_stamper</tt></a>, 和 <a href="./property_writer.html"><tt>property_writer</tt></a>.
<br> -<HR> -<TABLE> -<TR valign=top> -<TD nowrap>Copyright © 2004</TD><TD> -<A HREF="http://www.cs.rpi.edu/~beevek/";>Kristopher Beevers</A>, -Rensselaer Polytechnic Institute (<A -HREF="mailto:beevek@xxxxxxxxxx";>beevek@xxxxxxxxxx</A>) -</TD></TR></TABLE> +</p><hr> +<table> +<tbody><tr valign="top"> +<td nowrap="nowrap">Copyright (c) 2004</td><td> +<a href="http://www.cs.rpi.edu/%7Ebeevek/";>Kristopher Beevers</a>,+Rensselaer Polytechnic Institute (<a href="mailto:beevek@xxxxxxxxxx";>beevek@xxxxxxxxxx</a>)
+</td></tr></tbody></table> -</BODY> -</HTML> +</body></html> \ No newline at end of file Modified: trunk/libs/graph/doc/bellman_visitor.html ============================================================================== --- trunk/libs/graph/doc/bellman_visitor.html (original) +++ trunk/libs/graph/doc/bellman_visitor.html Wed Jul 15 23:13:51 2009 @@ -1,74 +1,59 @@ -<HTML> -<!-- +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">+<html><head><meta content="text/html; charset=UTF-8" http-equiv="content-type"><!--
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000 -- -- Distributed under the Boost Software License, Version 1.0. -- (See accompanying file LICENSE_1_0.txt or copy at -- http://www.boost.org/LICENSE_1_0.txt) --> -<Head> -<Title>Boost Graph Library: bellman_visitor</Title> -<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b" - ALINK="#ff0000"> -<IMG SRC="../../../boost.png" - ALT="C++ Boost" width="277" height="86"> +<title>Boost Graph Library: bellman_visitor</title></head> -<BR Clear>+<body alink="#ff0000" bgcolor="#ffffff" link="#0000ee" text="#000000" vlink="#551a8b">
+<img src="../../../boost.png" alt="C++ Boost" height="86" width="277"> -<H1> -<pre> -bellman_visitor<EventVisitorList> -</pre> -</H1> +<br clear=""> -This class is an adapter that converts a list of <a -href="./EventVisitor.html">EventVisitor</a>'s (constructed using -<tt>std::pair</tt>) into a <a -href="./BellmanFordVisitor.html">BellmanFordVisitor</a>. +<h1> +<pre>bellman_visitor<EventVisitorList><br></pre>+</h1>该类是一个适配器,将一个 <a href="./EventVisitor.html">事件遍历器</a> 列表(用 +<tt>std::pair</tt> 构造)转换为一个 <a href="./BellmanFordVisitor.html">BellmanFord遍历器</a>。
-<h3>Example</h3> +<h3>Example 示例</h3> -<h3>Model of</h3> +<h3>Model of 以...为模型</h3> -<a href="./BellmanFordVisitor.html">BellmanFordVisitor</a> +<a href="./BellmanFordVisitor.html">BellmanFord遍历器</a> -<H3>Template Parameters</H3> +<h3>Template Parameters 模板参数</h3> -<P> -<TABLE border> -<TR> +<p> +<table border="1"> +<tbody><tr> <th>Parameter</th><th>Description</th><th>Default</th> </tr> -<TR><TD><TT>EventVisitorList</TT></TD> -<TD> -A list of <a href="./EventVisitor.html">EventVisitor</a>'s created -with <tt>std::pair</tt>. -</TD> -<TD><TT><a href="./null_visitor.html"><tt>null_visitor</tt></a></TT></TD> -</TR> +<tr><td><tt>EventVisitorList</tt></td>+<td>用 <tt>std::pair</tt> 创建的一个 <a href="./EventVisitor.html">事件遍历 器</a> 列表。
+</td> +<td><tt><a href="./null_visitor.html"><tt>null_visitor</tt></a></tt></td> +</tr> -</table> +</tbody></table> -<H3>Where Defined</H3> +</p><h3>Where Defined 定义于</h3> -<P> +<p> <a href="../../../boost/graph/bellman_ford_shortest_paths.hpp"> -<TT>boost/graph/bellman_ford_shortest_paths.hpp</TT></a> +<tt>boost/graph/bellman_ford_shortest_paths.hpp</tt></a> -<h3>Member Functions</h3>+</p><h3>Member Functions 成员函数</h3>该类实现了 <a href="./BellmanFordVisitor.html">BellmanFord遍历器</a> 所要求的所有成员函 数。在每个函数中,正确的事件被分派至事件遍历器列表中的 <a href="./EventVisitor.html">事件遍历器</a>。
-This class implements all of the member functions required by <a-href="./BellmanFordVisitor.html">BellmanFordVisitor</a>. In each function the
-appropriate event is dispatched to the <a -href="./EventVisitor.html">EventVisitor</a>'s in the EventVisitorList. +<h3>Non-Member Functions 非成员函数</h3> -<h3>Non-Member Functions</h3> - -<table border> -<tr> +<table border="1"> +<tbody><tr> <th>Function</th><th>Description</th> </tr> @@ -77,35 +62,29 @@ bellman_visitor<EventVisitorList><br> make_bellman_visitor(EventVisitorList ev_list); </tt></td><td> -Returns the event visitor list adapted to be a BellmanFordVisitor. +返回将事件遍历器列表适配为BellmanFord遍历器的适配器。 </td></tr> -</table> +</tbody></table> -<h3>See Also</h3> +<h3>See Also 参见</h3> -<a href="./visitor_concepts.html">Visitor concepts</a> -<p> -The following are event visitors: <a - href="./predecessor_recorder.html"><tt>predecessor_recorder</tt></a>, +<a href="./visitor_concepts.html">遍历器概念 Visitor concepts</a>+<p>以下均为事件遍历器:<a href="./predecessor_recorder.html"><tt>predecessor_recorder</tt></a>,
<a href="./distance_recorder.html"><tt>distance_recorder</tt></a> -<a href="./time_stamper.html"><tt>time_stamper</tt></a>, -and <a href="./property_writer.html"><tt>property_writer</tt></a>.+<a href="./time_stamper.html"><tt>time_stamper</tt></a>, 和 <a href="./property_writer.html"><tt>property_writer</tt></a>.
<br> -<HR> -<TABLE> -<TR valign=top> -<TD nowrap>Copyright © 2000-2001</TD><TD> -<A HREF="http://www.boost.org/people/jeremy_siek.htm";>Jeremy Siek</A>, -Indiana University (<A -HREF="mailto:jsiek@xxxxxxxxxx";>jsiek@xxxxxxxxxx</A>)<br>-<A HREF="http://www.boost.org/people/liequan_lee.htm";>Lie-Quan Lee</A>, Indiana University (<A HREF="mailto:llee@xxxxxxxxxxxxxx";>llee@xxxxxxxxxxxxxx</A>)<br>
-<A HREF="http://www.osl.iu.edu/~lums";>Andrew Lumsdaine</A>, -Indiana University (<A -HREF="mailto:lums@xxxxxxxxxx";>lums@xxxxxxxxxx</A>) -</TD></TR></TABLE> +</p><hr> +<table> +<tbody><tr valign="top"> +<td nowrap="nowrap">Copyright (c) 2000-2001</td><td> +<a href="http://www.boost.org/people/jeremy_siek.htm";>Jeremy Siek</a>,+Indiana University (<a href="mailto:jsiek@xxxxxxxxxx";>jsiek@xxxxxxxxxx</a>)<br> +<a href="http://www.boost.org/people/liequan_lee.htm";>Lie-Quan Lee</a>, Indiana University (<a href="mailto:llee@xxxxxxxxxxxxxx";>llee@xxxxxxxxxxxxxx</a>)<br>
+<a href="http://www.osl.iu.edu/%7Elums";>Andrew Lumsdaine</a>, +Indiana University (<a href="mailto:lums@xxxxxxxxxx";>lums@xxxxxxxxxx</a>) +</td></tr></tbody></table> -</BODY> -</HTML> +</body></html> \ No newline at end of file Modified: trunk/libs/graph/doc/bfs_visitor.html ============================================================================== --- trunk/libs/graph/doc/bfs_visitor.html (original) +++ trunk/libs/graph/doc/bfs_visitor.html Wed Jul 15 23:13:51 2009 @@ -1,91 +1,61 @@ -<HTML> -<!-- +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">+<html><head><meta content="text/html; charset=UTF-8" http-equiv="content-type"><!--
-- Copyright (c) Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine 2000 -- -- Distributed under the Boost Software License, Version 1.0. -- (See accompanying file LICENSE_1_0.txt or copy at -- http://www.boost.org/LICENSE_1_0.txt) --> -<Head> -<Title>Boost Graph Library: bfs_visitor</Title> -<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b" - ALINK="#ff0000"> -<IMG SRC="../../../boost.png" - ALT="C++ Boost" width="277" height="86"> +<title>Boost Graph Library: bfs_visitor</title></head>+<body alink="#ff0000" bgcolor="#ffffff" link="#0000ee" text="#000000" vlink="#551a8b">
+<img src="../../../boost.png" alt="C++ Boost" height="86" width="277"> -<BR Clear> +<br clear=""> -<H1> -<pre> -bfs_visitor<EventVisitorList> -</pre> -</H1> +<h1> +<pre>bfs_visi ============================================================================== Diff truncated at 200k characters