5 #include <lemon/maps.h>
6 #include <lemon/error.h>
7 #include <lemon/list_graph.h>
8 #include <lemon/graph_reader.h>
9 #include <lemon/graph_utils.h>
11 using namespace lemon;
13 typedef ListGraph Graph;
14 typedef xy<double> Coordinates;
15 typedef Graph::NodeMap<Coordinates> CoordinatesMap;
16 typedef Graph::Node Node;
18 class CoordReaderMap: public MapBase<Node, double>
24 CoordReaderMap(char xory, CoordinatesMap * coordmap): cm(coordmap)
33 throw UninitializedParameter() ;
37 void set(Node node, double coord)
48 throw UninitializedParameter() ;
58 CoordReaderMap xreader('x',&cm);
59 CoordReaderMap yreader('y',&cm);
61 std::ifstream is("dijkstra_test.lemon");
63 GraphReader<Graph> reader(is, g);
64 reader.addNodeMap("coordinates_x", xreader);
65 reader.addNodeMap("coordinates_y", yreader);