diff --git a/doc/file_dependency_example.html b/doc/file_dependency_example.html index 683e26b4..995385db 100644 --- a/doc/file_dependency_example.html +++ b/doc/file_dependency_example.html @@ -85,7 +85,20 @@ href="../example/file_dependencies.cpp">examples/file_dependencies.cpp<
-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: + +
+
+#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> ++ +
+For simplicity we have constructed the graph "by-hand". A compilation system such as make would instead parse a Makefile 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; diff --git a/doc/write-graphviz.html b/doc/write-graphviz.html index 454bbc90..f0e5e9cb 100644 --- a/doc/write-graphviz.html +++ b/doc/write-graphviz.html @@ -234,6 +234,8 @@ This example demonstrates using BGL-graphviz interface to write a BGL graph into a graphviz format file.
+#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));
}