Exemplo n.º 1
0
 def init_from_tree(tree, data, query_points, heap, rng_state):
     for i in range(query_points.shape[0]):
         indices = search_flat_tree(
             query_points[i],
             tree.hyperplanes,
             tree.offsets,
             tree.children,
             tree.indices,
             rng_state,
         )
Exemplo n.º 2
0
    def init_from_tree(tree, data, query_points, heap, rng_state):
        for i in range(query_points.shape[0]):
            indices = search_flat_tree(
                query_points[i],
                tree.hyperplanes,
                tree.offsets,
                tree.children,
                tree.indices,
                rng_state,
            )

            for j in range(indices.shape[0]):
                if indices[j] < 0:
                    continue
                d = dist(data[indices[j]], query_points[i], *dist_args)
                heap_push(heap, i, d, indices[j], 1)

        return