Top Description Inners Fields Constructors Methods
org.apache.commons.math3.optimization.direct

public Class PowellOptimizer

extends BaseAbstractMultivariateOptimizer<MultivariateFunction>
implements MultivariateOptimizer
Class Inheritance
All Implemented Interfaces
org.apache.commons.math3.optimization.MultivariateOptimizer, org.apache.commons.math3.optimization.BaseMultivariateOptimizer, org.apache.commons.math3.optimization.BaseOptimizer
Annotations
@Deprecated
Imports
org.apache.commons.math3.util.FastMath, .MathArrays, org.apache.commons.math3.analysis.UnivariateFunction, .MultivariateFunction, org.apache.commons.math3.exception.NumberIsTooSmallException, .NotStrictlyPositiveException, org.apache.commons.math3.optimization.GoalType, .PointValuePair, .ConvergenceChecker, .MultivariateOptimizer, org.apache.commons.math3.optimization.univariate.BracketFinder, .BrentOptimizer, .UnivariatePointValuePair, .SimpleUnivariateValueChecker

Deprecated

As of 3.1 (to be removed in 4.0).

Powell algorithm. This code is translated and adapted from the Python version of this algorithm (as implemented in module optimize.py v0.5 of SciPy).
The default stopping criterion is based on the differences of the function value between two successive iterations. It is however possible to define a custom convergence checker that might terminate the algorithm earlier.
The internal line search optimizer is a BrentOptimizer with a convergence checker set to SimpleUnivariateValueChecker.
Since
2.2

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
PowellOptimizer.LineSearch

Deprecated as a consequence of BrentOptimizer being deprecated.
Class for finding the minimum of the objective function along a given direction.

Field Summary

Modifier and TypeField and Description
private final double
absoluteThreshold

Absolute threshold.

private final PowellOptimizer.LineSearch
line

Deprecated as a consequence of PowellOptimizer.LineSearch being deprecated.
Line search.
private static final double
MIN_RELATIVE_TOLERANCE

Minimum relative tolerance.

private final double
relativeThreshold

Relative threshold.

Inherited from org.apache.commons.math3.optimization.direct.BaseAbstractMultivariateOptimizer:
evaluations

Constructor Summary

AccessConstructor and Description
public
PowellOptimizer(double
Relative threshold.
rel
,
double
Absolute threshold.
abs
,
ConvergenceChecker<PointValuePair>
Convergence checker.
checker
)
Deprecated as a consequence of ConvergenceChecker being deprecated.

This constructor allows to specify a user-defined convergence checker, in addition to the parameters that control the default convergence checking procedure.

public
PowellOptimizer(double
Relative threshold for this optimizer.
rel
,
double
Absolute threshold for this optimizer.
abs
,
double
Relative threshold for the internal line search optimizer.
lineRel
,
double
Absolute threshold for the internal line search optimizer.
lineAbs
,
ConvergenceChecker<PointValuePair>
Convergence checker.
checker
)
Deprecated as a consequence of ConvergenceChecker being deprecated.

This constructor allows to specify a user-defined convergence checker, in addition to the parameters that control the default convergence checking procedure and the line search tolerances.

public
PowellOptimizer(double
Relative threshold.
rel
,
double
Absolute threshold.
abs
)

The parameters control the default convergence checking procedure.

public
PowellOptimizer(double
Relative threshold.
rel
,
double
Absolute threshold.
abs
,
double
Relative threshold for the internal line search optimizer.
lineRel
,
double
Absolute threshold for the internal line search optimizer.
lineAbs
)

Builds an instance with the default convergence checking procedure.

Method Summary

Modifier and TypeMethod and Description
protected PointValuePair
doOptimize()

Implements abstract org.apache.commons.math3.optimization.direct.BaseAbstractMultivariateOptimizer.doOptimize.

Deprecated as a consequence of PointValuePair being deprecated.

Perform the bulk of the optimization algorithm.

private double[][]

Returns:

a 2-element array containing the new point (at index 0) and the new direction (at index 1).
newPointAndDirection
(double[]
Point used in the line search.
p
,
double[]
Direction used in the line search.
d
,
double
Optimum found by the line search.
optimum
)

Compute a new point (in the original space) and a new direction vector, resulting from the line search.

Inherited from org.apache.commons.math3.optimization.direct.BaseAbstractMultivariateOptimizer:
computeObjectiveValuegetConvergenceCheckergetEvaluationsgetGoalTypegetLowerBoundgetMaxEvaluationsgetStartPointgetUpperBoundoptimizeoptimizeoptimizeInternaloptimizeInternal

Field Detail

absoluteThresholdback to summary
private final double absoluteThreshold

Absolute threshold.

lineback to summary
private final PowellOptimizer.LineSearch line

Deprecated

as a consequence of PowellOptimizer.LineSearch being deprecated. See corresponding docs for further information.

Line search.

MIN_RELATIVE_TOLERANCEback to summary
private static final double MIN_RELATIVE_TOLERANCE

Minimum relative tolerance.

relativeThresholdback to summary
private final double relativeThreshold

Relative threshold.

Constructor Detail

PowellOptimizerback to summary
public PowellOptimizer(double rel, double abs, ConvergenceChecker<PointValuePair> checker)

Deprecated

as a consequence of ConvergenceChecker being deprecated. See corresponding docs for further information.

This constructor allows to specify a user-defined convergence checker, in addition to the parameters that control the default convergence checking procedure.
The internal line search tolerances are set to the square-root of their corresponding value in the multivariate optimizer.

Parameters
rel:double

Relative threshold.

abs:double

Absolute threshold.

checker:ConvergenceChecker<PointValuePair>

Convergence checker.

