COIN-OR::LEMON - Graph Library

Changeset 701:c03e073b8394 in lemon-0.x for src/work/deba/main.cpp


Ignore:
Timestamp:
07/14/04 12:06:27 (19 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@952
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/work/deba/main.cpp

    r698 r701  
    1212    ListGraph::Node node = g.addNode();
    1313  }
    14   ListGraph::NodeMap<int> map(g);
     14  ListGraph::NodeMap<int> map(g, 10);
    1515  for (int i = 0; i < 10; ++i) {
    1616    ListGraph::Node node = g.addNode();
     
    2020    cout << map[it] << endl;
    2121  }
     22  ListGraph::NodeMap<int>::iterator pit;
     23  for (pit = map.begin(); pit != map.end(); ++pit) {
     24    cout << g.id(pit->first) << ' ' << pit->second << endl;
     25  }
     26  ListGraph::NodeMap<double> ot_map = map;
     27  for (ListGraph::NodeIt it(g); g.valid(it); g.next(it)) {
     28    ot_map[it] *= 2.1;
     29    cout << ot_map[it] << endl;
     30  }
     31  ot_map = map;
     32  for (ListGraph::NodeIt it(g); g.valid(it); g.next(it)) {
     33    ot_map[it] *= 3.1;
     34    cout << ot_map[it] << endl;
     35  }
    2236  return 0;
    2337}
Note: See TracChangeset for help on using the changeset viewer.