Skip to content

Commit

Permalink
Fixed: split plane now correctly chooses the dimensions with the larg…
Browse files Browse the repository at this point in the history
…est span

Fixes #33
  • Loading branch information
jlblancoc committed Dec 20, 2016
1 parent 206d65a commit f2efec0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
nanoflann 1.2.3: Released Dec 20, 2016
* Fixed: split plane now correctly chooses the dimensions with the largest span.
Should lead to more optimal trees.

nanoflann 1.2.2: Released Nov 10, 2016
* knnSearch() now also returns the number of valid points found.

Expand Down
4 changes: 2 additions & 2 deletions include/nanoflann.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ namespace nanoflann
* @{ */

/** Library version: 0xMmP (M=Major,m=minor,P=patch) */
#define NANOFLANN_VERSION 0x122
#define NANOFLANN_VERSION 0x123

/** @addtogroup result_sets_grp Result set classes
* @{ */
Expand Down Expand Up @@ -1116,7 +1116,7 @@ namespace nanoflann
ElementType span = bbox[i].high-bbox[i].low;
if (span>(1-EPS)*max_span) {
ElementType min_elem, max_elem;
computeMinMax(ind, count, cutfeat, min_elem, max_elem);
computeMinMax(ind, count, i, min_elem, max_elem);
ElementType spread = max_elem-min_elem;;
if (spread>max_spread) {
cutfeat = i;
Expand Down

0 comments on commit f2efec0

Please sign in to comment.