org.apache.commons.math.optimization.univariate
public class BrentOptimizer extends AbstractUnivariateRealOptimizer
Modifier and Type | Field and Description |
---|---|
private static double |
GOLDEN_SECTION
Golden section.
|
functionValue, result, resultComputed
absoluteAccuracy, defaultAbsoluteAccuracy, defaultMaximalIterationCount, defaultRelativeAccuracy, iterationCount, maximalIterationCount, relativeAccuracy
Constructor and Description |
---|
BrentOptimizer()
Construct a solver.
|
Modifier and Type | Method and Description |
---|---|
protected double |
doOptimize()
Method for implementing actual optimization algorithms in derived
classes.
|
private double |
localMin(boolean isMinim,
double lo,
double mid,
double hi,
double eps,
double t)
Find the minimum of the function within the interval
(lo, hi) . |
checkResultComputed, clearResult, computeObjectiveValue, computeObjectiveValue, getEvaluations, getFunctionValue, getGoalType, getMax, getMaxEvaluations, getMin, getResult, getStartValue, optimize, optimize, setFunctionValue, setMaxEvaluations, setResult
getAbsoluteAccuracy, getIterationCount, getMaximalIterationCount, getRelativeAccuracy, incrementIterationsCounter, resetAbsoluteAccuracy, resetIterationsCounter, resetMaximalIterationCount, resetRelativeAccuracy, setAbsoluteAccuracy, setMaximalIterationCount, setRelativeAccuracy
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAbsoluteAccuracy, getIterationCount, getMaximalIterationCount, getRelativeAccuracy, resetAbsoluteAccuracy, resetMaximalIterationCount, resetRelativeAccuracy, setAbsoluteAccuracy, setMaximalIterationCount, setRelativeAccuracy
protected double doOptimize() throws MaxIterationsExceededException, FunctionEvaluationException
AbstractUnivariateRealOptimizer.optimize(UnivariateRealFunction, GoalType, double, double)
.doOptimize
in class AbstractUnivariateRealOptimizer
MaxIterationsExceededException
- if the maximum iteration count
is exceeded.FunctionEvaluationException
- if an error occurs evaluating
the function.private double localMin(boolean isMinim, double lo, double mid, double hi, double eps, double t) throws MaxIterationsExceededException, FunctionEvaluationException
(lo, hi)
.
If the function is defined on the interval (lo, hi)
, then
this method finds an approximation x
to the point at which
the function attains its minimum.t
and eps
define a tolerance tol = eps |x| + t
and the function is never evaluated at two points closer together than
tol
. eps
should be no smaller than 2 macheps and
preferable not much less than sqrt(macheps), where
macheps is the relative machine precision. t
should be
positive.isMinim
- true
when minimizing the function.lo
- Lower bound of the interval.mid
- Point inside the interval [lo, hi]
.hi
- Higher bound of the interval.eps
- Relative accuracy.t
- Absolute accuracy.MaxIterationsExceededException
- if the maximum iteration count
is exceeded.FunctionEvaluationException
- if an error occurs evaluating the function.Copyright (c) 2003-2014 Apache Software Foundation