Class KdTreeInternalSearch<P>

java.lang.Object
org.ddogleg.nn.wrap.KdTreeInternalSearch<P>
All Implemented Interfaces:
NearestNeighbor.Search<P>

public abstract class KdTreeInternalSearch<P> extends Object implements NearestNeighbor.Search<P>
  • Method Details

    • findNearest

      public boolean findNearest(P point, double maxDistance, NnData<P> result)
      Description copied from interface: NearestNeighbor.Search
      Searches for the nearest neighbor to the specified point. The neighbor must be within maxDistance.

      NOTE: How distance is measured is not specified here. See the implementation's documentation. Euclidean distance squared is common.

      Specified by:
      findNearest in interface NearestNeighbor.Search<P>
      Parameters:
      point - (Input) A point being searched for.
      maxDistance - (Input) Maximum distance (inclusive, e.g. d ≤ maxDistance) a neighbor can be from point. Values < 0 will be set to the maximum distance.
      result - (Output) Storage for the result.
      Returns:
      true if a match within the max distance was found.
    • findNearest

      public void findNearest(P point, double maxDistance, int numNeighbors, DogArray<NnData<P>> results)
      Description copied from interface: NearestNeighbor.Search
      Searches for the N nearest neighbor to the specified point. The neighbors must be within maxDistance.

      NOTE: How distance is measured is not specified here. See the implementation's documentation. Euclidean distance squared is common.

      Specified by:
      findNearest in interface NearestNeighbor.Search<P>
      Parameters:
      point - (Input) A point being searched for.
      maxDistance - (Input) Maximum distance (inclusive, e.g. d ≤ maxDistance) the neighbor can be from point. Values < 0 will be set to the maximum distance.
      numNeighbors - (Input) The number of neighbors it will search for.
      results - (Output) Storage for the result. Reset() is called.