Accord.Statistics.Kernels.Power.Function C# (CSharp) Method

Function() public method

Power Kernel Function
public Function ( double x, double y ) : double
x double Vector x in input space.
y double Vector y in input space.
return double
        public override double Function(double[] x, double[] y)
        {
            // Optimization in case x and y are
            // exactly the same object reference.

            if (x == y)
                return 0.0;

            double norm = 0.0;
            for (int i = 0; i < x.Length; i++)
            {
                double d = x[i] - y[i];
                norm += d * d;
            }

            return -System.Math.Pow(norm, degree);
        }

Same methods

Power::Function ( double z ) : double