Finds the value of the unidimensional object function at the local extremum (maximum or minimum) found, where the specific bracketing and locate algorithms from the class's BracketingAlgorithm and LocateAlgorithm are set and the initial point given.
tolerance parameter.1E-5.300. If the number of iterations exceeds this number TooManyUniDimensionalIterationsException will be thrown.the value of the object function at the (local) extremum found.
In order to find the location of the extremum you may use SeekExtremeUnidir, which applied the same algorithm except returns the location of the extremum rather than the value of the object function at a extremum.
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 exit criteria of the locate algorithm was not triggered and hence the (local) extremum found after maxIterations iterations. |
| InvalidUniDimensionalFunctionException | Thrown if the object function given returns invalid values, such as NaN. |
| UniDimensionalException | Thrown if algorithms selected require a differentiable function but one has not been set, or if the no function has been set. In particular, in the case of a differentiable function the Derivative interface will need to be implemented and in the case of a general function the Function interface will need to be implemented. |
UniDimensionalSolver Class | WebCab.COM.Math.Optimization.UniDimensional Namespace | javascript:void | SeekExtremeBidir