-
Notifications
You must be signed in to change notification settings - Fork 0
/
box.h
44 lines (33 loc) · 787 Bytes
/
box.h
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
#define PAGE_SIZE 4096
#include <random>
#include <ctime>
#include <functional>
#include <chrono>
using namespace std;
typedef unsigned long long ULL;
class random_box {
public:
uniform_int_distribution<int>* bit;
uniform_real_distribution<double>* U_R_D;
normal_distribution<double>* N_R_D;
uniform_int_distribution<int>* U_I_D;
normal_distribution<double>* N_I_D;
double ent;
ULL NR_PAGE;
random_box(double, ULL);
int getNumber(void);
double getEntropy(int);
int getIndex(int);
};
class data_box {
public:
unsigned char** buf;
ULL* dup_idx;
ULL NR_PAGE;
data_box(double, ULL);
int genData( random_box&, int mode);
void init_dupIdx(void);
void cLeftShift(int ,int,int);
void cRightShift(int,int, int);
};
double Rounding(double, int);