Пример #1
0
        IntegralOutput IServiceIntegral.IntegralSeqRectangleMedium(IntegralInput Input)
        {
            IntegralOutput result   = new IntegralOutput();
            SeqMeth        integral = new SeqMeth();

            result.result = integral.RectangleMedium(Input.A, Input.B, Input.N, OperationContext.Current.GetCallbackChannel <IServiceInteralCallBack>().Integrand);
            return(result);
        }
Пример #2
0
        IntegralOutput IServiceIntegral.IntegralSeqSimpson(IntegralInput input)
        {
            IntegralOutput result   = new IntegralOutput();
            SeqMeth        integral = new SeqMeth();

            result.result = integral.Simpson(input.A, input.B, input.N, OperationContext.Current.GetCallbackChannel <IServiceInteralCallBack>().Integrand);
            return(result);
        }
Пример #3
0
        public void TestSequentialRectangle()
        {
            SeqMeth sm       = new SeqMeth();
            double  a        = 1;
            double  b        = 10000;
            int     N        = 10000000;
            double  ans      = sm.RectangleMedium(a, b, N, (x) => x * x);
            double  expected = 333333333333;

            Assert.AreEqual(expected, ans, 1);
        }
Пример #4
0
        public void TestSequenticalSimpson()
        {
            SeqMeth sm       = new SeqMeth();
            double  a        = 1;
            double  b        = 10000;
            int     N        = 10000000;
            double  ans      = sm.Simpson(a, b, N, (x) => x * x);
            double  expected = 333333333333;

            Assert.AreEqual(expected, ans, 1);
        }
Пример #5
0
        public void TestSeqTrapeze()
        {
            SeqMeth sm       = new SeqMeth();
            double  a        = 1;
            double  b        = 10000;
            int     N        = 10000000;
            double  ans      = sm.Trapeze(a, b, N, (x) => x * x);
            double  expected = 333333333333;

            Assert.AreEqual(expected, ans, 1);
        }