All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
KONECTGraphReader.h
Go to the documentation of this file.
1 /*
2  * KONECTReader.h
3  *
4  */
5 
6 #ifndef KONECTGRAPHREADER_H_
7 #define KONECTGRAPHREADER_H_
8 
9 #include <fstream>
10 #include <iostream>
11 #include <string>
12 #include <unordered_map>
13 
14 
15 #include "GraphReader.h"
16 
17 namespace NetworKit {
18 
19 /*
20  * KONECTGraphReader.cpp
21  *
22  * Reader for the KONECT graph format,
23  * based on the EdgeListReader.
24  *
25  * The KONECT format is described in detail in
26  * http://konect.uni-koblenz.de/downloads/konect-handbook.pdf
27  */
29 
30 public:
31 
32  KONECTGraphReader() = default; //nullary constructor for Python shell
33 
38  KONECTGraphReader(char separator, bool ignoreLoops=false);
39 
45  Graph read(const std::string& path);
46 
47 
48 protected:
49  char separator;
50  std::string commentPrefix;
52  bool continuous;
53 // std::unordered_map<index,node> mapNodeIds;
55 
56 private:
57  Graph readContinuous(const std::string& path);
58 
59 };
60 
61 } /* namespace NetworKit */
62 #endif /* KONECTGRAPHREADER_H_ */
Abstract base class for graph readers.
Definition: GraphReader.h:21
char separator
character separating nodes in an edge line
Definition: KONECTGraphReader.h:49
bool continuous
Definition: KONECTGraphReader.h:52
bool ignoreLoops
Definition: KONECTGraphReader.h:54
std::string commentPrefix
Definition: KONECTGraphReader.h:50
Graph read(const std::string &path)
Given the path of an input file, read the graph contained.
Definition: KONECTGraphReader.cpp:26
index node
Definition: Globals.h:23
Definition: KONECTGraphReader.h:28
A graph (with optional weights) and parallel iterator methods.
Definition: Graph.h:79
node firstNode
Definition: KONECTGraphReader.h:51