Commit 228d5de5 authored by Julien Jerphanion's avatar Julien Jerphanion

Correct comments

parent bccfff3d
...@@ -76,7 +76,7 @@ cdef cypclass Counter activable: ...@@ -76,7 +76,7 @@ cdef cypclass Counter activable:
This can be useful for synchronisation for the caller after This can be useful for synchronisation for the caller after
triggering the actors logic as it wait for the value of triggering the actors logic as it wait for the value of
the Coutner to reach a given one before moving on. the Counter to reach a given one before moving on.
""" """
I_t _n I_t _n
...@@ -332,7 +332,7 @@ cdef cypclass NeighborsHeap activable: ...@@ -332,7 +332,7 @@ cdef cypclass NeighborsHeap activable:
cdef cypclass Node activable: cdef cypclass Node activable:
"""A KDTree Node """A KDTree Node
Node delegate tasks to their children Nodes. Node delegates tasks to their children Nodes.
Some Nodes are set as Leaves when they are associated Some Nodes are set as Leaves when they are associated
to ``leaf_size`` or less points. to ``leaf_size`` or less points.
...@@ -396,19 +396,19 @@ cdef cypclass Node activable: ...@@ -396,19 +396,19 @@ cdef cypclass Node activable:
if (end - start <= leaf_size): if (end - start <= leaf_size):
self._is_leaf = True self._is_leaf = True
# Adding to the global counter the number # Adding to the global counter the number
# of samples the leaf is responsible of # of samples the leaf is responsible of.
counter.add(NULL, end - start) counter.add(NULL, end - start)
return return
# We partition the samples in two nodes on a given dimension, # We partition the samples in two nodes on a given dimension,
# with the middle point as a pivot # with the middle point as a pivot.
partition_node_indices(data_ptr, indices_ptr, start, mid, end, dim, n_dims) partition_node_indices(data_ptr, indices_ptr, start, mid, end, dim, n_dims)
self._point = data_ptr + mid self._point = data_ptr + mid
self._left = consume Node() self._left = consume Node()
self._right = consume Node() self._right = consume Node()
# Recursing on both partition # Recursing on both partitions.
self._left.build_node(NULL, self._left.build_node(NULL,
data_ptr, indices_ptr, data_ptr, indices_ptr,
leaf_size, n_dims, next_dim, leaf_size, n_dims, next_dim,
...@@ -429,7 +429,7 @@ cdef cypclass Node activable: ...@@ -429,7 +429,7 @@ cdef cypclass Node activable:
D_t tmp D_t tmp
if self._is_leaf: if self._is_leaf:
# Computing all the euclideans distances here # Computing all the euclideans distances here.
for j in range(self._start, self._end): for j in range(self._start, self._end):
dist = 0 dist = 0
for k in range(self._n_dims): for k in range(self._n_dims):
...@@ -439,13 +439,13 @@ cdef cypclass Node activable: ...@@ -439,13 +439,13 @@ cdef cypclass Node activable:
) )
dist += tmp * tmp dist += tmp * tmp
# The heap is doing the smart work of keeping # The heap is responsible for keeping the closest
# the closest points for each query point i # points for each query point i.
heaps.push(NULL, i, dist, self._indices_ptr[j]) heaps.push(NULL, i, dist, self._indices_ptr[j])
return return
# TODO: one can implement a pruning strategy here # TODO: one can implement a pruning strategy here.
self._left.query(NULL, query_points, i, heaps) self._left.query(NULL, query_points, i, heaps)
self._right.query(NULL, query_points, i, heaps) self._right.query(NULL, query_points, i, heaps)
...@@ -509,7 +509,7 @@ cdef cypclass KDTree: ...@@ -509,7 +509,7 @@ cdef cypclass KDTree:
# When object are activated (set as Actors), methods # When object are activated (set as Actors), methods
# are reified. When using those reified methods # are reified. When using those reified methods
# a new argument is prepredend for a predicate, # a new argument is prepredend for a predicate,
# which we aren't using using here, hence the extra NULL. # which we aren't using here, hence the extra NULL.
# #
# Also using this separate method allowing using actors # Also using this separate method allowing using actors
# because __init__ can't be reified. # because __init__ can't be reified.
......
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