Skip to content

Commit 371f28e

Browse files
committed
Revert non-library changes
1 parent 1a9cab9 commit 371f28e

7 files changed

+32
-22
lines changed

Diff for: CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ target_link_libraries(boost_graph
2929
Boost::conversion
3030
Boost::core
3131
Boost::detail
32+
Boost::foreach
3233
Boost::function
3334
Boost::integer
3435
Boost::iterator

Diff for: doc/incremental_components.html

+4-3
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ <H3>Example</H3>
142142
print_graph(graph, get(boost::vertex_index, graph));
143143
std::cout << std::endl;
144144

145-
for (Vertex current_vertex: vertices(graph)) {
145+
BOOST_FOREACH(Vertex current_vertex, vertices(graph)) {
146146
std::cout << "representative[" << current_vertex << "] = " <<
147147
ds.find_set(current_vertex) << std::endl;
148148
}
@@ -158,11 +158,12 @@ <H3>Example</H3>
158158
Components components(parent.begin(), parent.end());
159159
160160
// Iterate through the component indices
161-
for (VertexIndex current_index: components) {
161+
BOOST_FOREACH(VertexIndex current_index, components) {
162162
std::cout << "component " << current_index << " contains: ";
163163

164164
// Iterate through the child vertex indices for [current_index]
165-
for (VertexIndex child_index: components[current_index]) {
165+
BOOST_FOREACH(VertexIndex child_index,
166+
components[current_index]) {
166167
std::cout << child_index << " ";
167168
}
168169

Diff for: example/graph-thingie.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
#include <boost/graph/graphviz.hpp>
1313
#include <boost/graph/adjacency_list.hpp>
14+
#include <boost/foreach.hpp>
1415
#include <string>
1516
#include <sstream>
1617
#include <cstdlib>
@@ -98,7 +99,7 @@ int main()
9899
cout << "graph " << get("name", dp, &graph) << " ("
99100
<< get("identifier", dp, &graph) << ")\n\n";
100101

101-
for (graph_t::vertex_descriptor v: vertices(graph))
102+
BOOST_FOREACH (graph_t::vertex_descriptor v, vertices(graph))
102103
{
103104
cout << "vertex " << get("node_id", dp, v) << " ("
104105
<< get("label", dp, v) << ")\n";

Diff for: example/incremental-components-eg.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <iostream>
1212
#include <vector>
1313

14+
#include <boost/foreach.hpp>
1415
#include <boost/graph/adjacency_list.hpp>
1516
#include <boost/graph/incremental_components.hpp>
1617
#include <boost/pending/disjoint_sets.hpp>
@@ -52,7 +53,7 @@ int main(int argc, char* argv[])
5253
ds.union_set(4, 0);
5354
ds.union_set(2, 5);
5455

55-
for (Vertex current_vertex: vertices(graph))
56+
BOOST_FOREACH (Vertex current_vertex, vertices(graph))
5657
{
5758
std::cout << "representative[" << current_vertex
5859
<< "] = " << ds.find_set(current_vertex) << std::endl;
@@ -68,12 +69,12 @@ int main(int argc, char* argv[])
6869
Components components(parent.begin(), parent.end());
6970

7071
// Iterate through the component indices
71-
for (VertexIndex component_index: components)
72+
BOOST_FOREACH (VertexIndex component_index, components)
7273
{
7374
std::cout << "component " << component_index << " contains: ";
7475

7576
// Iterate through the child vertex indices for [component_index]
76-
for (VertexIndex child_index: components[component_index])
77+
BOOST_FOREACH (VertexIndex child_index, components[component_index])
7778
{
7879
std::cout << child_index << " ";
7980
}

Diff for: example/incremental_components.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <iostream>
1111
#include <vector>
1212

13+
#include <boost/foreach.hpp>
1314
#include <boost/graph/adjacency_list.hpp>
1415
#include <boost/graph/graph_utility.hpp>
1516
#include <boost/graph/incremental_components.hpp>
@@ -85,7 +86,7 @@ int main(int argc, char* argv[])
8586
print_graph(graph, get(boost::vertex_index, graph));
8687
std::cout << std::endl;
8788

88-
for (Vertex current_vertex: vertices(graph))
89+
BOOST_FOREACH (Vertex current_vertex, vertices(graph))
8990
{
9091
std::cout << "representative[" << current_vertex
9192
<< "] = " << ds.find_set(current_vertex) << std::endl;
@@ -102,12 +103,12 @@ int main(int argc, char* argv[])
102103
Components components(parent.begin(), parent.end());
103104

104105
// Iterate through the component indices
105-
for (VertexIndex current_index: components)
106+
BOOST_FOREACH (VertexIndex current_index, components)
106107
{
107108
std::cout << "component " << current_index << " contains: ";
108109

109110
// Iterate through the child vertex indices for [current_index]
110-
for (VertexIndex child_index: components[current_index])
111+
BOOST_FOREACH (VertexIndex child_index, components[current_index])
111112
{
112113
std::cout << child_index << " ";
113114
}

Diff for: test/grid_graph_test.cpp

+8-6
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <set>
1313
#include <ctime>
1414

15+
#include <boost/foreach.hpp>
1516
#include <boost/lexical_cast.hpp>
1617
#include <boost/graph/grid_graph.hpp>
1718
#include <boost/random.hpp>
@@ -99,7 +100,7 @@ template < unsigned int Dims > void do_test(minstd_rand& generator)
99100

100101
// Verify all vertices are within bounds
101102
vertices_size_type vertex_count = 0;
102-
for (vertex_descriptor current_vertex: vertices(graph))
103+
BOOST_FOREACH (vertex_descriptor current_vertex, vertices(graph))
103104
{
104105

105106
vertices_size_type current_index
@@ -117,7 +118,8 @@ template < unsigned int Dims > void do_test(minstd_rand& generator)
117118
edges_size_type out_edge_count = 0;
118119
std::set< vertices_size_type > target_vertices;
119120

120-
for (edge_descriptor out_edge: out_edges(current_vertex, graph))
121+
BOOST_FOREACH (
122+
edge_descriptor out_edge, out_edges(current_vertex, graph))
121123
{
122124

123125
target_vertices.insert(
@@ -131,7 +133,7 @@ template < unsigned int Dims > void do_test(minstd_rand& generator)
131133
// Verify in-edges of this vertex
132134
edges_size_type in_edge_count = 0;
133135

134-
for (edge_descriptor in_edge: in_edges(current_vertex, graph))
136+
BOOST_FOREACH (edge_descriptor in_edge, in_edges(current_vertex, graph))
135137
{
136138

137139
BOOST_TEST(target_vertices.count(get(boost::vertex_index, graph,
@@ -151,7 +153,7 @@ template < unsigned int Dims > void do_test(minstd_rand& generator)
151153
// Verify adjacent vertices to this vertex
152154
vertices_size_type adjacent_count = 0;
153155

154-
for (vertex_descriptor adjacent_vertex:
156+
BOOST_FOREACH (vertex_descriptor adjacent_vertex,
155157
adjacent_vertices(current_vertex, graph))
156158
{
157159

@@ -166,7 +168,7 @@ template < unsigned int Dims > void do_test(minstd_rand& generator)
166168

167169
// Verify that this vertex is not listed as connected to any
168170
// vertices outside of its adjacent vertices.
169-
for (vertex_descriptor unconnected_vertex: vertices(graph))
171+
BOOST_FOREACH (vertex_descriptor unconnected_vertex, vertices(graph))
170172
{
171173

172174
vertices_size_type unconnected_index
@@ -191,7 +193,7 @@ template < unsigned int Dims > void do_test(minstd_rand& generator)
191193

192194
// Verify all edges are within bounds
193195
edges_size_type edge_count = 0;
194-
for (edge_descriptor current_edge: edges(graph))
196+
BOOST_FOREACH (edge_descriptor current_edge, edges(graph))
195197
{
196198

197199
vertices_size_type source_index

Diff for: test/incremental_components_test.cpp

+9-6
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <set>
1313
#include <ctime>
1414

15+
#include <boost/foreach.hpp>
1516
#include <boost/graph/adjacency_list.hpp>
1617
#include <boost/graph/incremental_components.hpp>
1718
#include <boost/graph/random.hpp>
@@ -68,19 +69,20 @@ template < typename Graph > void test_graph(const Graph& graph)
6869
// Create a reverse-lookup map for vertex indices
6970
std::vector< vertex_descriptor > reverse_index_map(num_vertices(graph));
7071

71-
for (vertex_descriptor vertex: vertices(graph))
72+
BOOST_FOREACH (vertex_descriptor vertex, vertices(graph))
7273
{
7374
reverse_index_map[get(get(boost::vertex_index, graph), vertex)]
7475
= vertex;
7576
}
7677

7778
// Verify that components are really connected
78-
for (vertices_size_type component_index: vertex_components)
79+
BOOST_FOREACH (vertices_size_type component_index, vertex_components)
7980
{
8081

8182
std::set< vertex_descriptor > component_vertices;
8283

83-
for (vertices_size_type child_index: vertex_components[component_index])
84+
BOOST_FOREACH (
85+
vertices_size_type child_index, vertex_components[component_index])
8486
{
8587

8688
vertex_descriptor child_vertex = reverse_index_map[child_index];
@@ -90,7 +92,7 @@ template < typename Graph > void test_graph(const Graph& graph)
9092

9193
// Verify that children are connected to each other in some
9294
// manner, but not to vertices outside their component.
93-
for (vertex_descriptor child_vertex: component_vertices)
95+
BOOST_FOREACH (vertex_descriptor child_vertex, component_vertices)
9496
{
9597

9698
// Skip orphan vertices
@@ -103,7 +105,8 @@ template < typename Graph > void test_graph(const Graph& graph)
103105
// another vertex in the component.
104106
bool edge_exists = false;
105107

106-
for (edge_descriptor child_edge: out_edges(child_vertex, graph))
108+
BOOST_FOREACH (
109+
edge_descriptor child_edge, out_edges(child_vertex, graph))
107110
{
108111

109112
if (component_vertices.count(target(child_edge, graph)) > 0)
@@ -159,7 +162,7 @@ int main(int argc, char* argv[])
159162

160163
// Assign indices to list_graph's vertices
161164
graph_traits< ListGraph >::vertices_size_type index = 0;
162-
for (graph_traits< ListGraph >::vertex_descriptor vertex:
165+
BOOST_FOREACH (graph_traits< ListGraph >::vertex_descriptor vertex,
163166
vertices(list_graph))
164167
{
165168
put(get(boost::vertex_index, list_graph), vertex, index++);

0 commit comments

Comments
 (0)