Class BracketFinder
- java.lang.Object
-
- org.apache.commons.math.optimization.univariate.BracketFinder
-
public class BracketFinder extends java.lang.Object
Provide an interval that brackets a local optimum of a function. This code is based on a Python implementation (from SciPy, moduleoptimize.py
v0.5).- Since:
- 2.2
- Version:
- $Revision$ $Date$
-
-
Constructor Summary
Constructors Constructor Description BracketFinder()
Constructor with default values100, 50
(see theother constructor
).BracketFinder(double growLimit, int maxIterations)
Create a bracketing interval finder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getEvaluations()
double
getFHi()
Get function value atgetHi()
.double
getFLow()
Get function value atgetLo()
.double
getFMid()
Get function value atgetMid()
.double
getHi()
int
getIterations()
double
getLo()
double
getMid()
void
search(UnivariateRealFunction func, GoalType goal, double xA, double xB)
Search new points that bracket a local optimum of the function.
-
-
-
Constructor Detail
-
BracketFinder
public BracketFinder()
Constructor with default values100, 50
(see theother constructor
).
-
BracketFinder
public BracketFinder(double growLimit, int maxIterations)
Create a bracketing interval finder.- Parameters:
growLimit
- Expanding factor.maxIterations
- Maximum number of iterations allowed for finding a bracketing interval.
-
-
Method Detail
-
search
public void search(UnivariateRealFunction func, GoalType goal, double xA, double xB) throws MaxIterationsExceededException, FunctionEvaluationException
Search new points that bracket a local optimum of the function.- Parameters:
func
- Function whose optimum should be bracketted.goal
-Goal type
.xA
- Initial point.xB
- Initial point.- Throws:
MaxIterationsExceededException
- if the maximum iteration count is exceeded.FunctionEvaluationException
- if an error occurs evaluating the function.
-
getIterations
public int getIterations()
- Returns:
- the number of iterations.
-
getEvaluations
public int getEvaluations()
- Returns:
- the number of evaluations.
-
getLo
public double getLo()
- Returns:
- the lower bound of the bracket.
- See Also:
getFLow()
-
getHi
public double getHi()
- Returns:
- the higher bound of the bracket.
- See Also:
getFHi()
-
getMid
public double getMid()
- Returns:
- a point in the middle of the bracket.
- See Also:
getFMid()
-
-