public static void Main(string[] args) { Func <double, double> normDens = (x) => Math.Exp(-x * x / 2.0) / Math.Sqrt(2 * Math.PI); CompositeIntegrator integrator = new CompositeIntegrator(4); double integral = integrator.Integrate(normDens, 10, 0, 100); Console.WriteLine("{0}", integral); Console.ReadKey(); }
public CompositeIntegrator(CompositeIntegrator integrator) { newtonCotesOrder = integrator.newtonCotesOrder; quadraturePoints = new double[newtonCotesOrder + 1]; quadraturePointsFVal = new double[newtonCotesOrder + 1]; }