src/work/deba/graph_io_test.cc
changeset 1284 b941d044f87b
parent 1115 444f69240539
equal deleted inserted replaced
3:a410d17efa3b 4:041770294242
     1 #include <lemon/smart_graph.h>
     1 #include <lemon/smart_graph.h>
     2 
     2 
     3 #include "map_utils.h"
     3 #include <lemon/map_utils.h>
     4 
     4 
     5 
     5 #include <lemon/graph_reader.h>
     6 #include "graph_reader.h"
     6 #include <lemon/graph_writer.h>
     7 #include "graph_writer.h"
       
     8 
     7 
     9 #include <iostream>
     8 #include <iostream>
    10 #include <fstream>
     9 #include <fstream>
    11 
    10 
    12 using namespace std;
    11 using namespace std;
    39   
    38   
    40   SmartGraph::Edge newedge;
    39   SmartGraph::Edge newedge;
    41   reader.addEdge("newedge", newedge);
    40   reader.addEdge("newedge", newedge);
    42 
    41 
    43   try {
    42   try {
    44     reader.read();
    43     reader.run();
    45   } catch (IOException& e) {
    44   } catch (IOError& e) {
    46     cerr << e.what() << endl;
    45     cerr << e.what() << endl;
    47   } catch (Exception e) {
    46   } catch (Exception e) {
    48     cerr << e.what() << endl;
    47     cerr << e.what() << endl;
    49   }
    48   }
    50 
    49 
    76   writer.addEdgeMap("id", edge_ids);
    75   writer.addEdgeMap("id", edge_ids);
    77   writer.addEdgeMap("chars", mmap);
    76   writer.addEdgeMap("chars", mmap);
    78   
    77   
    79   writer.addNode("source", node_ids.inverse()[3]);
    78   writer.addNode("source", node_ids.inverse()[3]);
    80   //  writer.addEdge("elek", edge_ids.inverse()[6]);
    79   //  writer.addEdge("elek", edge_ids.inverse()[6]);
    81   writer.write();
    80   writer.run();
    82   
    81   
    83   return 0;
    82   return 0;
    84 }
    83 }