From bed19d5c257ec7d64a08ec2c5e86cab432f755f1 Mon Sep 17 00:00:00 2001 From: Jeremiah Willcock Date: Tue, 1 Oct 2013 18:12:50 +0000 Subject: [PATCH] Qualified calls to tie in documentation; fixes #9184 [SVN r86126] --- doc/adjacency_list.html | 10 +++++----- doc/boykov_kolmogorov_max_flow.html | 4 ++-- doc/constructing_algorithms.html | 4 ++-- doc/faq.html | 2 +- doc/file_dependency_example.html | 2 +- doc/graph_coloring.html | 4 ++-- doc/graph_concepts.html | 10 +++++----- doc/incident.html | 2 +- doc/kevin_bacon.html | 6 +++--- doc/opposite.html | 2 +- doc/push_relabel_max_flow.html | 4 ++-- doc/quick_tour.html | 10 +++++----- doc/sparse_matrix_ordering.html | 4 ++-- doc/write_graphml.html | 4 ++-- 14 files changed, 34 insertions(+), 34 deletions(-) diff --git a/doc/adjacency_list.html b/doc/adjacency_list.html index 3e53f9f7..10cc75f1 100644 --- a/doc/adjacency_list.html +++ b/doc/adjacency_list.html @@ -214,12 +214,12 @@ example, the following code will result in undefined (bad) behavior: // Attempt to remove all the vertices. Wrong! graph_traits<Graph>::vertex_iterator vi, vi_end; - for (tie(vi, vi_end) = vertices(G); vi != vi_end; ++vi) + for (boost::tie(vi, vi_end) = vertices(G); vi != vi_end; ++vi) remove_vertex(*vi, G); // Remove all the vertices. This is still wrong! graph_traits<Graph>::vertex_iterator vi, vi_end, next; - tie(vi, vi_end) = vertices(G); + boost::tie(vi, vi_end) = vertices(G); for (next = vi; vi != vi_end; vi = next) { ++next; remove_vertex(*vi, G); @@ -247,12 +247,12 @@ actual vertex that was removed. The following code demonstrates this. // Attempt to remove all the vertices. Wrong! graph_traits<Graph>::vertex_iterator vi, vi_end; - for (tie(vi, vi_end) = vertices(G); vi != vi_end; ++vi) + for (boost::tie(vi, vi_end) = vertices(G); vi != vi_end; ++vi) remove_vertex(*vi, G); // Remove all the vertices. This is OK. graph_traits<Graph>::vertex_iterator vi, vi_end, next; - tie(vi, vi_end) = vertices(G); + boost::tie(vi, vi_end) = vertices(G); for (next = vi; vi != vi_end; vi = next) { ++next; remove_vertex(*vi, G); @@ -281,7 +281,7 @@ vertex descriptors have become invalid, the result is incorrect. remove_vertex(s, G); // Bad idea! Invalidates vertex descriptors in parent vector. // The following will produce incorrect results - for(tie(vi, vend) = vertices(G); vi != vend; ++vi) + for(boost::tie(vi, vend) = vertices(G); vi != vend; ++vi) std::cout << p[*vi] << " is the parent of " << *vi << std::endl; diff --git a/doc/boykov_kolmogorov_max_flow.html b/doc/boykov_kolmogorov_max_flow.html index 1a5b0312..ecaaf5ca 100644 --- a/doc/boykov_kolmogorov_max_flow.html +++ b/doc/boykov_kolmogorov_max_flow.html @@ -338,8 +338,8 @@ main() std::cout << "c flow values:" << std::endl; graph_traits < Graph >::vertex_iterator u_iter, u_end; graph_traits < Graph >::out_edge_iterator ei, e_end; - for (tie(u_iter, u_end) = vertices(g); u_iter != u_end; ++u_iter) - for (tie(ei, e_end) = out_edges(*u_iter, g); ei != e_end; ++ei) + for (boost::tie(u_iter, u_end) = vertices(g); u_iter != u_end; ++u_iter) + for (boost::tie(ei, e_end) = out_edges(*u_iter, g); ei != e_end; ++ei) if (capacity[*ei] > 0) std::cout << "f " << *u_iter << " " << target(*ei, g) << " " << (capacity[*ei] - residual_capacity[*ei]) << std::endl; diff --git a/doc/constructing_algorithms.html b/doc/constructing_algorithms.html index cc4047b0..4c9e96e2 100644 --- a/doc/constructing_algorithms.html +++ b/doc/constructing_algorithms.html @@ -134,7 +134,7 @@ namespace boost { mark(V, numeric_limits_max(max_color)); typename GraphTraits::vertex_iterator v, vend; - for (tie(v, vend) = vertices(G); v != vend; ++v) + for (boost::tie(v, vend) = vertices(G); v != vend; ++v) color[*v] = V - 1; // which means "not colored" for (size_type i = 0; i < V; i++) { @@ -142,7 +142,7 @@ namespace boost { // mark all the colors of the adjacent vertices typename GraphTraits::adjacency_iterator ai, aend; - for (tie(ai, aend) = adjacent_vertices(current, G); ai != aend; ++ai) + for (boost::tie(ai, aend) = adjacent_vertices(current, G); ai != aend; ++ai) mark[color[*ai]] = i; // find the smallest color unused by the adjacent vertices diff --git a/doc/faq.html b/doc/faq.html index ff20e162..c77fca5d 100644 --- a/doc/faq.html +++ b/doc/faq.html @@ -115,7 +115,7 @@ library. OO was hip in the 80s and 90s, but its time we moved beyond! // initialize the vertex_index property values graph_traits<graph_t>::vertex_iterator vi, vend; graph_traits<graph_t>::vertices_size_type cnt = 0; - for(tie(vi,vend) = vertices(G); vi != vend; ++vi) + for(boost::tie(vi,vend) = vertices(G); vi != vend; ++vi) put(index, *vi, cnt++); diff --git a/doc/file_dependency_example.html b/doc/file_dependency_example.html index fed8ef6a..50152676 100644 --- a/doc/file_dependency_example.html +++ b/doc/file_dependency_example.html @@ -233,7 +233,7 @@ it depends on. if (in_degree (*i, g) > 0) { Graph::in_edge_iterator j, j_end; int maxdist = 0; - for (tie(j, j_end) = in_edges(*i, g); j != j_end; ++j) + for (boost::tie(j, j_end) = in_edges(*i, g); j != j_end; ++j) maxdist = std::max(time[source(*j, g)], maxdist); time[*i]=maxdist+1; } diff --git a/doc/graph_coloring.html b/doc/graph_coloring.html index cfeaaef9..1d4dcb77 100644 --- a/doc/graph_coloring.html +++ b/doc/graph_coloring.html @@ -127,7 +127,7 @@ namespace boost { const size_type num = num_vertices(G); typename GraphTraits::vertex_iterator v, vend; - for (tie(v, vend) = vertices(G); v != vend; ++v) { + for (boost::tie(v, vend) = vertices(G); v != vend; ++v) { put(marker, *v, num); put(degree, *v, out_degree(*v, G)); degree_buckets.push(*v); @@ -152,7 +152,7 @@ namespace boost { put(marker, node, 0); //node has been ordered. typename GraphTraits::adjacency_iterator v, vend; - for (tie(v,vend) = adjacent_vertices(node, G); v != vend; ++v) + for (boost::tie(v,vend) = adjacent_vertices(node, G); v != vend; ++v) if ( get(marker, *v) > current_order ) { //*v is unordered vertex put(marker, *v, current_order); //mark the columns adjacent to node diff --git a/doc/graph_concepts.html b/doc/graph_concepts.html index a7dd3060..9b5b5cd3 100644 --- a/doc/graph_concepts.html +++ b/doc/graph_concepts.html @@ -408,7 +408,7 @@ href="../example/undirected_adjacency_list.cpp">example/undirected_adjacency boost::graph_traits<UndirectedGraph>::out_edge_iterator e, e_end; boost::graph_traits<UndirectedGraph>::vertex_descriptor s = vertex(0, undigraph); - for (tie(e, e_end) = out_edges(s, undigraph); e != e_end; ++e) + for (boost::tie(e, e_end) = out_edges(s, undigraph); e != e_end; ++e) std::cout << "(" << source(*e, undigraph) << "," << target(*e, undigraph) << ")" << endl; @@ -447,8 +447,8 @@ of (v,u) since they are the same edge. add_edge(digraph, v, u, Weight(2.4)); boost::graph_traits<DirectedGraph>::edge_descriptor e1, e2; bool found; - tie(e1, found) = edge(u, v, digraph); - tie(e2, found) = edge(v, u, digraph); + boost::tie(e1, found) = edge(u, v, digraph); + boost::tie(e2, found) = edge(v, u, digraph); std::cout << "in a directed graph is "; std::cout << "(u,v) == (v,u) ? " << (e1 == e2) << std::endl; @@ -464,8 +464,8 @@ of (v,u) since they are the same edge. add_edge(undigraph, u, v, Weight(3.1)); boost::graph_traits<UndirectedGraph>::edge_descriptor e1, e2; bool found; - tie(e1, found) = edge(u, v, undigraph); - tie(e2, found) = edge(v, u, undigraph); + boost::tie(e1, found) = edge(u, v, undigraph); + boost::tie(e2, found) = edge(v, u, undigraph); std::cout << "in an undirected graph is "; std::cout << "(u,v) == (v,u) ? " << (e1 == e2) << std::endl; diff --git a/doc/incident.html b/doc/incident.html index e75f336c..703e17f7 100644 --- a/doc/incident.html +++ b/doc/incident.html @@ -57,7 +57,7 @@ is the target. This function is equivalent to the expression edge_descriptor e; vertex_descriptor u, v; ... - tie(u, v) = incident(e, g); + boost::tie(u, v) = incident(e, g); diff --git a/doc/kevin_bacon.html b/doc/kevin_bacon.html index 8b2670bd..6648da7f 100644 --- a/doc/kevin_bacon.html +++ b/doc/kevin_bacon.html @@ -156,7 +156,7 @@ descriptor from the map's pos iterator. tokenizer<>::iterator i = line_toks.begin(); std::string actors_name = *i++; - tie(pos, inserted) = actors.insert(std::make_pair(actors_name, Vertex())); + boost::tie(pos, inserted) = actors.insert(std::make_pair(actors_name, Vertex())); if (inserted) { u = add_vertex(g); actor_name[u] = actors_name; @@ -174,7 +174,7 @@ actor into the graph.
   std::string movie_name = *i++;
       
