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:
@@ -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 <iostream> // std::cout
|
||||
#include <utility> // std::pair
|
||||
#include <boost/graph/graph_traits.hpp>
|
||||
#include <boost/graph/adjacency_list.hpp>
|
||||
#include <boost/graph/topological_sort.hpp>
|
||||
</PRE>
|
||||
|
||||
<P>
|
||||
For simplicity we have
|
||||
constructed the graph "by-hand". 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<vertex_color_t, default_color_type>,
|
||||
property<edge_weight_t, int>
|
||||
> 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<Graph>::vertex_descriptor Vertex;
|
||||
</PRE>
|
||||
|
||||
|
||||
@@ -234,6 +234,8 @@ This example demonstrates using BGL-graphviz interface to write
|
||||
a BGL graph into a graphviz format file.
|
||||
|
||||
<pre>
|
||||
#include <boost/graph/graphviz.hpp>
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user