Class BoxDistance.FarthestNeighbor

  • All Implemented Interfaces:
    BoxDistance
    Enclosing interface:
    BoxDistance

    public static class BoxDistance.FarthestNeighbor
    extends Object
    implements BoxDistance
    Special wrapper class which takes the inverse or the given function. Can be used to get the farthest neighbors using the nearest neighbor algorithm.
    • Constructor Detail

      • FarthestNeighbor

        public FarthestNeighbor​(BoxDistance dist)
    • Method Detail

      • dist

        public double dist​(double[] center,
                           double[] min,
                           double[] max)
        Specified by:
        dist in interface BoxDistance
        Parameters:
        center - A point
        min - Minimum corner of axis aligned box
        max - Maximum corner of axis aligned box
        Returns:
        Distance between point and box
      • dist

        public double dist​(double[] center,
                           Index.BoxEntry<?> entry)
        Description copied from interface: BoxDistance
        Some 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:
        dist in interface BoxDistance
        Parameters:
        center - a point
        entry - a box
        Returns:
        distance between point and box