Package org.ddogleg.nn.wrap
Class KdTreeInternalSearch<P>
java.lang.Object
org.ddogleg.nn.wrap.KdTreeInternalSearch<P>
- All Implemented Interfaces:
NearestNeighbor.Search<P>
-
Method Summary
Modifier and TypeMethodDescriptionvoid
findNearest
(P point, double maxDistance, int numNeighbors, DogArray<NnData<P>> results) Searches for the N nearest neighbor to the specified point.boolean
findNearest
(P point, double maxDistance, NnData<P> result) Searches for the nearest neighbor to the specified point.
-
Method Details
-
findNearest
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 interfaceNearestNeighbor.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
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 interfaceNearestNeighbor.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.
-