public void Reset() { this.iPointsRemaining = Math.Min(this.iMaxPointsReturned, this.pRoot.Size); this._CurrentDistance = -1; this.pEvaluated = new IntervalHeap <T>(); this.pPending = new MinHeap <KDNode <T> >(); this.pPending.Insert(0, this.pRoot); }
public NearestNeighbour(KDNode <T> pRoot, double[] tSearchPoint, DistanceFunctions kDistance, int iMaxPoints, double fThreshold) { if ((int)tSearchPoint.Length != pRoot.iDimensions) { throw new Exception("Dimensionality of search point and kd-tree are not the same."); } this.tSearchPoint = new double[(int)tSearchPoint.Length]; Array.Copy(tSearchPoint, this.tSearchPoint, (int)tSearchPoint.Length); this.iPointsRemaining = Math.Min(iMaxPoints, pRoot.Size); this.fThreshold = fThreshold; this.kDistanceFunction = kDistance; this.pRoot = pRoot; this.iMaxPointsReturned = iMaxPoints; this._CurrentDistance = -1; this.pEvaluated = new IntervalHeap <T>(); this.pPending = new MinHeap <KDNode <T> >(); this.pPending.Insert(0, pRoot); }