-
Notifications
You must be signed in to change notification settings - Fork 0
/
FileMetadata.cpp
125 lines (109 loc) · 4.02 KB
/
FileMetadata.cpp
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
/*
* File: FileSettings.cpp
* Author: RM
*
* Created on 29. Juli 2013, 22:34
*/
#include "FileMetadata.h"
FileMetadata::FileMetadata()
{
}
FileMetadata::FileMetadata (string inputPath, FileMetadataConstants::DataFileType fileType, uint sizeEstimation)
: _inputPath(inputPath), _fileType(fileType), _sizeEstimation(sizeEstimation)
{
}
FileMetadata::FileMetadata(const FileMetadata& orig)
{
}
FileMetadata::~FileMetadata()
{
}
string& FileMetadata::inputPath()
{
return _inputPath;
}
string& FileMetadata::fileName()
{
return _fileName;
}
FileMetadataConstants::DataFileType& FileMetadata::fileType()
{
return _fileType;
}
FileMetadataConstants::FileSpecification& FileMetadata::fileSpecification()
{
return _fileSpecification;
}
uint& FileMetadata::sizeEstimation()
{
return _sizeEstimation;
}
bool& FileMetadata::hasNativeEdgeWeights()
{
return _hasNativeEdgeWeights;
}
bool& FileMetadata::isDirected()
{
return _isDirected;
}
void FileMetadata::loadSettings(FileMetadataConstants::FileSpecification fileSpecification)
{
switch (fileSpecification) {
// --- Settings for Epinions ---
// Source: http://snap.stanford.edu/data/soc-Epinions1.html
case FileMetadataConstants::EPINIONS_F:
_inputPath = "../resources/Epinions/soc-Epinions1_inverted.txt";
_fileName = "Epinions";
_fileType = FileMetadataConstants::SNAP;
_fileSpecification = FileMetadataConstants::EPINIONS_F;
_sizeEstimation = 75879;
// Total edge count: 508837
_averageEdgeCount = 508837 / _sizeEstimation;
_hasNativeEdgeWeights = false;
_isDirected = true;
break;
// -----------------------------
// --- Settings for Slashdot ---
// Source: http://snap.stanford.edu/data/soc-Slashdot0902.html
case FileMetadataConstants::SLASHDOT_F:
_inputPath = "../resources/Slashdot/Slashdot0902_inverted.txt";
_fileName = "Slashdot0902";
_fileType = FileMetadataConstants::SNAP;
_fileSpecification = FileMetadataConstants::SLASHDOT_F;
_sizeEstimation = 82168;
// Total edge count: 948464
_averageEdgeCount = 948464 / _sizeEstimation;
_hasNativeEdgeWeights = false;
_isDirected = true;
break;
// -----------------------------
// --- Settings for ADVOGATO ---
// Source: http://konect.uni-koblenz.de/networks/advogato
case FileMetadataConstants::ADVOGATO_F:
_inputPath = "../resources/Advogato/out.advogato_inverted_weighted";
_fileName = "Advogato";
_fileType = FileMetadataConstants::ADVOGATO;
_fileSpecification = FileMetadataConstants::ADVOGATO_F;
_sizeEstimation = 6551;
// Total edge count: 51332
_averageEdgeCount = 51332 / _sizeEstimation;
_hasNativeEdgeWeights = true;
_isDirected = true;
break;
// -----------------------------
// --- Settings for DBLP ---
// Source: http://konect.uni-koblenz.de/networks/dblp_coauthor
case FileMetadataConstants::DBLP_F:
_inputPath = "../resources/DBLP/text/out.dblp_coauthor_inverted_reduced_weighted";
_fileName = "DBLP";
_fileType = FileMetadataConstants::DBLP;
_fileSpecification = FileMetadataConstants::DBLP_F;
_sizeEstimation = 1248427;
// Total edge count: 17631144
_averageEdgeCount = 17631144 / _sizeEstimation;
_hasNativeEdgeWeights = true;
_isDirected = false;
break;
// -----------------------------
}
}