int Int_t
Signed integer 4 bytes (int).
unsigned char UChar_t
Unsigned Character 1 byte (unsigned char).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
#define ClassDefOverride(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()
! offset in fIndPoints
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()
! cross node
~TKDTree() override
Destructor By default, the original data is not owned by kd-tree and is not deleted with it.
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...
TKDTree(Index npoints, Index ndim, UInt_t bsize)
Value * GetBoundaryExact(const Int_t node)
Get a boundary.
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.
Int_t SetData(Index idim, Value *data)
Set the coordinate #ndim of all points (the column #ndim of the data matrix) After setting all the da...
Index FindNode(const Value *point) const
returns the index of the terminal node to which point belongs (index in the fAxis,...
Value KOrdStat(Index ntotal, Value *a, Index k, Index *index) const
copy of the TMath::KOrdStat because I need an Index work array
Value GetNodeValue(Int_t id) const
Value * GetBoundariesExact()
Get the boundaries.
void MakeBoundariesExact()
Build boundaries for each node.
void CookBoundaries(const Int_t node, Bool_t left)
define index of this terminal node
void MakeBoundaries(Value *range=nullptr)
Build boundaries for each node.
TKDTree(Index npoints, Index ndim, UInt_t bsize, Value **data)
Create a kd-tree from the provided data array.
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.
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.
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,...
Int_t GetRowT0()
! smallest terminal row
kNN::Event describes point in input variable vector-space, with additional functionality like distanc...
TObject()
TObject constructor.