Class PrimitiveDistanceQuery<O>

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double distance​(DBIDRef id1, DBIDRef id2)
      Returns the distance between the two objects specified by their object ids.
      double distance​(DBIDRef id1, O o2)
      Returns the distance between the two objects specified by their object ids.
      double distance​(O o1, DBIDRef id2)
      Returns the distance between the two objects specified by their object ids.
      double distance​(O o1, O o2)
      Returns the distance between the two objects specified by their object ids.
      PrimitiveDistance<? super O> getDistance()
      Get the inner distance function.
      Relation<? extends O> getRelation()
      Access the underlying data query.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • relation

        protected final Relation<? extends O> relation
        The data to use for this query
      • distanceFunction

        protected final PrimitiveDistance<? super O> distanceFunction
        The distance function we use.
    • Constructor Detail

      • PrimitiveDistanceQuery

        public PrimitiveDistanceQuery​(Relation<? extends O> relation,
                                      PrimitiveDistance<? super O> distanceFunction)
        Constructor.
        Parameters:
        relation - Representation to use.
        distanceFunction - Our distance function
    • Method Detail

      • distance

        public final double distance​(DBIDRef id1,
                                     DBIDRef id2)
        Description copied from interface: DistanceQuery
        Returns the distance between the two objects specified by their object ids.
        Specified by:
        distance in interface DistanceQuery<O>
        Parameters:
        id1 - first object id
        id2 - second object id
        Returns:
        the distance between the two objects specified by their object ids
      • distance

        public final double distance​(O o1,
                                     DBIDRef id2)
        Description copied from interface: DistanceQuery
        Returns the distance between the two objects specified by their object ids.
        Specified by:
        distance in interface DistanceQuery<O>
        Parameters:
        o1 - first object
        id2 - second object id
        Returns:
        the distance between the two objects specified by their object ids
      • distance

        public final double distance​(DBIDRef id1,
                                     O o2)
        Description copied from interface: DistanceQuery
        Returns the distance between the two objects specified by their object ids.
        Specified by:
        distance in interface DistanceQuery<O>
        Parameters:
        id1 - first object id
        o2 - second object
        Returns:
        the distance between the two objects specified by their object ids
      • distance

        public double distance​(O o1,
                               O o2)
        Description copied from interface: DistanceQuery
        Returns the distance between the two objects specified by their object ids.
        Specified by:
        distance in interface DistanceQuery<O>
        Parameters:
        o1 - first object
        o2 - second object
        Returns:
        the distance between the two objects specified by their object ids