|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.math3.optimization.univariate.BaseAbstractUnivariateOptimizer
org.apache.commons.math3.optimization.univariate.BrentOptimizer
public class BrentOptimizer
Implements Richard Brent's algorithm (from his book "Algorithms for
Minimization without Derivatives", p. 79) for finding minima of real
univariate functions. This implementation is an adaptation partly
based on the Python code from SciPy (module "optimize.py" v0.5).
If the function is defined on some interval (lo, hi)
, then
this method finds an approximation x
to the point at which
the function attains its minimum.
Field Summary | |
---|---|
private double |
absoluteThreshold
Absolute threshold. |
private static double |
GOLDEN_SECTION
Golden section. |
private static double |
MIN_RELATIVE_TOLERANCE
Minimum relative tolerance. |
private double |
relativeThreshold
Relative threshold. |
Constructor Summary | |
---|---|
BrentOptimizer(double rel,
double abs)
The arguments are used implement the original stopping criterion of Brent's algorithm. |
|
BrentOptimizer(double rel,
double abs,
ConvergenceChecker<UnivariatePointValuePair> checker)
The arguments are used implement the original stopping criterion of Brent's algorithm. |
Method Summary | |
---|---|
protected UnivariatePointValuePair |
doOptimize()
Method for implementing actual optimization algorithms in derived classes. |
Methods inherited from class org.apache.commons.math3.optimization.univariate.BaseAbstractUnivariateOptimizer |
---|
computeObjectiveValue, getConvergenceChecker, getEvaluations, getGoalType, getMax, getMaxEvaluations, getMin, getStartValue, optimize, optimize |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final double GOLDEN_SECTION
private static final double MIN_RELATIVE_TOLERANCE
private final double relativeThreshold
private final double absoluteThreshold
Constructor Detail |
---|
public BrentOptimizer(double rel, double abs, ConvergenceChecker<UnivariatePointValuePair> checker)
abs
and rel
define a tolerance
tol = rel |x| + abs
. rel
should be no smaller than
2 macheps and preferably not much less than sqrt(macheps),
where macheps is the relative machine precision. abs
must
be positive.
rel
- Relative threshold.abs
- Absolute threshold.checker
- Additional, user-defined, convergence checking
procedure.
NotStrictlyPositiveException
- if abs <= 0
.
NumberIsTooSmallException
- if rel < 2 * Math.ulp(1d)
.public BrentOptimizer(double rel, double abs)
abs
and rel
define a tolerance
tol = rel |x| + abs
. rel
should be no smaller than
2 macheps and preferably not much less than sqrt(macheps),
where macheps is the relative machine precision. abs
must
be positive.
rel
- Relative threshold.abs
- Absolute threshold.
NotStrictlyPositiveException
- if abs <= 0
.
NumberIsTooSmallException
- if rel < 2 * Math.ulp(1d)
.Method Detail |
---|
protected UnivariatePointValuePair doOptimize()
doOptimize
in class BaseAbstractUnivariateOptimizer
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |