Seeks a location of a (local) minimum of a unidimensional object function using user selected bracketing and locate algorithms from BracketingAlgorithm and LocateAlgorithm respectively and starting the iterative search in two directions from a given initial point.
minDistance parameter should be approximately the same magnitude as tolerance parameter.1E-5.300. If the number of iterations exceeds this number TooManyUniDimensionalIterationsException will be thrown.the point where the function has a local minimum (it can be greater or less than the initialPoint).
Remark: This approach in general will yield more precise results than SeekExtremeUnidir, for corresponding choices of the locate and bracketing algorithms, but will also be slower by a factor of two.
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 specific bracketing and locate algorithms which are used within this method, by passing as parameters the appropriate procedure from the classs BracketingAlgorithm and LocateAlgorithm.
The iterative search will begin from the point initialPoint,
with the accuracy of the result depending on the algorithms chosen and the
algorithms settings corresponding to the last four parameters. The last four
parameters do not have a general interpretation but there exact meaning
and use should become clear once the bracketing and location algorithms are
chosen and we refer the read to the corresponding documentation of the classs
BracketingAlgorithm and LocateAlgorithm,
or the Mathematical Documentation chapter of the PDF documentation for further details.
| Exception Type | Condition |
|---|---|
| TooManyUniDimensionalIterationsException | Thrown if the number of iterations in locate algorithms is greater than maxIterations. |
| InvalidUniDimensionalFunctionException | Thrown if the user function returns invalid values like infinity or NaN. |
| UniDimensionalException | Thrown if you use an algorithm which requires derivable functions but the delivered function does not implement the Derivative interface; also thrown if the delivered function does not implement an interface which extends Function. |
UniDimensionalSolver Class | WebCab.COM.Math.Optimization.UniDimensional Namespace