org.ddogleg.nn.alg
Class KdTreeSearch1Standard
- java.lang.Object
-
- org.ddogleg.nn.alg.KdTreeSearch1Standard
-
- All Implemented Interfaces:
- KdTreeSearch1
public class KdTreeSearch1Standard extends java.lang.Object implements KdTreeSearch1
Standard algorithm for searching aKdTreefor the nearest-neighbor of a search. This is the algorithm which is typically described in books. At each node it examines distance of the two children and investigates the closer child. After it reaches a leaf it steps back in the search and sees if the other child could produce a better solution, if it can it is also investigated. The search stops when no more nodes can produce a better result.
-
-
Constructor Summary
Constructors Constructor and Description KdTreeSearch1Standard()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description KdTree.NodefindNeighbor(double[] target)Finds the node which is closest to 'target'doublegetDistance()Returns the distance of the closest node.voidsetMaxDistance(double maxDistance)Specifies the greatest distance it will searchvoidsetTree(KdTree tree)Specifies the tree which is to be searched
-
-
-
Method Detail
-
setTree
public void setTree(KdTree tree)
Description copied from interface:KdTreeSearch1Specifies the tree which is to be searched- Specified by:
setTreein interfaceKdTreeSearch1
-
setMaxDistance
public void setMaxDistance(double maxDistance)
Specifies the greatest distance it will search- Specified by:
setMaxDistancein interfaceKdTreeSearch1- Parameters:
maxDistance- Maximum distance (Euclidean squared) a closest point can be
-
findNeighbor
public KdTree.Node findNeighbor(double[] target)
Finds the node which is closest to 'target'- Specified by:
findNeighborin interfaceKdTreeSearch1- Parameters:
target- A point- Returns:
- Closest node or null if none is within the minimum distance.
-
getDistance
public double getDistance()
Description copied from interface:KdTreeSearch1Returns the distance of the closest node.- Specified by:
getDistancein interfaceKdTreeSearch1- Returns:
- distance to closest node.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG