Accord.Math.Optimization.BinarySearch.FindRoot C# (CSharp) Method

FindRoot() public method

Attempts to find a root in the interval [a;b]
public FindRoot ( ) : int
return int
        public int FindRoot()
        {
            Solution = Find(Function, LowerBound, UpperBound, 0);
            Value = Function(Solution);
            return Solution;
        }

Usage Example

        public void ConstructorTest()
        {
            Func<int, double> function = x => x * x * x + 2 * x * x - 10 * x + 1;
            BinarySearch search = new BinarySearch(function, -4, 3);
            double root = search.FindRoot();

            Assert.AreEqual(0, root);
        }
All Usage Examples Of Accord.Math.Optimization.BinarySearch::FindRoot