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)); }
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)); } }