-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinsert_profiling.cpp
More file actions
48 lines (40 loc) · 1.16 KB
/
insert_profiling.cpp
File metadata and controls
48 lines (40 loc) · 1.16 KB
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
#include <algorithm>
#include <chrono>
#include <fstream>
#include <iostream>
#include <vector>
#include "ArtNode.h"
#include "Chain.h"
#include "Helper.h"
#include "trees/QuART_lil.h"
using namespace std;
template <typename key_type>
std::vector<key_type> read_bin(const char* filename) {
std::ifstream inputFile(filename, std::ios::binary);
inputFile.seekg(0, std::ios::end);
const std::streampos fileSize = inputFile.tellg();
inputFile.seekg(0, std::ios::beg);
std::vector<key_type> data(fileSize / sizeof(key_type));
inputFile.read(reinterpret_cast<char*>(data.data()), fileSize);
return data;
}
int main(int argc, char** argv) {
int N = 5000000; // optional argument
// Parse arguments; make sure to increment i by 2 if you consume an argument
for (int i = 1; i < argc;) {
if (string(argv[i]) == "-N") {
N = atoi(argv[i + 1]);
i += 2;
} else {
i++;
}
}
// Build tree
ART::QuART_lil* tree = new ART::QuART_lil();
for (int val = 1; val <= N; val++) {
uint8_t key[4];
ART::loadKey(val, key);
tree->insert(key, val);
}
return 0;
}