-
Notifications
You must be signed in to change notification settings - Fork 0
/
HEM5.h
65 lines (52 loc) · 2.09 KB
/
HEM5.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//#pragma once
#ifndef _REIN_BITS5_H
#define _REIN_BITS5_H
#include <cstring>
#include "Util.h"
#include "constant.h"
#include <algorithm>
#include <unordered_set>
#include <bitset>
#include "ThreadPool.h"
#define _for(i, a, b) for (int i = (a); i < (b); ++i)
#define __for(i, a, b) for (int i = (a); i <= (b); ++i)
#define mfor(i, a, b) for (int i = (a); i > (b); --i)
#define mmfor(i, a, b) for (int i = (a); i >= (b); --i)
// ??????
class HEM5
{
private:
int numSub, numDimension, buckStep, numBits;
vector<vector<vector<Combo>>> data[2]; // 0:left parenthesis, 1:right parenthesis
vector<vector<bitset<subs>>> bits[2]; // low/high -> attrNo -> bktID -> bitsetID for direct or reverse match process
vector<vector<int>> fix[2]; // 0??low????????1??high?????????????????????????
vector<bitset<subs>> fullBits; // ??????bits?????—¨??????????
int **endBucket[2], **bitsID[2]; // ???????bucket????????????????????bucket???????bits??????¡À?
bool **doubleReverse[2]; // ?true????1???0, DSS
ThreadPool threadPool;
public:
int numBucket;
double compareTime = 0.0; // ?????????????????????cell???????????????
double markTime = 0.0; // ??????
double orTime = 0.0; // ?????????
double bitTime = 0.0; // ????bits?????????????????
double mergeTime = 0.0;
// vector<unordered_set<int>> bucketSub; // id???????ݴ??????????????
HEM5(int type);
~HEM5();
void initBits(); // ???????????bits????
// void insert(Sub sub);
void insert(IntervalSub sub); // ???bitset????????
void insert_online(IntervalSub sub); // ????????????????????????
bool deleteSubscription(IntervalSub sub);
// void match(const Pub& pub, int& matchSubs, const vector<Sub>& subList);
void match(const Pub &pub, int &matchSubs);
void match_debug(const Pub &pub, int &matchSubs);
void match_parallel(const Pub &pub, int &matchSubs);
void match_avxOR_parallel(const Pub &pub, int &matchSubs);
// void calBucketSize(); // ????bucketSize
int calMemory(); // ???????????§³
void printRelation(int dimension_i); // ????????
vector<int> calMarkNumForBuckets(); // ???????????????????????????????????¦Í?????
};
#endif