Seeks the global extreme within an interval of an unidimensional optimization problem with a general object function using information from a user selected set of locate and bracketing algorithms.
extremumType == ExtremumTypes.MINIMUM; and in the case of a maximum, extremumType == ExtremumTypes.MAXIMUM.(result - tolerance, result + tolerance). Hence, the value for the tolerance, should reflect the level of accuracy required.300. If the number of iterations exceeds this number TooManyUniDimensionalIterationsException will be thrown.the coordinate value of the location of the global extremum within the interval considered of the unidimensional optimization problem considered.
This method uses a user defined set of bracketing and locate algorithms from which the "best" point
is selected during each iteration in order to improve accuracy in a similar fashion to
SeekNextExtreme. However in addition, by varying the noSubIntervals
parameter we are able to ensures that the maximum advancing
step for each iteration is: (upperBound - lowerBound) / noSubIntervals, where lowerBound
and upperBound are the end points of the interval over which the global extremum is sought.
These two processes reduce the probability to missing a local extremes which are each candidates
of the global extremum being sought within the interval considered which is being sought.
Remark: In addition to this method we also offer the method GlobalExtreme, which is similar in approach to this method except that we have provide a default set of bracketing and locate algorithms which are used at each step.
Before this method is called the uni-dimensional object function of the optimization problem must be set (i.e. provided for the method) using either {@link #setFunction}, or passed using the constructor during the instantiation of the instance of the UniDimensionalSolver class. For further details, detailing exactly how the object function is implemented and then send to an instance of this class we refer the reader to SetFunction documentation. In is true that most users will find the {@link #setFunction} approach to be more user friendly, however it should be pointed out that if your application uses threads then this approach is not thread safe.
Once the object function has been set you should specify the set of bracketing and locate algorithms which are used within this method, by passing as parameters the appropriate procedures from the classs BracketingAlgorithm and LocateAlgorithm.
Finally the initialPoint from which the closest local extremum will be sought
within the interval consider, the type of extremum required, the tolerance and the maximum number
of iterations used.
| Exception Type | Condition |
|---|---|
| UniDimensionalException | Thrown if the delivered function does not implement Function or an interface which extends Function; also thrown if you use a bracketing or locate algorithm which needs derivable functions and your function does not implement Derivative or an interface which extends it. |
| InvalidUniDimensionalFunctionException | Thrown if the user function returns invalid values like infinity or NaN. |
| TooManyUniDimensionalIterationsException | Thrown if the number of iterations is greater than maxIterations. |
UniDimensionalSolver Class | WebCab.COM.Math.Optimization.UniDimensional Namespace