Exceptions
NotStrictlyPositiveException:
if abs <= 0.
NumberIsTooSmallException:
if rel < 2 * Math.ulp(1d).
PowellOptimizerback to summary
public PowellOptimizer(double rel, double abs, double lineRel, double lineAbs, ConvergenceChecker<PointValuePair> checker)

Deprecated

as a consequence of ConvergenceChecker being deprecated. See corresponding docs for further information.

This constructor allows to specify a user-defined convergence checker, in addition to the parameters that control the default convergence checking procedure and the line search tolerances.

Parameters
rel:double

Relative threshold for this optimizer.

abs:double

Absolute threshold for this optimizer.

lineRel:double

Relative threshold for the internal line search optimizer.

lineAbs:double

Absolute threshold for the internal line search optimizer.

checker:ConvergenceChecker<PointValuePair>

Convergence checker.

Exceptions
NotStrictlyPositiveException:
if abs <= 0.
NumberIsTooSmallException:
if rel < 2 * Math.ulp(1d).
PowellOptimizerback to summary
public PowellOptimizer(double rel, double abs)

The parameters control the default convergence checking procedure.
The internal line search tolerances are set to the square-root of their corresponding value in the multivariate optimizer.

Parameters
rel:double

Relative threshold.

abs:double

Absolute threshold.

Exceptions
NotStrictlyPositiveException:
if abs <= 0.
NumberIsTooSmallException:
if rel < 2 * Math.ulp(1d).
PowellOptimizerback to summary
public PowellOptimizer(double rel, double abs, double lineRel, double lineAbs)

Builds an instance with the default convergence checking procedure.

Parameters
rel:double

Relative threshold.

abs:double

Absolute threshold.

lineRel:double

Relative threshold for the internal line search optimizer.

lineAbs:double

Absolute threshold for the internal line search optimizer.

Exceptions
NotStrictlyPositiveException:
if abs <= 0.
NumberIsTooSmallException:
if rel < 2 * Math.ulp(1d).
Since
3.1

Method Detail

doOptimizeback to summary
protected PointValuePair doOptimize()

Implements abstract org.apache.commons.math3.optimization.direct.BaseAbstractMultivariateOptimizer.doOptimize.

Doc from org.apache.commons.math3.optimization.direct.BaseAbstractMultivariateOptimizer.doOptimize.

Deprecated

as a consequence of PointValuePair being deprecated. See corresponding docs for further information.

Perform the bulk of the optimization algorithm.

Returns:PointValuePair

the point/value pair giving the optimal value of the objective function.

Annotations
@Override
newPointAndDirectionback to summary
private double[][] newPointAndDirection(double[] p, double[] d, double optimum)

Compute a new point (in the original space) and a new direction vector, resulting from the line search.

Parameters
p:double[]

Point used in the line search.

d:double[]

Direction used in the line search.

optimum:double

Optimum found by the line search.

Returns:double[][]

a 2-element array containing the new point (at index 0) and the new direction (at index 1).

org.apache.commons.math3.optimization.direct back to summary

private Class PowellOptimizer.LineSearch

extends BrentOptimizer
Class Inheritance

Deprecated

as a consequence of BrentOptimizer being deprecated. See corresponding docs for further information.

Class for finding the minimum of the objective function along a given direction.

Field Summary

Modifier and TypeField and Description
private static final double
ABS_TOL_UNUSED

Value that will pass the precondition check for BrentOptimizer but will not pass the convergence check, so that the custom checker will always decide when to stop the line search.

private final BracketFinder
bracket

Deprecated as a consequence of BracketFinder being deprecated.
Automatic bracketing.
private static final double
REL_TOL_UNUSED

Value that will pass the precondition check for BrentOptimizer but will not pass the convergence check, so that the custom checker will always decide when to stop the line search.

Constructor Summary

AccessConstructor and Description
pack-priv
LineSearch(double
Relative threshold.
rel
,
double
Absolute threshold.
abs
)

The "BrentOptimizer" default stopping criterion uses the tolerances to check the domain (point) values, not the function values.

Method Summary

Modifier and TypeMethod and Description
public UnivariatePointValuePair

Returns:

the optimum.
search
(final double[]
Starting point.
p
,
final double[]
Search direction.
d
)
Deprecated as a consequence of UnivariatePointValuePair being deprecated.

Find the minimum of the function f(p + alpha * d).

Inherited from org.apache.commons.math3.optimization.univariate.BrentOptimizer:
doOptimize

Field Detail

ABS_TOL_UNUSEDback to summary
private static final double ABS_TOL_UNUSED

Value that will pass the precondition check for BrentOptimizer but will not pass the convergence check, so that the custom checker will always decide when to stop the line search.

bracketback to summary
private final BracketFinder bracket

Deprecated

as a consequence of BracketFinder being deprecated. See corresponding docs for further information.

Automatic bracketing.

REL_TOL_UNUSEDback to summary
private static final double REL_TOL_UNUSED

Value that will pass the precondition check for BrentOptimizer but will not pass the convergence check, so that the custom checker will always decide when to stop the line search.

Constructor Detail

LineSearchback to summary
pack-priv 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:double

Relative threshold.

abs:double

Absolute threshold.

Method Detail

searchback to summary
public UnivariatePointValuePair search(final double[] p, final double[] d)

Deprecated

as a consequence of UnivariatePointValuePair being deprecated. See corresponding docs for further information.

Find the minimum of the function f(p + alpha * d).

Parameters
p:double[]

Starting point.

d:double[]

Search direction.

Returns:UnivariatePointValuePair

the optimum.

Exceptions
TooManyEvaluationsException:
if the number of evaluations is exceeded.