Package org.hipparchus.optim.univariate
Class BracketFinder
java.lang.Object
org.hipparchus.optim.univariate.BracketFinder
Provide an interval that brackets a local optimum of a function.
This code is based on a Python implementation (from SciPy,
module
optimize.py
v0.5).-
Constructor Summary
ConstructorDescriptionConstructor with default values100, 500
(see theother constructor
).BracketFinder
(double growLimit, int maxEvaluations) Create a bracketing interval finder. -
Method Summary
Modifier and TypeMethodDescriptionint
Get number of evaluations.double
getFHi()
Get function value atgetHi()
.double
getFLo()
Get function value atgetLo()
.double
getFMid()
Get function value atgetMid()
.double
getHi()
Get higher bound of the bracket.double
getLo()
Get lower bound of the bracket.int
Get maximum number of evaluations.double
getMid()
Get a point in the middle of the bracket.void
search
(UnivariateFunction func, GoalType goal, double xA, double xB) Search new points that bracket a local optimum of the function.
-
Constructor Details
-
BracketFinder
public BracketFinder()Constructor with default values100, 500
(see theother constructor
). -
BracketFinder
public BracketFinder(double growLimit, int maxEvaluations) Create a bracketing interval finder.- Parameters:
growLimit
- Expanding factor.maxEvaluations
- Maximum number of evaluations allowed for finding a bracketing interval.
-
-
Method Details
-
search
Search new points that bracket a local optimum of the function.- Parameters:
func
- Function whose optimum should be bracketed.goal
-Goal type
.xA
- Initial point.xB
- Initial point.- Throws:
MathIllegalStateException
- if the maximum number of evaluations is exceeded.
-
getMaxEvaluations
public int getMaxEvaluations()Get maximum number of evaluations.- Returns:
- the maximum number of evaluations
-
getEvaluations
public int getEvaluations()Get number of evaluations.- Returns:
- the number of evaluations
-
getLo
public double getLo()Get lower bound of the bracket.- Returns:
- the lower bound of the bracket
- See Also:
-
getFLo
public double getFLo()Get function value atgetLo()
.- Returns:
- function value at
getLo()
-
getHi
public double getHi()Get higher bound of the bracket.- Returns:
- the higher bound of the bracket
- See Also:
-
getFHi
public double getFHi()Get function value atgetHi()
.- Returns:
- function value at
getHi()
-
getMid
public double getMid()Get a point in the middle of the bracket.- Returns:
- a point in the middle of the bracket
- See Also:
-
getFMid
public double getFMid()Get function value atgetMid()
.- Returns:
- function value at
getMid()
-