Package org.tinspin.index
Class RectangleDistanceFunction.FarthestNeighbor
- java.lang.Object
-
- org.tinspin.index.RectangleDistanceFunction.FarthestNeighbor
-
- All Implemented Interfaces:
RectangleDistanceFunction
- Enclosing interface:
- RectangleDistanceFunction
public static class RectangleDistanceFunction.FarthestNeighbor extends Object implements RectangleDistanceFunction
Special wrapper class which takes the inverse or the given function. Can be used to get the farthest neighbors using the nearest neighbor algorithm.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.tinspin.index.RectangleDistanceFunction
RectangleDistanceFunction.EdgeDistance, RectangleDistanceFunction.FarthestNeighbor, RectangleDistanceFunction.RectangleDist
-
-
Field Summary
-
Fields inherited from interface org.tinspin.index.RectangleDistanceFunction
CENTER, EDGE
-
-
Constructor Summary
Constructors Constructor Description FarthestNeighbor(RectangleDistanceFunction dist)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doubledist(double[] center, double[] min, double[] max)doubledist(double[] center, RectangleEntry<?> entry)Some algorithm use this method on the entries containing user supplied values.
-
-
-
Constructor Detail
-
FarthestNeighbor
public FarthestNeighbor(RectangleDistanceFunction dist)
-
-
Method Detail
-
dist
public double dist(double[] center, double[] min, double[] max)- Specified by:
distin interfaceRectangleDistanceFunction- Parameters:
center- A pointmin- Minimum corner of axis aligned boxmax- Maximum corner of axis aligned box- Returns:
- Distance between point and box
-
dist
public double dist(double[] center, RectangleEntry<?> entry)Description copied from interface:RectangleDistanceFunctionSome algorithm use this method on the entries containing user supplied values. This can be overridden if the min/max coordinates only represent the bounding-box of the object. If your entry is actually a sphere, a car, an human or a cat, you may need this.- Specified by:
distin interfaceRectangleDistanceFunction- Parameters:
center- a pointentry- a rectangle- Returns:
- distance between point and rectangle
-
-