-
Notifications
You must be signed in to change notification settings - Fork 0
/
FVTable.h
49 lines (40 loc) · 1.2 KB
/
FVTable.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
#pragma once
#include "ConstDefine.h"
#include<map>
#include<vector>
#include <queue>
typedef struct FDwithID {
int traID;
int FD;
}FDwithID;
struct cmp {
bool operator()(FDwithID a, FDwithID b) {
return(a.FD > b.FD);
}
};
struct cmpBig {
bool operator()(FDwithID a, FDwithID b) {
return(a.FD < b.FD);
}
};
class FVTable
{
public:
std::vector<std::map<int, int>> FreqVector;
int trajNum;
int cellNum;
void *FVTableGPU, *FVinfoGPU,*queryFVGPU,*FVTableOffset,*FDresultsGPU,*SubbedArrayGPU,*SubbedArrayOffsetGPU;
int SubbedArrayJump = 0;
size_t pitch;
int nonZeroFVNum = 0;
int initFVTable(int trajNum, int cellNum);
int addPointToFVTable(int trajID, int pointNum, int cellID);
int getCandidate(int lowerBound, int k, std::map<int, int>* freqVectorQ, int *candidateTrajID, int *candidateNum);
double calculateFreqDist(int *freqVectorQ, int trajID);
int findNeighbor(int cellID, int* neighborID);
int formPriorityQueue(std::priority_queue<FDwithID, std::vector<FDwithID>, cmp> *queue, std::map<int, int>* freqVectorQ);
int transferFVtoGPU();
int formPriorityQueueGPU(std::priority_queue<FDwithID, std::vector<FDwithID>, cmp> *queue, std::map<int, int>* freqVectorQ);
FVTable();
~FVTable();
};