graph_to_eps mission accomplished.
- lemon/graph_to_eps.h header created
- lemon/bezier.h: Tools to compute with bezier curves (unclean and undocumented
interface, used internally by graph_to_eps.h)
- demo/graph_to_eps_demo.cc: a simple demo for lemon/graph_to_eps.h
8 template<typename Graph>
9 void LoadGraph(Graph &G, char *filename) {
11 if ((file = fopen(filename, "r")) == NULL) {
12 printf("Could not open %s\n", filename);
16 std::map<int, typename Graph::NodeIt> nmap;
18 while (fgets(line, LINE_LEN, file)) {
21 nmap[atoi(line + 1)] = G.addNode();
26 while (isspace(line[i])) i++;
27 while (isdigit(line[i])) i++;
29 if (nmap.find(n1) == nmap.end()) {
30 nmap[n1] = G.addNode();
32 if (nmap.find(n2) == nmap.end()) {
33 nmap[n2] = G.addNode();
35 G.addEdge(nmap[n1], nmap[n2]);