[Biopython-dev] [Bug 2489] KDTree NN search without specifying radius
bugzilla-daemon at portal.open-bio.org
bugzilla-daemon at portal.open-bio.org
Tue Apr 15 10:25:47 EDT 2008
http://bugzilla.open-bio.org/show_bug.cgi?id=2489
------- Comment #2 from samnemo at gmail.com 2008-04-15 10:25 EST -------
Created an attachment (id=909)
--> (http://bugzilla.open-bio.org/attachment.cgi?id=909&action=view)
updated .H file
added public function void KDTree::search_nn(float* coord,bool allowzero)
bool allowzero specifies whether to allow zero distance between nearest
neighbor searching for in tree (should be false when searching for nearest
neighbor of a coordinate known to be in the tree)
and private function :
void KDTree::_search_r(Node* node,float* coord,bool allowzero)
performs recursive search for nearest neighbor of coord starting from node
also note new member variable : float _min_radius_sq; used to keep track of min
distance found for a single nearest neighbor search
other changes include:
leaving coordinates as squared distances when storing them. the user is then
responsible for calling sqrt if desired.
replaced some of the static declaration of variable sized arrays as vectors
since wouldn't compile on msvc++, but easy to change that back...
--
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
More information about the Biopython-dev
mailing list