Beispiel #1
0
        private void btnHerCount_Click(object sender, EventArgs e)
        {
            double result = 0, lim, eps;
            int nodes;

            double.TryParse(tbBladObliczen2.Text, out eps);
            double.TryParse(lbLim.Text, out lim);
            int.TryParse(comboNodes.Text, out nodes);

            if (rbHermit.Checked == true)
            {
                HermiteIntegrator integrator = new HermiteIntegrator();
                lim = integrator.LimitCount(functions[cbFunction.SelectedIndex], eps);
                result = integrator.Integrate(functions[cbFunction.SelectedIndex], nodes);
            }
            else if (rbLag.Checked == true)
            {
                LaguerreIntegrator integrator = new LaguerreIntegrator();
                lim = integrator.LimitCount(functions[cbFunction.SelectedIndex], eps);
                result = integrator.Integrate(functions[cbFunction.SelectedIndex], nodes);
            }

            lbLim.Text = lim.ToString();
            lbHerLagResult.Text = result.ToString();
        }
Beispiel #2
0
 static void Main(string[] args)
 {
     Console.WriteLine(SimpsonIntegrator.Integrate(x => x * x, 0, 2, 0.01));
     LaguerreIntegrator lagIntegrator = new LaguerreIntegrator();
     lagIntegrator.initializeListOfQuadratures(5);
     Console.WriteLine(lagIntegrator.Integrate(new Function(), lagIntegrator.fiveNodesQuadratures));
     HermiteIntegrator herIntegrator = new HermiteIntegrator();
     herIntegrator.initializeListOfQuadratures(5);
     Console.WriteLine(herIntegrator.Integrate(new Function(), herIntegrator.fiveNodesQuadratures));
     Console.ReadKey();
 }