-  tie(pos, inserted) = actors.insert(std::make_pair(*i, Vertex()));
+  boost::tie(pos, inserted) = actors.insert(std::make_pair(*i, Vertex()));
   if (inserted) {
     v = add_vertex(g);
     actor_name[v] = *i;
@@ -190,7 +190,7 @@ the name of the connecting movie.
 

   graph_traits<Graph>::edge_descriptor e;
-  tie(e, inserted) = add_edge(u, v, g);
+  boost::tie(e, inserted) = add_edge(u, v, g);
   if (inserted)
     connecting_movie[e] = movie_name;
 
diff --git a/doc/opposite.html b/doc/opposite.html index 6e3f12db..f9be2e47 100644 --- a/doc/opposite.html +++ b/doc/opposite.html @@ -56,7 +56,7 @@ target, then this function returns the source vertex. edge_descriptor e; ... vertex_descriptor u, v; -tie(u, v) = incident(e, g); +boost::tie(u, v) = incident(e, g); assert(v == opposite(e, u, g)); assert(u == opposite(e, v, g));
diff --git a/doc/push_relabel_max_flow.html b/doc/push_relabel_max_flow.html index cb96c83a..5dff0504 100644 --- a/doc/push_relabel_max_flow.html +++ b/doc/push_relabel_max_flow.html @@ -196,8 +196,8 @@ main() std::cout << "c flow values:" << std::endl; graph_traits<Graph>::vertex_iterator u_iter, u_end; graph_traits<Graph>::out_edge_iterator ei, e_end; - for (tie(u_iter, u_end) = vertices(g); u_iter != u_end; ++u_iter) - for (tie(ei, e_end) = out_edges(*u_iter, g); ei != e_end; ++ei) + for (boost::tie(u_iter, u_end) = vertices(g); u_iter != u_end; ++u_iter) + for (boost::tie(ei, e_end) = out_edges(*u_iter, g); ei != e_end; ++ei) if (capacity[*ei] > 0) std::cout << "f " << *u_iter << " " << target(*ei, g) << " " << (capacity[*ei] - residual_capacity[*ei]) << std::endl; diff --git a/doc/quick_tour.html b/doc/quick_tour.html index 5ae9ffe9..5156bb7b 100644 --- a/doc/quick_tour.html +++ b/doc/quick_tour.html @@ -187,7 +187,7 @@ but in this case the iterators are edge iterators. Dereferencing an edge iterator gives an edge object. The source() and target() functions return the two vertices that are connected by the edge. Instead of explicitly creating a std::pair for the iterators, this time we will -use the tie() helper function. +use the boost::tie() helper function. This handy function can be used to assign the parts of a std::pair into two separate variables, in this case ei and ei_end. This is usually more convenient than creating a std::pair and is our method of @@ -200,7 +200,7 @@ choice for the BGL. // ... std::cout << "edges(g) = "; graph_traits<Graph>::edge_iterator ei, ei_end; - for (tie(ei, ei_end) = edges(g); ei != ei_end; ++ei) + for (boost::tie(ei, ei_end) = edges(g); ei != ei_end; ++ei) std::cout << "(" << index[source(*ei, g)] << "," << index[target(*ei, g)] << ") "; std::cout << std::endl; @@ -303,7 +303,7 @@ out-edge of vertex v. std::cout << "out-edges: "; typename GraphTraits::out_edge_iterator out_i, out_end; typename GraphTraits::edge_descriptor e; - for (tie(out_i, out_end) = out_edges(v, g); + for (boost::tie(out_i, out_end) = out_edges(v, g); out_i != out_end; ++out_i) { e = *out_i; Vertex src = source(e, g), targ = target(e, g); @@ -337,7 +337,7 @@ specified instead of directedS. std::cout << "in-edges: "; typedef typename graph_traits<Graph> GraphTraits; typename GraphTraits::in_edge_iterator in_i, in_end; - for (tie(in_i, in_end) = in_edges(v,g); + for (boost::tie(in_i, in_end) = in_edges(v,g); in_i != in_end; ++in_i) { e = *in_i; Vertex src = source(e, g), targ = target(e, g); @@ -373,7 +373,7 @@ descriptor for an adjacent vertex. std::cout << "adjacent vertices: "; typename graph_traits<Graph>::adjacency_iterator ai; typename graph_traits<Graph>::adjacency_iterator ai_end; - for (tie(ai, ai_end) = adjacent_vertices(v, g); + for (boost::tie(ai, ai_end) = adjacent_vertices(v, g); ai != ai_end; ++ai) std::cout << index[*ai] << " "; std::cout << std::endl; diff --git a/doc/sparse_matrix_ordering.html b/doc/sparse_matrix_ordering.html index 87b39e7f..44a6a1bc 100644 --- a/doc/sparse_matrix_ordering.html +++ b/doc/sparse_matrix_ordering.html @@ -143,7 +143,7 @@ namespace boost { rcm_queue<Vertex, Degree> Q(degree); typename boost::graph_traits<Graph>::vertex_iterator ui, ui_end; - for (tie(ui, ui_end) = vertices(G); ui != ui_end; ++ui) + for (boost::tie(ui, ui_end) = vertices(G); ui != ui_end; ++ui) put(color, *ui, white(c)); breadth_first_search(G, u, Q, bfs_visitor<>(), color); @@ -214,7 +214,7 @@ from BGL can be reused. CMVisitor cm_visitor(inverse_permutation); typename boost::graph_traits<Graph>::vertex_iterator ui, ui_end; - for (tie(ui, ui_end) = vertices(G); ui != ui_end; ++ui) + for (boost::tie(ui, ui_end) = vertices(G); ui != ui_end; ++ui) put(color, *ui, white(c)); breadth_first_search(G, s, Q, cm_visitor, color); } diff --git a/doc/write_graphml.html b/doc/write_graphml.html index b3bbd131..8ed7127a 100644 --- a/doc/write_graphml.html +++ b/doc/write_graphml.html @@ -116,11 +116,11 @@ int main(int,char*[]) Graph g(used_by, used_by + nedges, N); graph_traits<Graph>::vertex_iterator v, v_end; - for (tie(v,v_end) = vertices(g); v != v_end; ++v) + for (boost::tie(v,v_end) = vertices(g); v != v_end; ++v) put(vertex_color_t(), g, *v, name[*v]); graph_traits<Graph>::edge_iterator e, e_end; - for (tie(e,e_end) = edges(g); e != e_end; ++e) + for (boost::tie(e,e_end) = edges(g); e != e_end; ++e) put(edge_weight_t(), g, *e, 3); dynamic_properties dp;