COIN-OR::LEMON - Graph Library

Changeset 279:be43902fadb7 in lemon-0.x for src/work/iterator_bfs_demo.cc


Ignore:
Timestamp:
04/03/04 16:22:33 (17 years ago)
Author:
marci
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@393
Message:

minor changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/work/iterator_bfs_demo.cc

    r265 r279  
    3434  typedef Graph::Node Node;
    3535  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;
    4136 
    4237  Graph G;
     
    10095   
    10196    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)) {
    10598      cout << node_name.get(n) << ": ";
    10699      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))
    108101        cout << edge_name.get(e) << " ";
    109102      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))
    111104        cout << edge_name.get(e) << " ";
    112105      cout << endl;
     
    178171   
    179172    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)) {
    181174      cout << node_name.get(n) << ": ";
    182175      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))
    184177        cout << edge_name.get(e) << " ";
    185178      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))
    187180        cout << edge_name.get(e) << " ";
    188181      cout << endl;
     
    254247   
    255248    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)) {
    257250      cout << node_name.get(n) << ": ";
    258251      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))
    260253        cout << edge_name.get(e) << " ";
    261254      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))
    263256        cout << edge_name.get(e) << " ";
    264257      cout << endl;
Note: See TracChangeset for help on using the changeset viewer.