double dist(Rotation3D const &r1, Rotation3D const &r2)
void Spread(Index ntotal, Value *a, Index *index, Value &min, Value &max) const
Calculate spread of the array a.
Int_t GetParent(Int_t inode) const
Int_t fOffset
cross node - node that begins the last row (with terminal nodes only)
void SetData(Index npoints, Index ndim, UInt_t bsize, Value **data)
Set the data array. See the constructor function comments for details.
Index FindNode(const Value *point) const
returns the index of the terminal node to which point belongs (index in the fAxis, fValue, etc arrays) returns -1 in case of failure
Index * GetPointsIndexes(Int_t node) const
return the indices of the points in that terminal node for all the nodes except last, the size is fBucketSize for the last node it's fOffsetfBucketSize
TKDTree< Int_t, Float_t > TKDTreeIF
Bool_t IsTerminal(Index inode) const
void FindBNodeA(Value *point, Value *delta, Int_t &inode)
find the smallest node covering the full range - start
Int_t GetOffset()
cross node
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...
void MakeBoundariesExact()
Build boundaries for each node.
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...
void SetOwner(Int_t owner)
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 ...
Int_t GetCrossNode()
smallest terminal row
void Build()
Build the kd-tree.
Int_t GetRight(Int_t inode) const
#define ClassDef(name, id)
void FindPoint(Value *point, Index &index, Int_t &iter)
find the index of point works only if we keep fData pointers
TKDTree()
Default constructor. Nothing is built.
Index * fIndPoints
nodes boundaries
Class implementing a kd-tree.
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 fRowT0
array of points indexes
~TKDTree()
Destructor By default, the original data is not owned by kd-tree and is not deleted with it...
Value KOrdStat(Index ntotal, Value *a, Index k, Index *index) const
copy of the TMath::KOrdStat because I need an Index work array
TKDTree< Index, Value > & operator=(const TKDTree< Index, Value > &)
Int_t GetLeft(Int_t inode) const
TKDTreeIF * TKDTreeTestBuild()
Index * GetIndPoints()
offset in fIndPoints
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...
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, 0 on failure Arrays ind and dist are provided by the user and are assumed to be at least kNN elements long.
void CookBoundaries(const Int_t node, Bool_t left)
define index of this terminal node
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< Int_t, Double_t > TKDTreeID
void MakeBoundaries(Value *range=0x0)
Build boundaries for each node.
RooCmdArg Index(RooCategory &icat)
Value * GetBoundariesExact()
Get the boundaries.
Int_t fCrossNode
smallest terminal row - first row that contains terminal nodes
Mother of all ROOT objects.
Value GetNodeValue(Int_t id) const
void UpdateRange(Index inode, Value *point, Value range, std::vector< Index > &res)
Internal recursive function with the implementation of range searches.
Int_t fNNodes
0 - not owner, 2 - owner of the pointer array, 1 - owner of the whole 2-d array
Value * GetBoundaries()
Get the boundaries.
UChar_t GetNodeAxis(Int_t id) const
Int_t GetTotalNodes() const
Value * GetBoundaryExact(const Int_t node)
Get a boundary.
Value * fBoundaries
data points
Value * GetBoundary(const Int_t node)
Get a boundary.