1 | #ifndef PMT_H |
1 | #ifndef PMT_H |
2 | #define PMT_H |
2 | #define PMT_H |
3 | |
3 | |
4 | #include <GiSTlist.h> |
4 | #include <GiSTlist.h> |
|
|
5 | |
|
|
6 | typedef unsigned long velem; |
5 | |
7 | |
6 | class MT; |
8 | class MT; |
7 | |
9 | |
8 | class PMT { |
10 | class PMT { |
9 | MT *mt; |
11 | MT *mt; |
… | |
… | |
14 | double max; |
16 | double max; |
15 | double steps; |
17 | double steps; |
16 | |
18 | |
17 | double maxDist; |
19 | double maxDist; |
18 | int elemsize; |
20 | int elemsize; |
|
|
21 | velem vzero; |
|
|
22 | |
|
|
23 | int distfast; // can distance be computed fast (integer arithmetic) |
|
|
24 | double distmul; // then use this corrective factor |
19 | |
25 | |
20 | public: |
26 | public: |
21 | PMT(int ndims, double min, double max, double steps); |
27 | PMT(int ndims, |
|
|
28 | double min, |
|
|
29 | double max, |
|
|
30 | double steps, |
|
|
31 | unsigned int pagesize); |
22 | ~PMT(); |
32 | ~PMT(); |
|
|
33 | void sync(); |
23 | void create(const char *path); |
34 | void create(const char *path); |
24 | void open(const char *path); |
35 | void open(const char *path); |
25 | void insert(double *k, int data); |
36 | void insert(double *k, int data); |
26 | double distance(double *k1, double *k2) const; |
37 | double distance(double *k1, double *k2) const; |
27 | void range(double *k, double r) const; |
38 | void range(double *k, double r) const; |