1 |
#ifndef PMT_H |
2 |
#define PMT_H |
3 |
|
4 |
#include <GiSTlist.h> |
5 |
|
6 |
class MT; |
7 |
|
8 |
class PMT { |
9 |
MT *mt; |
10 |
|
11 |
public: // easier. I don't care anyways |
12 |
int ndims; |
13 |
double min; |
14 |
double max; |
15 |
double steps; |
16 |
|
17 |
double maxDist; |
18 |
int elemsize; |
19 |
|
20 |
public: |
21 |
PMT(int ndims, double min, double max, double steps); |
22 |
~PMT(); |
23 |
void create(const char *path); |
24 |
void open(const char *path); |
25 |
void insert(double *k, int data); |
26 |
double distance(double *k1, double *k2) const; |
27 |
void range(double *k, double r) const; |
28 |
void top(double *k, int n) const; |
29 |
int maxlevel() const; |
30 |
//bulkload(PKey *o, int count); |
31 |
}; |
32 |
|
33 |
#define ACC (current_pmt) |
34 |
#define NDIMS (ACC->ndims) |
35 |
|
36 |
extern const PMT *current_pmt; |
37 |
|
38 |
extern void add_result(int data, double *k, int ndims); |
39 |
|
40 |
#endif |