org.ddogleg.nn.alg
Class ExhaustiveNeighbor
- java.lang.Object
-
- org.ddogleg.nn.alg.ExhaustiveNeighbor
-
public class ExhaustiveNeighbor extends java.lang.ObjectExhaustively finds the nearest-neighbor to a n-dimensional point by considering every possibility.
-
-
Constructor Summary
Constructors Constructor and Description ExhaustiveNeighbor()ExhaustiveNeighbor(int n)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intfindClosest(double[] p, double maxDistance)Finds the index of the point which has the smallest Euclidean distance to 'p' and is<maxDistance away.voidfindClosestN(double[] p, double maxDistance, int numNeighbors, GrowQueue_I32 outputIndex, GrowQueue_F64 outputDistance)Finds the index of the point which has the smallest Euclidean distance to 'p' and is<maxDistance away.doublegetBestDistance()voidsetN(int n)Specifies the point's dimensionvoidsetPoints(java.util.List<double[]> points)The input list which the nearest-neighbor is to be found inside of
-
-
-
Constructor Detail
-
ExhaustiveNeighbor
public ExhaustiveNeighbor(int n)
-
ExhaustiveNeighbor
public ExhaustiveNeighbor()
-
-
Method Detail
-
setN
public void setN(int n)
Specifies the point's dimension- Parameters:
n- dimension
-
setPoints
public void setPoints(java.util.List<double[]> points)
The input list which the nearest-neighbor is to be found inside of- Parameters:
points- List od points
-
findClosest
public int findClosest(double[] p, double maxDistance)Finds the index of the point which has the smallest Euclidean distance to 'p' and is<maxDistance away.- Parameters:
p- A point.maxDistance- The maximum distance (Euclidean squared) the neighbor can be.- Returns:
- Index of the closest point.
-
findClosestN
public void findClosestN(double[] p, double maxDistance, int numNeighbors, GrowQueue_I32 outputIndex, GrowQueue_F64 outputDistance)Finds the index of the point which has the smallest Euclidean distance to 'p' and is<maxDistance away.- Parameters:
p- A point.maxDistance- The maximum distance (Euclidean squared) the neighbor can be.numNeighbors- the requested number of nearest neighbors it should search foroutputIndex- Storage for the index of the closest elementsoutputDistance- Storage for the distance of the closest elements
-
getBestDistance
public double getBestDistance()
-
-
DataMelt 3.0 © DataMelt by jWork.ORG