Class PowellOptimizer.LineSearch
java.lang.Object
org.apache.commons.math3.optimization.univariate.BaseAbstractUnivariateOptimizer
org.apache.commons.math3.optimization.univariate.BrentOptimizer
org.apache.commons.math3.optimization.direct.PowellOptimizer.LineSearch
- All Implemented Interfaces:
BaseOptimizer<UnivariatePointValuePair>
,BaseUnivariateOptimizer<UnivariateFunction>
,UnivariateOptimizer
- Enclosing class:
PowellOptimizer
Class for finding the minimum of the objective function along a given
direction.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final double
Value that will pass the precondition check forBrentOptimizer
but will not pass the convergence check, so that the custom checker will always decide when to stop the line search.private final BracketFinder
Automatic bracketing.private static final double
Value that will pass the precondition check forBrentOptimizer
but will not pass the convergence check, so that the custom checker will always decide when to stop the line search. -
Constructor Summary
ConstructorsConstructorDescriptionLineSearch
(double rel, double abs) The "BrentOptimizer" default stopping criterion uses the tolerances to check the domain (point) values, not the function values. -
Method Summary
Modifier and TypeMethodDescriptionsearch
(double[] p, double[] d) Find the minimum of the functionf(p + alpha * d)
.Methods inherited from class org.apache.commons.math3.optimization.univariate.BrentOptimizer
doOptimize
Methods inherited from class org.apache.commons.math3.optimization.univariate.BaseAbstractUnivariateOptimizer
computeObjectiveValue, getConvergenceChecker, getEvaluations, getGoalType, getMax, getMaxEvaluations, getMin, getStartValue, optimize, optimize
-
Field Details
-
REL_TOL_UNUSED
private static final double REL_TOL_UNUSEDValue that will pass the precondition check forBrentOptimizer
but will not pass the convergence check, so that the custom checker will always decide when to stop the line search.- See Also:
-
ABS_TOL_UNUSED
private static final double ABS_TOL_UNUSEDValue that will pass the precondition check forBrentOptimizer
but will not pass the convergence check, so that the custom checker will always decide when to stop the line search.- See Also:
-
bracket
Automatic bracketing.
-
-
Constructor Details
-
LineSearch
LineSearch(double rel, double abs) The "BrentOptimizer" default stopping criterion uses the tolerances to check the domain (point) values, not the function values. We thus create a custom checker to use function values.- Parameters:
rel
- Relative threshold.abs
- Absolute threshold.
-
-
Method Details
-
search
Find the minimum of the functionf(p + alpha * d)
.- Parameters:
p
- Starting point.d
- Search direction.- Returns:
- the optimum.
- Throws:
TooManyEvaluationsException
- if the number of evaluations is exceeded.
-