Ejemplo n.º 1
0
        public override RrFunction Integral(double basePoint)
        {
            var zeroBaseIntegrals = Enumerable.Range(0, abscissae.Length)
                                    .Map(i => i == 0 ? 0.0 : values[i - 1] * (abscissae[i] - abscissae[i - 1]))
                                    .Scan(0.0, (sum, current) => sum + current);
            var zeroBasedIntegral = RrFunctions.LinearInterpolation(abscissae, zeroBaseIntegrals,
                                                                    leftValue, values[values.Length - 1]);

            return(zeroBasedIntegral - zeroBasedIntegral.Eval(basePoint));
        }
Ejemplo n.º 2
0
 public override RrFunction Integral(double basePoint)
 {
     return(RrFunctions.LinearInterpolation(new[] { basePoint }, new[] { 0.0 }, Value, Value));
 }