Accord.Statistics.Distributions.DensityKernels.UniformKernel.Function C# (CSharp) Method

Function() public method

Computes the kernel density function.
public Function ( double x ) : double
x double The input point.
return double
        public double Function(double[] x)
        {
            double norm = 0.0;
            for (int i = 0; i < x.Length; i++)
                norm += x[i] * x[i];

            if (norm <= 1)
                return constant;
            return 0;
        }