예제 #1
0
        public Func <double, double> GetResult()
        {
            double resultantFun(double x)
            {
                double result = 0;

                for (int k = 0; k < m; k++)
                {
                    double factor = _Factors[k];
                    double poly   = _Polynomials[k](x);
                    result += factor * poly;
                }
                return(result);
            }

            return(resultantFun);
        }
예제 #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="factors"></param>
 /// <param name="polynomials"></param>
 /// <param name="m">degree of the resultant polynomial</param>
 public Approximation(double[] factors, HermitePolynomials polynomials, double degree)
 {
     _Factors     = factors;
     _Polynomials = polynomials;
     m            = degree;
 }