-
Notifications
You must be signed in to change notification settings - Fork 0
/
InputManagement.h
87 lines (73 loc) · 2.04 KB
/
InputManagement.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/*
* File: InputManagement.h
* Author: RM
*
* Created on 26. Juli 2013, 22:46
*/
#ifndef INPUTMANAGEMENT_H
#define INPUTMANAGEMENT_H
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <iterator>
#include <string>
#include <cstdlib>
#include <time.h>
#include <utility>
#include "Definitions.h"
#include "Graph.h"
#include "Edge.h"
#include "Vertex.h"
#include "FileMetadata.h"
class InputManagement
{
public:
InputManagement();
InputManagement(const InputManagement& orig);
virtual ~InputManagement();
/**
*
* @param inputPath
* @param fileType
* @param graph
* @return
*/
static int parseInputFile(string inputPath, FileMetadataConstants::DataFileType fileType, Graph& graph);
/**
* Preprocesses raw KONECT-DBLP data (sorts and weigts edges, removes
* unnecessary data).
* Writes processed data in new file.
* @param inputPath Raw KONECT-DBLP data.
* @param outputPath File for preprocessed data.
*/
static void prepareDBLP(string inputPath, string outputPath);
private:
/* --- Variables --- */
// Defines number of different random values to be created for
// assignment to edge weights of SNAP datasets.
static const uint SNAP_MAX_NUMBER_OF_EDGE_WEIGHTS = 1000;
/* --- Methods --- */
/**
*
* @param inputPath
* @param graph
* @return
*/
static uint parseSNAPFile(ifstream& inputFile, Graph& graph);
/**
*
* @param inputFile
* @param graph
* @return
*/
static uint parseDBLPFile(ifstream& inputFile, Graph& graph);
/**
*
* @param inputFile
* @param graph
* @return
*/
static uint parseADVOGATOFile(ifstream& inputFile, Graph& graph);
};
#endif /* INPUTMANAGEMENT_H */