forum.alglib.net
http://forum.alglib.net/

KDTree: is rearch result ordered?
http://forum.alglib.net/viewtopic.php?f=2&t=768
Page 1 of 1

Author:  mamitko [ Tue Feb 05, 2013 7:46 am ]
Post subject:  KDTree: is rearch result ordered?

Hello,

I'm using your KDTree for 2D points with Euclidean norm and do KDTreeQueryKNN() and then KDTreeQueryResultsTags()
Is the search result guaranteed to be ordered in meaning of nondecreasing distance to "search point"?

I need to "order" of points of more or less regular polyline and do it in quite naive way: I take the first point (it's specified) and find nearest one, then nearest one for the last found and so on. Your KDTree can not be modified (point can not be removed) and I have to store boolean array of already involved points. On each step I try to find K nearest points, then take FIRST unused (if all are used I increase the K number).

Is it possible to modify The tree for point remove support
or
to make it support some think like callback boolean function, returning should point be returned as search result or not (to pass the callback to search proc and to use Tag as callback parameter).

Thank you.

Author:  mamitko [ Wed Feb 06, 2013 4:07 am ]
Post subject:  Re: KDTree: is rearch result ordered?

I added callback funtion and it works fine for my case.

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/