def search(self, point, count, radius, sort):
"""Retrieve the neighbours to a point."""
if count is None:
count = self._n
elif count < 1:
return numpy.empty(0, dtype=self._neighbour_dtype)
if radius is None:
radius = numpy.inf
elif radius < 0.0:
return numpy.empty(0, dtype=self._neighbour_dtype)
point = numpy.asarray(point, dtype=numpy.float_)
if count >= self._n:
return self._search_all_within_radius(point, radius, sort)
else:
return self._search_k_nearests(point, count, radius, sort)
评论列表
文章目录