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

Function() public method

Symmetric Triangle 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)
        {
            double norm = 0.0;
            for (int i = 0; i < x.Length; i++)
            {
                double d = x[i] - y[i];
                norm += d * d;
            }

            double z = 1.0 - gamma * Math.Sqrt(norm);

            return (z > 0) ? z : 0;
        }

Same methods

SymmetricTriangle::Function ( double z ) : double