forked from dacapo1142/clustering-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfastunfolding.cpp
30 lines (29 loc) · 974 Bytes
/
fastunfolding.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
#include "clusters.hpp"
#include <chrono>
#include <fstream>
#include <iostream>
using namespace std;
using namespace std::chrono;
int main(int argc, char *argv[]) {
const char *filename = argv[1];
size_t n = atoi(argv[2]);
const char *time_filename = argv[3];
ifstream file(filename);
ofstream metadata(time_filename);
Clusters clusters(n, n, file, Clusters::InputFormat::TWO_COLOUMN);
file.close();
high_resolution_clock::time_point t1 = high_resolution_clock::now();
clusters.routine();
high_resolution_clock::time_point t2 = high_resolution_clock::now();
duration<double> time_span = duration_cast<duration<double>>(t2 - t1);
metadata << time_span.count() << endl;
metadata.close();
clusters.print_communities();
ofstream file_size(argv[4]);
ofstream file_iter(argv[5]);
clusters.print_size(file_size);
clusters.print_iter(file_iter);
file_size.close();
file_iter.close();
return 0;
}