Package org.ddogleg.nn.alg.searches
Class KdTreeSearchNBbf<P>
java.lang.Object
org.ddogleg.nn.alg.searches.KdTreeSearchBestBinFirst<P>
org.ddogleg.nn.alg.searches.KdTreeSearchNBbf<P>
- All Implemented Interfaces:
KdTreeSearchN<P>
Implementation of KdTreeSearchBestBinFirst which searches for the N nearest-neighbors.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.ddogleg.nn.alg.searches.KdTreeSearchBestBinFirst
KdTreeSearchBestBinFirst.Helper -
Field Summary
Fields inherited from class org.ddogleg.nn.alg.searches.KdTreeSearchBestBinFirst
bestDistanceSq, maxNodesSearched, N, numNodesSearched -
Constructor Summary
ConstructorsConstructorDescriptionKdTreeSearchNBbf(KdTreeDistance<P> distance, int maxNodesSearched) Configures the search -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancanImprove(double distanceSq) Checks to see if it is possible for this distance to improve upon the current bestprotected voidcheckBestDistance(KdTree.Node node, P target) Checks to see if the current node's point is the closet point found so farcopy()Creates a copy of this search with the same configuration.voidfindNeighbor(P target, int searchN, DogArray<KdTreeResult> results) Searches for the N nearest-neighbors to the target.voidSpecifies the tree which will be searched.Methods inherited from class org.ddogleg.nn.alg.searches.KdTreeSearchBestBinFirst
_findClosest, addToQueue, searchNode, setMaxDistance, setTree, setTreesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ddogleg.nn.alg.KdTreeSearchN
setMaxDistance
-
Constructor Details
-
KdTreeSearchNBbf
Configures the search- Parameters:
maxNodesSearched- Maximum number of nodes it will search. Used to limit CPU time.
-
-
Method Details
-
setTree
Description copied from interface:KdTreeSearchNSpecifies the tree which will be searched. The type of object is implementation specific- Specified by:
setTreein interfaceKdTreeSearchN<P>- Parameters:
tree- search tree
-
findNeighbor
Description copied from interface:KdTreeSearchNSearches for the N nearest-neighbors to the target. The results are added to the 'results' list.- Specified by:
findNeighborin interfaceKdTreeSearchN<P>- Parameters:
target- Point whose nearest neighbor is being searched forsearchN- Number of closest points it will find. Must be>=1results- Storage for the found neighbors.
-
copy
Description copied from interface:KdTreeSearchNCreates a copy of this search with the same configuration. workspace isn't copied- Specified by:
copyin interfaceKdTreeSearchN<P>
-
checkBestDistance
Checks to see if the current node's point is the closet point found so far- Specified by:
checkBestDistancein classKdTreeSearchBestBinFirst<P>
-
canImprove
protected boolean canImprove(double distanceSq) Description copied from class:KdTreeSearchBestBinFirstChecks to see if it is possible for this distance to improve upon the current best- Specified by:
canImprovein classKdTreeSearchBestBinFirst<P>- Parameters:
distanceSq- The distance being considered- Returns:
- true if it can be better or false if not
-