-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwt.cpp
51 lines (40 loc) · 1022 Bytes
/
wt.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
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<string>
#include "wavelet_tree.h"
int main(int argc, char *argv[])
{
if(argc < 2)
{
puts("Invalid command.");
exit(1);
}
if(!strcmp(argv[1], "build"))
{
std::string inputFile(argv[2]);
std::string outputFile(argv[3]);
wavelet_tree(inputFile, outputFile);
}
else if(!strcmp(argv[1], "access"))
{
std::string wtFile(argv[2]);
std::string indicesFile(argv[3]);
wavelet_tree::access_queries(wtFile, indicesFile);
}
else if(!strcmp(argv[1], "rank"))
{
std::string wtFile(argv[2]);
std::string queriesFile(argv[3]);
wavelet_tree::rank_queries(wtFile, queriesFile);
}
else if(!strcmp(argv[1], "select"))
{
std::string wtFile(argv[2]);
std::string queriesFile(argv[3]);
wavelet_tree::select_queries(wtFile, queriesFile);
}
else
puts("Invalid command.");
return 0;
}