2
0
mirror of https://github.com/boostorg/graph.git synced 2026-02-02 08:52:10 +00:00

Documentation fixes, from David Baird

[SVN r34810]
This commit is contained in:
Douglas Gregor
2006-08-03 18:20:43 +00:00
parent 62cc164059
commit 65f63fecc1
2 changed files with 21 additions and 4 deletions

View File

@@ -85,7 +85,20 @@ href="../example/file_dependencies.cpp"><TT>examples/file_dependencies.cpp</TT><
<H2>Graph Setup</H2>
<P>
Here we show the construction of the graph. For simplicity we have
Here we show the construction of the graph. First, these are the required
header files:
<P>
<PRE>
#include &lt;iostream&gt; // std::cout
#include &lt;utility&gt; // std::pair
#include &lt;boost/graph/graph_traits.hpp&gt;
#include &lt;boost/graph/adjacency_list.hpp&gt;
#include &lt;boost/graph/topological_sort.hpp&gt;
</PRE>
<P>
For simplicity we have
constructed the graph &quot;by-hand&quot;. A compilation system such
as <TT>make</TT> would instead parse a <TT>Makefile</TT> to get the
list of files and to set-up the dependencies. We use the
@@ -131,7 +144,7 @@ the following sections.
property&lt;vertex_color_t, default_color_type&gt;,
property&lt;edge_weight_t, int&gt;
&gt; Graph;
Graph g(N, used_by, used_by + sizeof(used_by) / sizeof(Edge));
Graph g(used_by, used_by + sizeof(used_by) / sizeof(Edge), N);
typedef graph_traits&lt;Graph&gt;::vertex_descriptor Vertex;
</PRE>

View File

@@ -234,6 +234,8 @@ This example demonstrates using BGL-graphviz interface to write
a BGL graph into a graphviz format file.
<pre>
#include &lt;boost/graph/graphviz.hpp&gt;
enum files_e { dax_h, yow_h, boz_h, zow_h, foo_cpp,
foo_o, bar_cpp, bar_o, libfoobar_a,
zig_cpp, zig_o, zag_cpp, zag_o,
@@ -265,13 +267,15 @@ int main(int,char*[])
};
const int nedges = sizeof(used_by)/sizeof(Edge);
int weights[nedges];
fill(weights, weights + nedges, 1);
std::fill(weights, weights + nedges, 1);
using namespace boost;
typedef adjacency_list< vecS, vecS, directedS,
property< vertex_color_t, default_color_type >,
property< edge_weight_t, int >
> Graph;
Graph g(N, used_by, used_by + nedges, weights);
Graph g(used_by, used_by + nedges, weights, N);
write_graphviz(std::cout, g, make_label_writer(name));
}