Show / Hide Table of Contents

Class NearestNeighbour<T>

A NearestNeighbour iterator for the KD-tree which intelligently iterates and captures relevant data in the search space.

Inheritance
IEnumerator<T>
NearestNeighbour<T>
Namespace:KDTree
Assembly:cs.temp.dll.dll
Syntax
public class NearestNeighbour<T> : IEnumerator<T>, IEnumerable<T>
Type Parameters
Name Description
T

The type of data the iterator should handle.

Constructors

NearestNeighbour(KDNode<T>, Double[], DistanceFunctions, Int32, Double)

Construct a new nearest neighbour iterator.

Declaration
public NearestNeighbour(KDNode<T> pRoot, double[] tSearchPoint, DistanceFunctions kDistance, int iMaxPoints, double fThreshold)
Parameters
Type Name Description
KDNode<T> pRoot

The root of the tree to begin searching from.

System.Double[] tSearchPoint

The point in n-dimensional space to search.

DistanceFunctions kDistance

The distance function used to evaluate the points.

System.Int32 iMaxPoints

The max number of points which can be returned by this iterator. Capped to max in tree.

System.Double fThreshold

Threshold to apply to the search space. Negative numbers indicate that no threshold is applied.

Properties

Current

Declaration
public T Current { get; }
Property Value
Type Description
T

CurrentDistance

Return the distance of the current value to the search point.

Declaration
public double CurrentDistance { get; }
Property Value
Type Description
System.Double

Methods

Dispose()

Declaration
public void Dispose()

GetEnumerator()

Declaration
public IEnumerator<T> GetEnumerator()
Returns
Type Description
IEnumerator<T>

MoveNext()

Check for the next iterator item.

Declaration
public bool MoveNext()
Returns
Type Description
System.Boolean

True if we have one, false if not.

Reset()

Reset the iterator.

Declaration
public void Reset()
Back to top © 2017 Mapbox