Exemplo n.º 1
0
        /// <summary>
        /// Calculates the Hanning distance between two sets of points.
        /// <see href="http://en.wikipedia.org/wiki/Hamming_distance" />
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <returns></returns>
        public static Number Hanning(Number[]x, Number[] y)
        {
            CheckArgumentLengths(x, y);

            return x.Zip(y, (l, r) => l.Equals(r) ? 0 : 1).Sum();
        }