#define ClassDef(name, id)
TKDTree< Int_t, Double_t > TKDTreeID
TKDTreeIF * TKDTreeTestBuild()
TKDTree< Int_t, Float_t > TKDTreeIF
Class implementing a kd-tree.
Int_t GetLeft(Int_t inode) const
UChar_t GetNodeAxis(Int_t id) const
Int_t GetOffset()
cross node
Int_t GetTotalNodes() const
void FindPoint(Value *point, Index &index, Int_t &iter)
find the index of point works only if we keep fData pointers
void SetData(Index npoints, Index ndim, UInt_t bsize, Value **data)
Set the data array. See the constructor function comments for details.
Int_t GetCrossNode()
smallest terminal row
Int_t fCrossNode
smallest terminal row - first row that contains terminal nodes
void GetNodePointsIndexes(Int_t node, Int_t &first1, Int_t &last1, Int_t &first2, Int_t &last2) const
Return the indices of points in that node Indices are returned as the first and last value of the par...
Index * GetIndPoints()
offset in fIndPoints
Index * fIndPoints
nodes boundaries
Value * GetBoundaryExact(const Int_t node)
Get a boundary.
void MakeBoundaries(Value *range=0x0)
Build boundaries for each node.
void FindBNodeA(Value *point, Value *delta, Int_t &inode)
find the smallest node covering the full range - start
void UpdateRange(Index inode, Value *point, Value range, std::vector< Index > &res)
Internal recursive function with the implementation of range searches.
Index FindNode(const Value *point) const
returns the index of the terminal node to which point belongs (index in the fAxis,...
Int_t fNNodes
0 - not owner, 2 - owner of the pointer array, 1 - owner of the whole 2-d array
Value KOrdStat(Index ntotal, Value *a, Index k, Index *index) const
copy of the TMath::KOrdStat because I need an Index work array
Int_t fOffset
cross node - node that begins the last row (with terminal nodes only)
Value GetNodeValue(Int_t id) const
Value * GetBoundariesExact()
Get the boundaries.
~TKDTree()
Destructor By default, the original data is not owned by kd-tree and is not deleted with it.
void MakeBoundariesExact()
Build boundaries for each node.
void CookBoundaries(const Int_t node, Bool_t left)
define index of this terminal node
void UpdateNearestNeighbors(Index inode, const Value *point, Int_t kNN, Index *ind, Value *dist)
Update the nearest neighbors values by examining the node inode.
Int_t GetRight(Int_t inode) const
Int_t GetParent(Int_t inode) const
Double_t Distance(const Value *point, Index ind, Int_t type=2) const
Find the distance between point of the first argument and the point at index value ind Type argument ...
Index * GetPointsIndexes(Int_t node) const
return the indices of the points in that terminal node for all the nodes except last,...
void Spread(Index ntotal, Value *a, Index *index, Value &min, Value &max) const
Calculate spread of the array a.
void Build()
Build the kd-tree.
void DistanceToNode(const Value *point, Index inode, Value &min, Value &max, Int_t type=2)
Find the minimal and maximal distance from a given point to a given node.
TKDTree()
Default constructor. Nothing is built.
Int_t fRowT0
array of points indexes
void SetOwner(Int_t owner)
void FindInRange(Value *point, Value range, std::vector< Index > &res)
Find all points in the sphere of a given radius "range" around the given point 1st argument - the poi...
Value * fBoundaries
data points
Bool_t IsTerminal(Index inode) const
Index GetNPointsNode(Int_t node) const
Get number of points in this node for all the terminal nodes except last, the size is fBucketSize for...
Value * GetBoundaries()
Get the boundaries.
Value * GetBoundary(const Int_t node)
Get a boundary.
TKDTree< Index, Value > & operator=(const TKDTree< Index, Value > &)
void FindNearestNeighbors(const Value *point, Int_t k, Index *ind, Value *dist)
Find kNN nearest neighbors to the point in the first argument Returns 1 on success,...
kNN::Event describes point in input variable vector-space, with additional functionality like distanc...
Mother of all ROOT objects.