Class KDNode<T>
A KD-Tree node which supports a generic number of dimensions. All data items need the same number of dimensions. This node splits based on the largest range of any dimension.
Inherited Members
Namespace:KDTree
Assembly:cs.temp.dll.dll
Syntax
public class KDNode<T>
Type Parameters
Name | Description |
---|---|
T | The generic data type this structure contains. |
Remarks
This is based on this: https://bitbucket.org/rednaxela/knn-benchmark/src/tip/ags/utils/dataStructures/trees/thirdGenKD/
Constructors
KDNode(Int32, Int32)
Protected method which constructs a new KDNode.
Declaration
protected KDNode(int iDimensions, int iBucketCapacity)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iDimensions | The number of dimensions for this node (all the same in the tree). |
System.Int32 | iBucketCapacity | The initial capacity of the bucket. |
Fields
bSinglePoint
Does this node represent only one point.
Declaration
protected bool bSinglePoint
Field Value
Type | Description |
---|---|
System.Boolean |
fSplitValue
The split value (larger go into the right, smaller go into left)
Declaration
protected double fSplitValue
Field Value
Type | Description |
---|---|
System.Double |
iBucketCapacity
The maximum capacity of this node.
Declaration
protected int iBucketCapacity
Field Value
Type | Description |
---|---|
System.Int32 |
iDimensions
The number of dimensions for this node.
Declaration
protected int iDimensions
Field Value
Type | Description |
---|---|
System.Int32 |
iSplitDimension
The split dimension.
Declaration
protected int iSplitDimension
Field Value
Type | Description |
---|---|
System.Int32 |
pLeft
The left and right children.
Declaration
protected KDNode<T> pLeft
Field Value
Type | Description |
---|---|
KDNode<T> |
pRight
The left and right children.
Declaration
protected KDNode<T> pRight
Field Value
Type | Description |
---|---|
KDNode<T> |
tData
The array of data values. [index]
Declaration
protected T[] tData
Field Value
Type | Description |
---|---|
T[] |
tMaxBound
The min and max bound for this node. All dimensions.
Declaration
protected double[] tMaxBound
Field Value
Type | Description |
---|---|
System.Double[] |
tMinBound
The min and max bound for this node. All dimensions.
Declaration
protected double[] tMinBound
Field Value
Type | Description |
---|---|
System.Double[] |
tPoints
The array of locations. [index][dimension]
Declaration
protected double[][] tPoints
Field Value
Type | Description |
---|---|
System.Double[][] |
Properties
IsLeaf
Is this KDNode a leaf or not?
Declaration
public bool IsLeaf { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Size
The number of items in this leaf node and all children.
Declaration
public int Size { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
AddPoint(Double[], T)
Insert a new point into this leaf node.
Declaration
public void AddPoint(double[] tPoint, T kValue)
Parameters
Type | Name | Description |
---|---|---|
System.Double[] | tPoint | The position which represents the data. |
T | kValue | The value of the data. |