Package org.ddogleg.nn.alg.searches
Class KdTreeSearchNStandard<P>
java.lang.Object
org.ddogleg.nn.alg.searches.KdTreeSearchNStandard<P>
- All Implemented Interfaces:
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptioncopy()
Creates a copy of this search with the same configuration.void
findNeighbor
(P target, int searchN, DogArray<KdTreeResult> results) Finds the nodes which are closest to 'target' and within range of the maximum distance.void
setMaxDistance
(double maxDistance) Specifies the greatest distance it will searchvoid
Specifies the tree which will be searched.
-
Constructor Details
-
KdTreeSearchNStandard
-
-
Method Details
-
setTree
Description copied from interface:KdTreeSearchN
Specifies the tree which will be searched. The type of object is implementation specific- Specified by:
setTree
in interfaceKdTreeSearchN<P>
- Parameters:
tree
- search tree
-
setMaxDistance
public void setMaxDistance(double maxDistance) Specifies the greatest distance it will search- Specified by:
setMaxDistance
in interfaceKdTreeSearchN<P>
- Parameters:
maxDistance
- Maximum distance (Euclidean squared) a closest point can be
-
findNeighbor
Finds the nodes which are closest to 'target' and within range of the maximum distance.- Specified by:
findNeighbor
in interfaceKdTreeSearchN<P>
- Parameters:
target
- A pointsearchN
- Number of nearest-neighbors it will search forresults
- Storage for the found neighbors
-
copy
Description copied from interface:KdTreeSearchN
Creates a copy of this search with the same configuration. workspace isn't copied- Specified by:
copy
in interfaceKdTreeSearchN<P>
-