Class KdTreeSearchNStandard<P>

java.lang.Object
org.ddogleg.nn.alg.searches.KdTreeSearchNStandard<P>
All Implemented Interfaces:
KdTreeSearchN<P>

public class KdTreeSearchNStandard<P> extends Object implements KdTreeSearchN<P>
Standard algorithm for searching a KdTree for the nearest-neighbor of a search. This is an adaptation of KdTreeSearch1Standard for N-nearest-neighbors.
  • Constructor Details

    • KdTreeSearchNStandard

      public KdTreeSearchNStandard(KdTreeDistance<P> distance)
  • Method Details

    • setTree

      public void setTree(Object tree)
      Description copied from interface: KdTreeSearchN
      Specifies the tree which will be searched. The type of object is implementation specific
      Specified by:
      setTree in interface KdTreeSearchN<P>
      Parameters:
      tree - search tree
    • setMaxDistance

      public void setMaxDistance(double maxDistance)
      Specifies the greatest distance it will search
      Specified by:
      setMaxDistance in interface KdTreeSearchN<P>
      Parameters:
      maxDistance - Maximum distance (Euclidean squared) a closest point can be
    • findNeighbor

      public void findNeighbor(P target, int searchN, DogArray<KdTreeResult> results)
      Finds the nodes which are closest to 'target' and within range of the maximum distance.
      Specified by:
      findNeighbor in interface KdTreeSearchN<P>
      Parameters:
      target - A point
      searchN - Number of nearest-neighbors it will search for
      results - Storage for the found neighbors
    • copy

      public KdTreeSearchN<P> copy()
      Description copied from interface: KdTreeSearchN
      Creates a copy of this search with the same configuration. workspace isn't copied
      Specified by:
      copy in interface KdTreeSearchN<P>