… | |
… | |
145 | Object o(k); |
145 | Object o(k); |
146 | Pred p(o); |
146 | Pred p(o); |
147 | SimpleQuery q(&p, r); |
147 | SimpleQuery q(&p, r); |
148 | GiSTlist<MTentry *> res = mt->RangeSearch(q); |
148 | GiSTlist<MTentry *> res = mt->RangeSearch(q); |
149 | |
149 | |
150 | while(!res.IsEmpty()) { |
150 | while(!res.IsEmpty()) |
|
|
151 | { |
151 | MTentry *e = res.RemoveFront (); |
152 | MTentry *e = res.RemoveFront (); |
152 | |
|
|
153 | add_result(e->Key()->distance, e->Ptr(), e->Key()->obj.data(), ndims); |
153 | add_result(e->Ptr(), e->Key()->obj.data(), ndims); |
154 | |
|
|
155 | delete e; |
154 | delete e; |
156 | } |
155 | } |
157 | } |
156 | } |
158 | |
157 | |
159 | void PMT::top(double *k, int n) const |
158 | void PMT::top(double *k, int n) const |
160 | { |
159 | { |
161 | abort (); |
160 | SETCUR; |
|
|
161 | Object o(k); |
|
|
162 | Pred p(o); |
|
|
163 | TopQuery q(&p, n); |
|
|
164 | MTentry **res = mt->TopSearch(q); |
|
|
165 | |
|
|
166 | for (int i=0; i < n; i++) |
|
|
167 | { |
|
|
168 | MTentry *e = res[i]; |
|
|
169 | add_result(e->Ptr(), e->Key()->obj.data(), ndims); |
|
|
170 | delete e; |
|
|
171 | } |
162 | } |
172 | } |
|
|
173 | |
|
|
174 | int PMT::maxlevel() const |
|
|
175 | { |
|
|
176 | SETCUR; |
|
|
177 | return mt->MaxLevel(); |
|
|
178 | } |