Encog.MathUtil.LIBSVM.Kernel.kernel_function C# (CSharp) Method

kernel_function() private method

private kernel_function ( int i, int j ) : double
i int
j int
return double
        internal virtual double kernel_function(int i, int j)
        {
            switch (kernel_type)
            {
                case svm_parameter.LINEAR:
                    return dot(x[i], x[j]);

                case svm_parameter.POLY:
                    return Math.Pow(gamma*dot(x[i], x[j]) + coef0, degree);

                case svm_parameter.RBF:
                    return Math.Exp((- gamma)*(x_square[i] + x_square[j] - 2*dot(x[i], x[j])));

                case svm_parameter.SIGMOID:
                    return tanh(gamma*dot(x[i], x[j]) + coef0);

                default:
                    return 0; // java
            }
        }