|
Boost-Commit : |
From: asutton_at_[hidden]
Date: 2007-07-19 09:50:36
Author: asutton
Date: 2007-07-19 09:50:35 EDT (Thu, 19 Jul 2007)
New Revision: 7479
URL: http://svn.boost.org/trac/boost/changeset/7479
Log:
Cleaning house
Text files modified:
sandbox/SOC/2007/graphs/libs/graph/test/Jamfile.v2 | 7 +++++++
sandbox/SOC/2007/graphs/libs/graph/test/components.cpp | 21 ++++++++++-----------
2 files changed, 17 insertions(+), 11 deletions(-)
Modified: sandbox/SOC/2007/graphs/libs/graph/test/Jamfile.v2
==============================================================================
--- sandbox/SOC/2007/graphs/libs/graph/test/Jamfile.v2 (original)
+++ sandbox/SOC/2007/graphs/libs/graph/test/Jamfile.v2 2007-07-19 09:50:35 EDT (Thu, 19 Jul 2007)
@@ -65,3 +65,10 @@
: <include>$BOOST_ROOT
: <include>../../../
;
+
+exe parameter
+ : parameter.cpp
+ : <include>$BOOST_ROOT
+ : <include>../../../
+ ;
+
Modified: sandbox/SOC/2007/graphs/libs/graph/test/components.cpp
==============================================================================
--- sandbox/SOC/2007/graphs/libs/graph/test/components.cpp (original)
+++ sandbox/SOC/2007/graphs/libs/graph/test/components.cpp 2007-07-19 09:50:35 EDT (Thu, 19 Jul 2007)
@@ -17,8 +17,6 @@
#include <boost/graph/connectivity.hpp>
#include <boost/foreach.hpp>
-#define for_each BOOST_FOREACH
-
using namespace std;
using namespace boost;
@@ -60,20 +58,21 @@
ComponentContainer comps(num_vertices(g));
ComponentMap comps_map(make_property_map(comps));
- connected_components(g, comps_map);
+ size_t n = connected_components(g, comps_map);
- typedef std::vector<Vertex> VertexList;
- typedef std::vector<VertexList> Component;
+ typedef vector<Vertex> VertexList;
+ typedef vector<VertexList> Component;
Component components;
connectivity(
_graph = g,
_components = components,
+ _number = n,
_component_map = comps_map);
size_t c = 0;
- for_each(VertexList& vl, components) {
+ BOOST_FOREACH(VertexList& vl, components) {
cout << "component " << c++ << ": ";
- for_each(Vertex v, vl) {
+ BOOST_FOREACH(Vertex v, vl) {
cout << get(vertex_index, g, v) << " ";
}
cout << endl;
@@ -92,15 +91,15 @@
Graph g;
build_graph(g);
- typedef std::vector<Vertex> VertexList;
- typedef std::vector<VertexList> Component;
+ typedef vector<Vertex> VertexList;
+ typedef vector<VertexList> Component;
Component components;
connectivity(_graph = g, _components = components);
size_t c = 0;
- for_each(VertexList& vl, components) {
+ BOOST_FOREACH(VertexList& vl, components) {
cout << "component " << c++ << ": ";
- for_each(Vertex v, vl) {
+ BOOST_FOREACH(Vertex v, vl) {
cout << get(vertex_index, g, v) << " ";
}
cout << endl;
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk