smile.math.distance
Class HammingDistance<T>
- java.lang.Object
-
- smile.math.distance.HammingDistance<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 intd(java.util.BitSet x, java.util.BitSet y)Returns Hamming distance between the two BitSets.static intd(byte[] x, byte[] y)Returns Hamming distance between the two byte arrays.static intd(byte x, byte y)Returns Hamming distance between the two bytes.static intd(int[] x, int[] y)Returns Hamming distance between the two integer arrays.static intd(int x, int y)Returns Hamming distance between the two integers.static intd(long x, long y)Returns Hamming distance between the two long integers.static intd(short[] x, short[] y)Returns Hamming distance between the two short arrays.static intd(short x, short y)Returns Hamming distance between the two shorts.doubled(T[] x, T[] y)Returns Hamming distance between the two arrays.java.lang.StringtoString()
-
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
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