Package org.ddogleg.nn
Interface NearestNeighbor<P>
- All Known Implementing Classes:
KdForestBbfNearestNeighbor
,KdTreeNearestNeighbor
,VpTree
,WrapExhaustiveNeighbor
public interface NearestNeighbor<P>
Abstract interface for finding the nearest neighbor to a user specified point inside of a set of points in K-dimensional space. Solution can be exact or approximate, depending on the implementation. The distance metric is intentionally left undefined and is implementation dependent.
WARNING: Do not modify the input lists until after the NN search is no longer needed. If the input lists do need to be modified, then pass in a copy instead. This restriction reduced memory overhead significantly.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
An independent search instance. -
Method Summary
Modifier and TypeMethodDescriptionCreates a new search for this data structure.void
Specifies the set of points which are to be searched.
-
Method Details
-
setPoints
Specifies the set of points which are to be searched.- Parameters:
points
- Set of points.trackIndices
- If true it will keep track of the index. Making it easy to associate data.
-
createSearch
NearestNeighbor.Search<P> createSearch()Creates a new search for this data structure. This is intended to enabled concurrent searches. AftersetPoints(java.util.List<P>, boolean)
has been called and returned, each searched can be called independently in separate threads. Do not callsetPoints(java.util.List<P>, boolean)
which a search is being performed.- Returns:
- A new search object for this instance.
-