-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathconvert.cu
More file actions
31 lines (23 loc) · 722 Bytes
/
convert.cu
File metadata and controls
31 lines (23 loc) · 722 Bytes
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
#include "local_graph.hpp"
using namespace std;
using namespace hygraph;
int main(int argc, char *argv[]) {
LocalGraph<vid_t, empty_t> lg;
if (argc < 3) {
cerr << "usage: " << argv[0] << " <input file> <output file>" << endl;
return EXIT_FAILURE;
}
string in_file = string(argv[1]);
string out_file = string(argv[2]);
if (!load_from_file(lg, in_file)) {
cerr << "error: failed to read input file" << endl;
return EXIT_FAILURE;
}
lg.sort_edges();
lg.remove_duplicate_edges();
if (!write_to_binary_file(lg, out_file)) {
cerr << "error: failed to write output file" << endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}