@@ -57,8 +57,8 @@ int main(int, char*[])
57
57
Pair (6 , 7 ) }; // g-h
58
58
59
59
Graph G (10 );
60
- for (int i = 0 ; i < 14 ; ++i )
61
- add_edge (edges[i] .first , edges[i] .second , G);
60
+ for (auto const & edge : edges )
61
+ add_edge (edge .first , edge .second , G);
62
62
63
63
graph_traits< Graph >::vertex_iterator ui, ui_end;
64
64
@@ -79,8 +79,8 @@ int main(int, char*[])
79
79
get (vertex_degree, G));
80
80
cout << " Reverse Cuthill-McKee ordering starting at: " << s << endl;
81
81
cout << " " ;
82
- for (auto i = inv_perm. begin (); i != inv_perm. end (); ++i )
83
- cout << index_map[*i ] << " " ;
82
+ for (auto const & vertex : inv_perm)
83
+ cout << index_map[vertex ] << " " ;
84
84
cout << endl;
85
85
86
86
for (size_type c = 0 ; c != inv_perm.size (); ++c)
@@ -98,8 +98,8 @@ int main(int, char*[])
98
98
get (vertex_degree, G));
99
99
cout << " Reverse Cuthill-McKee ordering starting at: " << s << endl;
100
100
cout << " " ;
101
- for (auto i = inv_perm. begin (); i != inv_perm. end (); ++i )
102
- cout << index_map[*i ] << " " ;
101
+ for (auto const & vertex : inv_perm)
102
+ cout << index_map[vertex ] << " " ;
103
103
cout << endl;
104
104
105
105
for (size_type c = 0 ; c != inv_perm.size (); ++c)
@@ -118,8 +118,8 @@ int main(int, char*[])
118
118
119
119
cout << " Reverse Cuthill-McKee ordering:" << endl;
120
120
cout << " " ;
121
- for (auto i = inv_perm. begin (); i != inv_perm. end (); ++i )
122
- cout << index_map[*i ] << " " ;
121
+ for (auto const & vertex : inv_perm)
122
+ cout << index_map[vertex ] << " " ;
123
123
cout << endl;
124
124
125
125
for (size_type c = 0 ; c != inv_perm.size (); ++c)
0 commit comments