74 void* G4KDTree::operator
new(size_t)
80 void G4KDTree::operator
delete(
void *aNode)
82 fgAllocator->FreeSingle((
G4KDTree*) aNode);
123 G4cout <<
"template<typename PointT> G4KDTree<PointT>::Build" <<
G4endl;
128 if(root == 0)
return;
139 for (
size_t n = 0;
n < Nnodes;
n +=
fDim)
141 for (
size_t dim = 0; dim <
fDim; dim++)
164 std::vector<G4KDNode_Base* > result;
185 rset->Insert(dist_sq, result[j]);
206 const double range_sq =
sqr(range);
void Print(std::ostream &out=G4cout) const
void SetMinMax(const Position &min, const Position &max)
void __NearestToNode(G4KDNode_Base *source_node, G4KDNode_Base *node, const Position &pos, std::vector< G4KDNode_Base * > &result, double *result_dist_sq, HyperRect *fRect, int &nbresult)
G4KDNode_Base * Insert(PointT *point)
G4KDNode_Base * GetRight()
G4KDTree is used by the ITManager to locate the neareast neighbours.
G4KDNode_Base * PopOutMiddle(size_t dimension)
void Print(std::ostream &out, int level=0) const
G4KDTreeResultHandle Nearest(const Position &pos)
G4GLOB_DLL std::ostream G4cout
void Extend(const Position &pos)
G4KDTreeResultHandle NearestInRange(const Position &pos, const double &range)
void __InsertMap(G4KDNode_Base *node)
void Insert(G4KDNode_Base *pos)
void __Clear_Rec(G4KDNode_Base *node)
int __NearestInRange(G4KDNode_Base *node, const Position &pos, const double &range_sq, const double &range, G4KDTreeResult &list, int ordered, G4KDNode_Base *source_node=0)
G4ThreadLocalStatic G4Allocator< G4KDTree > * fgAllocator
G4KDNode_Base * GetLeft()
G4KDTreeResult enables to go through the nearest entities found by G4KDTree.