-
Notifications
You must be signed in to change notification settings - Fork 0
/
kd.h
67 lines (51 loc) · 1.37 KB
/
kd.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
67
//this is the 27 February 2012 rewrite
class kd_tree{
private:
int **tree;
int masterparent;
int room,roomstep;
double tol;
int ncube,callcubes;
int nkernel;
void confirm(int,int,int,int);
void organize(int*,int,int,int,int);
int find_node(double*);
void neigh_check(double*,int,int*,double*,int,int);
void kernel_check(double*,double*,int*,int,int);
void reassign(int);
void descend(int);
public:
int dim,pts,diagnostic,xplr,ktests;
int **cdex;
double **cubecenter,*cubevol,**cubemax,**cubemin;
int **cube_mindex,**cube_maxdex;
double **data,*maxs,*mins;
kd_tree(int,int,double**,double*,double*);
~kd_tree();
void check_tree(int);
double distance(double*,double*);
void find_cubes();
void write_tree(char*);
void add(double*);
void remove(int);
void count(int,int*);
void nn_srch(double*,int,int*,double*);
int kernel_srch(double*,double*,int*);
};
class kd_cube{
private:
int dim,pts,*inn,*icalled,ocalled,ocalled1,nhack,zeroct;
int *priority;
double **minbound,**maxbound,*tosort;
double avict;
double *mins,*maxs;
double *center,*range;
void organize(int,int,double**,int,double*);
public:
int varswitch;
~kd_cube();
kd_cube(int,int,double**,double*,double*,double*,int,int*);
double pmin(int,int);
double pmax(int,int);
void picalled();
};