All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
METISParser.h
Go to the documentation of this file.
1 /*
2  * METISParser.h
3  *
4  * Created on: 27.11.2012
5  * Author: Christian Staudt (christian.staudt@kit.edu)
6  */
7 
8 #ifndef METISPARSER_H_
9 #define METISPARSER_H_
10 
11 #include <fstream>
12 #include <vector>
13 #include <string>
14 #include <tuple>
15 #include "../Globals.h"
16 
17 namespace NetworKit {
18 
23 class METISParser {
24 
25 protected:
26 
27  std::ifstream graphFile;
28 
29 
30 public:
36  METISParser(std::string path);
37 
38 
42  std::tuple<count, count, index, count> getHeader();
43 
47  bool hasNext();
48 
54  std::vector<node> getNext(count ignoreFirst = 0);
55 
61  std::vector<std::pair<node,double>> getNextWithWeights(count ignoreFirst = 0);
62 
63 };
64 } /* namespace NetworKit */
65 #endif /* METISPARSER_H_ */
std::ifstream graphFile
Definition: METISParser.h:27
bool hasNext()
Test if graph file has a next line.
Definition: METISParser.cpp:141
std::vector< node > getNext(count ignoreFirst=0)
Get adjacencies from the next line in the METIS graph file.
Definition: METISParser.cpp:147
Parser for the METIS file format.
Definition: METISParser.h:23
uint64_t count
Definition: Globals.h:21
std::vector< std::pair< node, double > > getNextWithWeights(count ignoreFirst=0)
Get adjacencies with edge weights from the next line in the METIS graph file.
Definition: METISParser.cpp:168
METISParser(std::string path)
Constructor for the METIS Parser.
Definition: METISParser.cpp:89
std::tuple< count, count, index, count > getHeader()
Get the METIS graph file header.
Definition: METISParser.cpp:97