WebCab Optimization for COM v2.6

UniDimensionalSolver.SeekExtremeValueUnidir Method 

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.

public double SeekExtremeValueUnidir(
   double initialPoint,
   BracketingAlgorithm bracketingAlgorithm,
   LocateAlgorithm locateAlgorithm,
   double minDistance,
   double bracketingParameter,
   double tolerance,
   int maxIterations
);

Parameters

initialPoint
The initial point for which the iterative search from the extremum is started from.
bracketingAlgorithm
The bracketing algorithm used selected from the class BracketingAlgorithm.
locateAlgorithm
The locate algorithm used selected from the class LocateAlgorithm.
minDistance
This parameter is required by all bracketing algorithms within BracketingAlgorithm, and usually signifies the minimal distance between the end points of any bracketed interval in which the extremum lies. Therefore, the value used here should be approximately as large as the tolerance parameter.
bracketingParameter
This parameter is required by some bracketing algorithms. For a detailed explanation as to its meaning and use for particular bracketing algorithms selected please see the BracketingAlgorithm documentation or the Mathematical Documentation chapter of the accompanying PDF documentation.
tolerance
The tolerance used within the exit condition of the iterative locate algorithm used. A reasonable value to take for the tolerance is 1E-5.
maxIterations
The maximum number of iterations used only in the iterative locate algorithms, in such cases a reasonable value to use is 300. If the number of iterations exceeds this number TooManyUniDimensionalIterationsException will be thrown.

Return Value

the value of the object function at the (local) extremum found.

Remarks

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.

Application of this Approach

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.

Exceptions

Exception TypeCondition
TooManyUniDimensionalIterationsExceptionThrown if the exit criteria of the locate algorithm was not triggered and hence the (local) extremum found after maxIterations iterations.
InvalidUniDimensionalFunctionExceptionThrown if the object function given returns invalid values, such as NaN.
UniDimensionalExceptionThrown 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.

See Also

UniDimensionalSolver Class | WebCab.COM.Math.Optimization.UniDimensional Namespace | javascript:void | SeekExtremeBidir