scipy.spatial.KDTree 和 scipy.spatial.cKDTree 的区别 [英] Difference between scipy.spatial.KDTree and scipy.spatial.cKDTree
问题描述
这两种算法有什么区别?
What is the difference between these two algorithms?
推荐答案
cKDTree 是 KDTree,用 C++ 实现,封装在 Cython 中,因此速度更快.
cKDTree is a subset of KDTree, implemented in C++ wrapped in Cython, so therefore faster.
每一个都是
一个二叉树,每个节点代表一个轴对齐的超矩形.每个节点指定一个轴,并根据点沿该轴的坐标是大于还是小于特定值来分割点集.
a binary trie, each of whose nodes represents an axis-aligned hyperrectangle. Each node specifies an axis and splits the set of points based on whether their coordinate along that axis is greater than or less than a particular value.
但是 KDTree
还支持所有邻居查询,包括点数组和其他 kd 树.这些确实使用了相当有效的算法,但 kd-tree 不一定是此类计算的最佳数据结构.
also supports all-neighbors queries, both with arrays of points and with other kd-trees. These do use a reasonably efficient algorithm, but the kd-tree is not necessarily the best data structure for this sort of calculation.
这篇关于scipy.spatial.KDTree 和 scipy.spatial.cKDTree 的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!