Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions math/mathcore/src/TKDTree.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -741,9 +741,9 @@ void TKDTree<Index, Value>::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 <typename Index, typename Value>
void TKDTree<Index, Value>::FindInRange(Value * point, Value range, std::vector<Index> &res)
Expand Down Expand Up @@ -793,13 +793,13 @@ void TKDTree<Index, Value>::UpdateRange(Index inode, Value* point, Value range,
}
return;
}
if (point[fAxis[inode]]<=fValue[inode]){
if (point[fAxis[inode]]<fValue[inode]){
//first examine the node that contains the point
UpdateRange(GetLeft(inode),point, range, res);
UpdateRange(GetRight(inode),point, range, res);
} else {
UpdateRange(GetLeft(inode),point, range, res);
UpdateRange(GetRight(inode),point, range, res);
UpdateRange(GetLeft(inode),point, range, res);
}
}

Expand Down
9 changes: 9 additions & 0 deletions math/mathcore/test/kDTreeTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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();
}

////////////////////////////////////////////////////////////////////////////////
Expand Down
Loading