-
Notifications
You must be signed in to change notification settings - Fork 0
/
STIG.h
66 lines (59 loc) · 1.39 KB
/
STIG.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
66
#pragma once
#include "ConstDefine.h"
#include "MBB.h"
#include "Trajectory.h"
#include <algorithm>
#include <vector>
typedef struct STIGBlock{
int startIdx;
int endIdx;
}STIGBlock;
class STIGNode
{
public:
STIGNode();
int depth;
};
class InternalNode: public STIGNode
{
public:
InternalNode();
int dim;
float medium;
bool leftIsLeaf;
bool rightIsLeaf;
void* left;
void* right;
};
class LeafNode: public STIGNode
{
public:
LeafNode();
MBB boundingBox;
int leftRange, rightRange;
};
class STIG
{
public:
STIG();
// ¶àGPU²éѯÓÃ
void* baseAddrGPU[2];
void* stateTableGPU[2];
// ¶àGPU²éѯÓÃ
void *root;
int totalDim;
int totalPointsNum;
std::vector<SPoint> allPoints;
int depth;
int blockSize;
int maxTid;
int initial(int blockSize, int totalDim, Trajectory* db, int trajNum);
int createIndex(LeafNode* parent, int depth, int startIdx, int endIdx);
int createIndex(InternalNode* parent, int depth, int startIdx, int endIdx);
int destroyIndex();
int searchTree(MBB queryMBB, std::vector<STIGBlock> *allCandBlocks);
int searchNode(MBB queryMBB, std::vector<STIGBlock> *allCandBlocks, InternalNode* node);
int searchNode(MBB queryMBB, std::vector<STIGBlock> *allCandBlocks, LeafNode* node);
int rangeQueryGPU(MBB *bounds, int rangeNum, CPURangeQueryResult *ResultTable, int *resultSetSize, int device_idx);
static bool intersectBlock(float amin, float amax, float bmin, float bmax);
};