From 943ba48bc47b9c35baeef6306d2a6db4476f12ee Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Tue, 6 May 2025 12:01:35 +0200 Subject: [PATCH 1/3] [math] look at node in proper order Fixes https://its.cern.ch/jira/browse/ROOT-10374 --- math/mathcore/src/TKDTree.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/math/mathcore/src/TKDTree.cxx b/math/mathcore/src/TKDTree.cxx index 3474a04cf93d2..15ecbf9bfe635 100644 --- a/math/mathcore/src/TKDTree.cxx +++ b/math/mathcore/src/TKDTree.cxx @@ -793,13 +793,13 @@ void TKDTree::UpdateRange(Index inode, Value* point, Value range, } return; } - if (point[fAxis[inode]]<=fValue[inode]){ + if (point[fAxis[inode]] Date: Fri, 1 Aug 2025 16:24:58 +0200 Subject: [PATCH 2/3] [test] activate further kdtree tests which uses the FindInRange function --- math/mathcore/test/kDTreeTest.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/math/mathcore/test/kDTreeTest.cxx b/math/mathcore/test/kDTreeTest.cxx index c5cc6f1312c4d..a830bd996d004 100644 --- a/math/mathcore/test/kDTreeTest.cxx +++ b/math/mathcore/test/kDTreeTest.cxx @@ -26,6 +26,9 @@ bool showGraphics = false; void TestBuild(const Int_t npoints = 1000000, const Int_t bsize = 100); void TestConstr(const Int_t npoints = 1000000, const Int_t bsize = 100); void TestSpeed(Int_t npower2 = 20, Int_t bsize = 10); +void TestMembers(); +void TestNeighbors(); +void TestRange(); //void TestkdtreeIF(Int_t npoints=1000, Int_t bsize=9, Int_t nloop=1000, Int_t mode = 2); //void TestSizeIF(Int_t nsec=36, Int_t nrows=159, Int_t npoints=1000, Int_t bsize=10, Int_t mode=1); @@ -51,6 +54,12 @@ void kDTreeTest() TestBuild(); printf("\n\tTesting kDTree speed ...\n"); TestSpeed(); + printf("\n\tTesting kDTree members ...\n"); + TestMembers(); + printf("\n\tTesting kDTree neighbors ...\n"); + TestNeighbors(); + printf("\n\tTesting kDTree range ...\n"); + TestRange(); } //////////////////////////////////////////////////////////////////////////////// From 573a31467ca291c07cd3565e34daf94e11174391 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Fri, 1 Aug 2025 18:27:26 +0200 Subject: [PATCH 3/3] [nfc][math] improve documentation --- math/mathcore/src/TKDTree.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/math/mathcore/src/TKDTree.cxx b/math/mathcore/src/TKDTree.cxx index 15ecbf9bfe635..9e5e99e5a4490 100644 --- a/math/mathcore/src/TKDTree.cxx +++ b/math/mathcore/src/TKDTree.cxx @@ -741,9 +741,9 @@ void TKDTree::FindPoint(Value * point, Index &index, Int_t &iter){ //////////////////////////////////////////////////////////////////////////////// ///Find all points in the sphere of a given radius "range" around the given point -///1st argument - the point -///2nd argument - radius of the shere -///3rd argument - a vector, in which the results will be returned +/// \param point the point +/// \param range radius of the sphere +/// \param res a vector, in which the results will be returned template void TKDTree::FindInRange(Value * point, Value range, std::vector &res)