-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclustering_defs.h
74 lines (56 loc) · 1.77 KB
/
clustering_defs.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
68
69
70
71
72
73
74
#ifndef CLUSTERING_DEFS_H
#define CLUSTERING_DEFS_H
#define CLUSTER_CF_TYPE_UNUSED 0
#define CLUSTER_CF_TYPE_ROOT 1
#define CLUSTER_CF_TYPE_NODE 2
// a LEAF node has leaves
#define CLUSTER_CF_TYPE_LEAF 3
#define CLUSTER_CF_TYPE_LEAFNODE 4
// CF needs to be recomputed
#define CLUSTER_CF_STATUS_UPDATE 0x0001
#define CLUSTER_CF_STATUS_COMPUTE 0x0002
#define CLUSTER_CF_STATUS_CREATE 0x0004
// cluster feature
typedef struct
{
// see CLUSTER_CF_TYPE defines
int type;
int level; // 0 for root
int NBchild;
// child index, -1 if no child
long *childindex;
int NBleaf;
long *leafindex;
// index of parent. -1 if no parent
long parentindex;
long N; // number of points aggregated in node
double *datasumvec; // sum
long double datassq; // sum squared
long double sum2; // square norm of sumvec
double radius2; // square cluster radius
uint32_t status; // check status flag
} CLUSTERING_CF;
typedef struct
{
long npix;
int B; // branching parameter
int L; // max number of leafs in leaf node
double T; // threshold
long NBCF; // number of cluster features in memory
CLUSTERING_CF *CFarray; // pointer to cluster features
long rootindex;
// correction for uncorrelated noise
double noise2offset;
// characteristic distance
// updated as distances are computed
// used to define meaningful threshold value
double cdist;
double minnoise2;
long long cdistcnt; // number of distance computation
long long cdistnegcnt; // number of neg distance
long nbnode;
long nbleafnode;
long nbleaf;
long nbleafsingle;
} CLUSTERTREE;
#endif