Example #1
0
        IntegralOutput IServiceIntegral.IntegralSeqTrapeze(IntegralInput input)
        {
            IntegralOutput result   = new IntegralOutput();
            SeqMeth        integral = new SeqMeth();

            result.result = integral.Trapeze(input.A, input.B, input.N, OperationContext.Current.GetCallbackChannel <IServiceInteralCallBack>().Integrand);
            return(result);
        }
Example #2
0
        public void TestSequentialTrapeze()
        {
            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);
        }