Evaluates the location of a (local) extremum (i.e. maximum or minimum) of the unidimensional object function, where the specific bracketing and locate algorithms from the classs BracketingAlgorithm and LocateAlgorithm are set and the initial point given.
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.an object containing the point where the function has a local extremum greater than initialPoint and the type of that extremum (-1 when we have a maximum; 1 when we have a minimum
This method returns the type Extremum which contains the coordinate value of the extremum sought of the type of extremum found (i.e. whether maximum or minimum). In order to find the value of the object function at the extremum found you may use SeekExtremeValueUnidir, which applied the same algorithm except but returns the value of the object function at the extremum rather than the coordinate value of the extremum found.
Remark: This approach in general will yield less precise results than SeekExtremeBidir, for corresponding choices of the locate and bracketing algorithms, but will also also be faster 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 | applies the same algorithm except that here the value of the object function at the extremum found (i.e. maximum or minimum) is returned.