-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathdebug.cpp
More file actions
58 lines (33 loc) · 750 Bytes
/
debug.cpp
File metadata and controls
58 lines (33 loc) · 750 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#include <iostream>
#include <chrono>
#include <cstdlib>
#include "dynamic/dynamic.hpp"
using namespace std;
using namespace dyn;
int main() {
dyn::succinct_spsi spsi;
dyn::spsi_check<> check;
int n=100000;
int sigma=120;
srand(time(NULL));
for(int i=0;i<n;++i){
cout << "insert number " << i << endl;
int j = rand()%(i+1);
int x = rand()%sigma;
spsi.insert(j,x);
check.insert(j,x);
}
for(int i=0;i<n;++i){
assert(spsi[i]==check[i]);
}
for(int i=0;i<n/2;++i){
cout << "remove number " << i << endl;
int j = rand()%spsi.size();
spsi.remove(j);
check.remove(j);
}
for(int i=0;i<spsi.size();++i){
assert(spsi[i]==check[i]);
}
return 0;
}