Accord.Statistics.Tools.Distance C# (CSharp) Method

Distance() public static method

Computes the kernel distance for a kernel function even if it doesn't implement the Accord.Math.Distances.IDistance interface. Can be used to check the proper implementation of the distance function.
public static Distance ( this kernel, double x, double y ) : double
kernel this The kernel function whose distance needs to be evaluated.
x double An input point x given in input space.
y double An input point y given in input space.
return double
        public static double Distance(this IKernel kernel, double[] x, double[] y)
        {
            return kernel.Function(x, x) + kernel.Function(y, y) - 2 * kernel.Function(x, y);
        }