optimization question

Willi Richert w.richert at gmx.net
Mon Mar 30 12:00:48 UTC 2009


Hi,

in kdtree.hpp and node.hpp very often sqrt is used.

	d = sqrt(d);
     if (d <= __max)  
	...
	__max itself is also a sqrt()ed value

IMHO, the speed could be improved if that is omitted everywhere. Just 
comparing the squared distances should work if the specified ranges are 
converted once at the interface methods.

wr



More information about the libkdtree-devel mailing list