Changeset 279:be43902fadb7 in lemon0.x for src/work/iterator_bfs_demo.cc
 Timestamp:
 04/03/04 16:22:33 (20 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@393
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

src/work/iterator_bfs_demo.cc
r265 r279 34 34 typedef Graph::Node Node; 35 35 typedef Graph::Edge Edge; 36 //typedef Graph::NodeIt NodeIt;37 //typedef Graph::EdgeIt EdgeIt;38 //typedef Graph::OutEdgeIt OutEdgeIt;39 //typedef Graph::InEdgeIt InEdgeIt;40 //typedef Graph::SymEdgeIt SymEdgeIt;41 36 42 37 Graph G; … … 100 95 101 96 cout << "bfs and dfs iterator demo on the directed graph" << endl; 102 for(GW::NodeIt n=gw.first<GW::NodeIt>(); 103 gw.valid(n); 104 gw.next(n)) { 97 for(GW::NodeIt n(gw); gw.valid(n); gw.next(n)) { 105 98 cout << node_name.get(n) << ": "; 106 99 cout << "out edges: "; 107 for(GW::OutEdgeIt e =gw.first<GW::OutEdgeIt>(n); gw.valid(e); gw.next(e))100 for(GW::OutEdgeIt e(gw, n); gw.valid(e); gw.next(e)) 108 101 cout << edge_name.get(e) << " "; 109 102 cout << "in edges: "; 110 for(GW::InEdgeIt e =gw.first<GW::InEdgeIt>(n); gw.valid(e); gw.next(e))103 for(GW::InEdgeIt e(gw, n); gw.valid(e); gw.next(e)) 111 104 cout << edge_name.get(e) << " "; 112 105 cout << endl; … … 178 171 179 172 cout << "bfs and dfs iterator demo on the reversed directed graph" << endl; 180 for(GW::NodeIt n =gw.first<GW::NodeIt>(); gw.valid(n); gw.next(n)) {173 for(GW::NodeIt n(gw); gw.valid(n); gw.next(n)) { 181 174 cout << node_name.get(n) << ": "; 182 175 cout << "out edges: "; 183 for(GW::OutEdgeIt e =gw.first<GW::OutEdgeIt>(n); gw.valid(e); gw.next(e))176 for(GW::OutEdgeIt e(gw, n); gw.valid(e); gw.next(e)) 184 177 cout << edge_name.get(e) << " "; 185 178 cout << "in edges: "; 186 for(GW::InEdgeIt e =gw.first<GW::InEdgeIt>(n); gw.valid(e); gw.next(e))179 for(GW::InEdgeIt e(gw, n); gw.valid(e); gw.next(e)) 187 180 cout << edge_name.get(e) << " "; 188 181 cout << endl; … … 254 247 255 248 cout << "bfs and dfs iterator demo on the undirected graph" << endl; 256 for(GW::NodeIt n =gw.first<GW::NodeIt>(); gw.valid(n); gw.next(n)) {249 for(GW::NodeIt n(gw); gw.valid(n); gw.next(n)) { 257 250 cout << node_name.get(n) << ": "; 258 251 cout << "out edges: "; 259 for(GW::OutEdgeIt e =gw.first<GW::OutEdgeIt>(n); gw.valid(e); gw.next(e))252 for(GW::OutEdgeIt e(gw, n); gw.valid(e); gw.next(e)) 260 253 cout << edge_name.get(e) << " "; 261 254 cout << "in edges: "; 262 for(GW::InEdgeIt e =gw.first<GW::InEdgeIt>(n); gw.valid(e); gw.next(e))255 for(GW::InEdgeIt e(gw, n); gw.valid(e); gw.next(e)) 263 256 cout << edge_name.get(e) << " "; 264 257 cout << endl;
Note: See TracChangeset
for help on using the changeset viewer.