internal ConvProbCalc(ConvolutionCalculator cc, double nLeadTimes)
        {
            this.cc         = cc;
            this.nLeadTimes = nLeadTimes;
            this.rs         = new RootSearch(0.1, 0.01, 100);
            this.bisection  = false;

            min = double.MaxValue;
            max = double.MinValue;
            foreach (double d in cc.Data)
            {
                if (d < min)
                {
                    min = d;
                }
                if (d > max)
                {
                    max = d;
                }
            }
            if (min == max)
            {
                this.maxInt = min;
                this.minInt = min;
                return;
            }
            this.maxInt = GetMaxInt();
            this.minInt = GetMinInt();
        }
Example #2
0
        public void NewtonMethodTest()
        {
            double expected = 2;

            double actual = RootSearch.NewtonMethod(8, 3, 0.0001);

            Assert.AreEqual(2, actual, 0.0001);
        }