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

Class HammingDistance<T>

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


    public class HammingDistance<T>
    extends java.lang.Object
    implements Metric<T[]>, java.io.Serializable
    In information theory, the Hamming distance between two strings of equal length is the number of positions for which the corresponding symbols are different. Put another way, it measures the minimum number of substitutions required to change one into the other, or the number of errors that transformed one string into the other. For a fixed length n, the Hamming distance is a metric on the vector space of the words of that length.
    See Also:
    Serialized Form
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      static int d(java.util.BitSet x, java.util.BitSet y)
      Returns Hamming distance between the two BitSets.
      static int d(byte[] x, byte[] y)
      Returns Hamming distance between the two byte arrays.
      static int d(byte x, byte y)
      Returns Hamming distance between the two bytes.
      static int d(int[] x, int[] y)
      Returns Hamming distance between the two integer arrays.
      static int d(int x, int y)
      Returns Hamming distance between the two integers.
      static int d(long x, long y)
      Returns Hamming distance between the two long integers.
      static int d(short[] x, short[] y)
      Returns Hamming distance between the two short arrays.
      static int d(short x, short y)
      Returns Hamming distance between the two shorts.
      double d(T[] x, T[] y)
      Returns Hamming distance between the two arrays.
      java.lang.String toString() 
      • Methods inherited from class java.lang.Object

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

      • toString

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

        public double d(T[] x,
                        T[] y)
        Returns Hamming distance between the two arrays.
        Specified by:
        d in interface Distance<T[]>
      • d

        public static int d(byte x,
                            byte y)
        Returns Hamming distance between the two bytes.
      • d

        public static int d(short x,
                            short y)
        Returns Hamming distance between the two shorts.
      • d

        public static int d(int x,
                            int y)
        Returns Hamming distance between the two integers.
      • d

        public static int d(long x,
                            long y)
        Returns Hamming distance between the two long integers.
      • d

        public static int d(byte[] x,
                            byte[] y)
        Returns Hamming distance between the two byte arrays.
      • d

        public static int d(short[] x,
                            short[] y)
        Returns Hamming distance between the two short arrays.
      • d

        public static int d(int[] x,
                            int[] y)
        Returns Hamming distance between the two integer arrays.
      • d

        public static int d(java.util.BitSet x,
                            java.util.BitSet y)
        Returns Hamming distance between the two BitSets.

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.