forked from gmgu/graph-analysis-tool
-
Notifications
You must be signed in to change notification settings - Fork 20
/
stat.cpp
38 lines (31 loc) · 976 Bytes
/
stat.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
#include "stat.h"
namespace snu {
bool Stat::getSuccess() {
return success;
}
void Stat::writeToHTML(FILE *fp, bool directed) {
if (success)
writeToHTMLStat(fp, directed);
else
fprintf(stderr, "writeToHTML called on failed stat %s\n", statName().c_str());
}
bool Stat::writeToFile(std::string graph_name, bool directed) {
if (success)
return writeToFileStat(graph_name, directed);
else
fprintf(stderr, "writeToFile called on failed stat %s\n", statName().c_str());
return false;
}
bool CommonStat::calculate(Graph &graph, bool verify) {
success = calculateStat(graph, verify);
return success;
}
bool DirectedStat::calculateDirected(DSGraph &graph, bool verify) {
success = calculateDirectedStat(graph, verify);
return success;
}
bool UndirectedStat::calculateUndirected(USGraph &graph, bool verify) {
success = calculateUndirectedStat(graph, verify);
return success;
}
} // namespace snu