_kdtree.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:hienoi 作者: christophercrouzet 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号