@@ -56,8 +56,8 @@ int main(int , char* [])
5656 Pair (6 ,7 ) }; // g-h
5757
5858 Graph G (10 );
59- for (int i = 0 ; i < 14 ; ++i )
60- add_edge (edges[i] .first , edges[i] .second , G);
59+ for (const auto & edge : edges )
60+ add_edge (edge .first , edge .second , G);
6161
6262 graph_traits<Graph>::vertex_iterator ui, ui_end;
6363
@@ -78,9 +78,8 @@ int main(int , char* [])
7878 get (vertex_degree, G));
7979 cout << " Reverse Cuthill-McKee ordering starting at: " << s << endl;
8080 cout << " " ;
81- for (auto i = inv_perm.begin ();
82- i != inv_perm.end (); ++i)
83- cout << index_map[*i] << " " ;
81+ for (const auto & vertex : inv_perm)
82+ cout << index_map[vertex] << " " ;
8483 cout << endl;
8584
8685 for (size_type c = 0 ; c != inv_perm.size (); ++c)
@@ -96,9 +95,8 @@ int main(int , char* [])
9695 get (vertex_degree, G));
9796 cout << " Reverse Cuthill-McKee ordering starting at: " << s << endl;
9897 cout << " " ;
99- for (auto i=inv_perm.begin ();
100- i != inv_perm.end (); ++i)
101- cout << index_map[*i] << " " ;
98+ for (const auto & vertex : inv_perm)
99+ cout << index_map[vertex] << " " ;
102100 cout << endl;
103101
104102 for (size_type c = 0 ; c != inv_perm.size (); ++c)
@@ -115,9 +113,8 @@ int main(int , char* [])
115113
116114 cout << " Reverse Cuthill-McKee ordering:" << endl;
117115 cout << " " ;
118- for (auto i=inv_perm.begin ();
119- i != inv_perm.end (); ++i)
120- cout << index_map[*i] << " " ;
116+ for (const auto & vertex : inv_perm)
117+ cout << index_map[vertex] << " " ;
121118 cout << endl;
122119
123120 for (size_type c = 0 ; c != inv_perm.size (); ++c)
0 commit comments