include include tests unistring_test include include suffix_tree suffi

 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
52
53
#include "../../include/tests/unistring_test.h"
#include "../../include/suffix_tree/suffix_array.h"
#include "../../include/search/search.h"
#include <stdlib.h>
int main() {
//printf("begin\n");
search_test();
/*
text *txt = test_read_text("test_banana.txt");
printf("Just go!\n");
//test_substr(unisequences);
//test_slices(unisequences);
//printf("%p, %ld\n", (txt->sequences), txt->text_length);
printf("max sym value for text is %d\n", txt->max_symbol_value);
auto container = new ConcatenatedUnistringContainer(*(txt->sequences), txt->text_length);
//printf("123\n");
//long test_array[] = {3, 8, 6, 4, 2, 5, 9, 0, 7, 1};
//std::vector<long> test_rmq = std::vector<long>(test_array, test_array + sizeof(test_array)/sizeof(long));
//SparseTable<long> st = SparseTable<long>(test_rmq);
auto permutation = container->suffixArray();
//std::cout << "permutation:\n[";
//for (auto i = permutation->begin(), end = permutation->end(); i != end; i++) {
// std::cout << (*i) << " ";
//}
//std::cout << "]" << std::endl;
/*long a;
long b;
while (1) {
std::cout << "Input i and j:" << std::endl;
scanf("%ld", &a);
scanf("%ld", &b);
//std::cout << "in [ ";
//for (int i = a; i <= b; i++) std::cout << test_array[i] << " ";
//std::cout << "]" << std::endl;
std::cout << "rmq is " << container->LCP(a, b) << std::endl;
}*/
//for (int i = 0, len = txt->sequences->size(); i < len; i++) {
// delete (*(txt->sequences))[i];
//}
//delete txt->sequences;
/*
delete txt;
delete permutation;
delete container;
*/
return 0;
}