Documentation of 'smile.math.distance.LeeDistance' Java class
LeeDistance
smile.math.distance

Class LeeDistance

  • All Implemented Interfaces:
    java.io.Serializable, Distance<int[]>, Metric<int[]>


    public class LeeDistance
    extends java.lang.Object
    implements Metric<int[]>, java.io.Serializable
    In coding theory, the Lee distance is a distance between two strings x1x2...xn and y1y2...yn of equal length n over the q-ary alphabet {0,1,...,q-1} of size q ≥ 2, defined as

    sum min(|xi-yi|, q-|xi-yi|)

    If q = 2 or q = 3 the Lee distance coincides with the Hamming distance.

    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      LeeDistance(int q)
      Constructor with a given size q of alphabet.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      double d(int[] x, int[] y)
      Returns the distance measure between two objects.
      java.lang.String toString() 
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • LeeDistance

        public LeeDistance(int q)
        Constructor with a given size q of alphabet.
        Parameters:
        q - the size of q-ary alphabet.
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • d

        public double d(int[] x,
                        int[] y)
        Description copied from interface: Distance
        Returns the distance measure between two objects.
        Specified by:
        d in interface Distance<int[]>

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.