src/work/deba/graph_io_test.cc
changeset 1032 9e903d3a1ef6
child 1036 2f514b5c7122
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/work/deba/graph_io_test.cc	Wed Dec 08 20:54:26 2004 +0000
     1.3 @@ -0,0 +1,23 @@
     1.4 +#include <lemon/smart_graph.h>
     1.5 +#include <lemon/graph_reader.h>
     1.6 +
     1.7 +#include <iostream>
     1.8 +#include <fstream>
     1.9 +
    1.10 +using namespace std;
    1.11 +using namespace lemon;
    1.12 +
    1.13 +int main() {
    1.14 +  ifstream input("test.lgf");
    1.15 +  SmartGraph graph;
    1.16 +  GraphReader<SmartGraph> reader(input, graph);
    1.17 +  SmartGraph::NodeMap<int> cost(graph);
    1.18 +  reader.readNodeMap("cost", cost);
    1.19 +  SmartGraph::NodeMap<string> color(graph);
    1.20 +  reader.readNodeMap("color", color);
    1.21 +  reader.read();
    1.22 +  for (SmartGraph::NodeIt it(graph); it != INVALID; ++it) {
    1.23 +    cout << cost[it] << color[it] << endl;
    1.24 +  }
    1.25 +  return 0;
    1.26 +}