[Scipy-tickets] [SciPy] #1834: KDTree.sparse_distance_matrix does not handle elements at 0 distance well
SciPy Trac
scipy-tickets@scipy....
Thu Jan 31 15:48:35 CST 2013
#1834: KDTree.sparse_distance_matrix does not handle elements at 0 distance well
---------------------------------------------+------------------------------
Reporter: demianw | Owner: warren.weckesser
Type: defect | Status: new
Priority: normal | Milestone: Unscheduled
Component: scipy.spatial | Version: 0.11.0
Keywords: sparse, distance_matrix, kdtree |
---------------------------------------------+------------------------------
With the current implementation it is impossible to know in the
sparse_distance_matrix whether the distance between two elements is 0
because they are exactly at the same position or out of the range of the
maximal distance
>>> points = c_[arange(5), zeros(5)]
>>> t1 = spatial.KDTree(points)
>>> t1.sparse_distance_matrix(t1, 1).todense()
matrix([[ 0., 1., 0., 0., 0.],
[ 1., 0., 1., 0., 0.],
[ 0., 1., 0., 1., 0.],
[ 0., 0., 1., 0., 1.],
[ 0., 0., 0., 1., 0.]])
--
Ticket URL: <http://projects.scipy.org/scipy/ticket/1834>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.
More information about the Scipy-tickets
mailing list