Пример #1
0
        /// <summary>
        /// Returns the approximation value.
        /// </summary>
        /// <param name="x">Array of argument values</param>
        /// <param name="y">Array of function values</param>
        /// <returns>Array</returns>
        public float[] Compute(float[] x, float[] y)
        {
            // chose method of approximation
            switch (method)
            {
            case Method.Polynomial:
                return(Approximation.poly(x, y, power, out _, out _, out _));

            case Method.Logarithmic:
                return(Approximation.logc(x, y, power, out _, out _, out _));

            case Method.Exponential:
                return(Approximation.expn(x, y, power, out _, out _, out _));

            default:
                return(Approximation.powr(x, y, power, out _, out _, out _));
            }
        }
Пример #2
0
        /// <summary>
        /// Returns the approximation value.
        /// </summary>
        /// <param name="x">Array of argument values</param>
        /// <param name="y">Array of function values</param>
        /// <param name="cf">Approximation coefficients</param>
        /// <param name="similarity">Similarity</param>
        /// <param name="equation">Equation</param>
        /// <returns>Array</returns>
        public Complex32[] Compute(Complex32[] x, Complex32[] y, out Complex32[] cf, out Complex32 similarity, out string equation)
        {
            // chose method of approximation
            switch (method)
            {
            case Method.Polynomial:
                return(Approximation.poly(x, y, power, out cf, out similarity, out equation));

            case Method.Logarithmic:
                return(Approximation.logc(x, y, power, out cf, out similarity, out equation));

            case Method.Exponential:
                return(Approximation.expn(x, y, power, out cf, out similarity, out equation));

            default:
                return(Approximation.powr(x, y, power, out cf, out similarity, out equation));
            }
        }