[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:49:44 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  |  
---------------------------------------------+------------------------------

Comment(by demianw):

 Sorry, the code went wrong. Here it is:
 {{{
 >>> 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#comment:1>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.


More information about the Scipy-tickets mailing list