diff --git a/src/NeighbourFinder.hpp b/src/NeighbourFinder.hpp index f397c86..9d6ac45 100644 --- a/src/NeighbourFinder.hpp +++ b/src/NeighbourFinder.hpp @@ -99,8 +99,8 @@ void NeighbourFinder::set_source_points(const VecMatType * const inS //# Update internal data structures //## The kd-tree has to be rebuilt. if (_kdTree != NULL) { delete _kdTree; _kdTree = NULL;} - _kdTree = new nanoflann::KDTreeEigenMatrixAdaptor(*_inSourcePoints, - _leafSize); + _kdTree = new nanoflann::KDTreeEigenMatrixAdaptor(_numDimensions + *_inSourcePoints); _kdTree->index->buildIndex(); }