Commit 00be98d2 authored by Julien Jerphanion's avatar Julien Jerphanion

[DEBUG] Query

parent 5951d2e3
......@@ -518,6 +518,13 @@ cdef cypclass Node activable:
cdef cypclass QueryActor:
I_t idx_worker
I_t idx_start
I_t idx_end
KDTree tree
D_t * query_points
NeighborsHeaps heaps
__init__(
self,
D_t * query_points,
......@@ -527,16 +534,23 @@ cdef cypclass QueryActor:
I_t idx_start,
I_t idx_end,
):
printf("QueryActor: (%d, %d, %d)\n", idx_worker, idx_start, idx_end)
cdef I_t idx_pt
cdef D_t * query_point
cdef D_t reduced_dist_LB
self.idx_worker = idx_worker
self.idx_start = idx_start
self.idx_end = idx_end
self.tree = tree
self.query_points = query_points
self.heaps = heaps
int query(self) except -1:
cdef:
I_t idx_pt
D_t * query_point
D_t reduced_dist_LB
for idx_pt in range(idx_start, idx_end):
printf("query %d\n", idx_pt)
query_point = query_points + idx_pt * tree._n_features
reduced_dist_LB = tree.min_rdist(0, query_point)
self._query_single_depthfirst(tree, 0, query_points, idx_pt, heaps, reduced_dist_LB)
query_point = self.query_points + idx_pt * self.tree._n_features
reduced_dist_LB = self.tree.min_rdist(0, query_point)
self._query_single_depthfirst(self.tree, 0, self.query_points, idx_pt, self.heaps, reduced_dist_LB)
int _query_single_depthfirst(self,
KDTree tree,
......@@ -736,6 +750,7 @@ cdef cypclass KDTree:
n_points_worker * idx_worker,
min(n_points_worker * (idx_worker + 1), n_query),
)
query_actor.query()
heaps.sort()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment