황금비-분할법 (Golden Section ) 알고리즘을 이용하여 특정 함수의 [lower, upper]구간에서 func(x)의 최소값의 위치를 찾는다.
Inheritance: MinimumFinderBase
コード例 #1
0
        public void GoldenSectionMinimumFinderTest() {
            const double lower = -500;
            const double upper = 0;

            Func<double, double> f = F;

            var golden = new GoldenSectionMinimumFinder();

            var x = golden.FindMiminum(f, lower, upper);

            if(IsDebugEnabled)
                log.Debug(@"{0} : {1}", golden, x);

            Assert.AreNotEqual(double.NaN, x);

            if(IsDebugEnabled)
                log.Debug("func({0}) = {1}", x, f(x));
        }
コード例 #2
0
        public void GoldenSectionMinimumFinderTest()
        {
            const double lower = -500;
            const double upper = 0;

            Func <double, double> f = F;

            var golden = new GoldenSectionMinimumFinder();

            var x = golden.FindMiminum(f, lower, upper);

            if (IsDebugEnabled)
            {
                log.Debug(@"{0} : {1}", golden, x);
            }

            Assert.AreNotEqual(double.NaN, x);

            if (IsDebugEnabled)
            {
                log.Debug("func({0}) = {1}", x, f(x));
            }
        }