MATH-908
Added constructor. Javadoc. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1413594 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
4d035b59a1
commit
9e75d6faa9
|
@ -42,6 +42,9 @@ import org.apache.commons.math3.optimization.univariate.SimpleUnivariateValueChe
|
||||||
* function value between two successive iterations. It is however possible
|
* function value between two successive iterations. It is however possible
|
||||||
* to define a custom convergence checker that might terminate the algorithm
|
* to define a custom convergence checker that might terminate the algorithm
|
||||||
* earlier.
|
* earlier.
|
||||||
|
* <br/>
|
||||||
|
* The internal line search optimizer is a {@link BrentOptimizer} with a
|
||||||
|
* convergence checker set to {@link SimpleUnivariateValueChecker}.
|
||||||
*
|
*
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
* @since 2.2
|
* @since 2.2
|
||||||
|
@ -136,6 +139,23 @@ public class PowellOptimizer
|
||||||
this(rel, abs, null);
|
this(rel, abs, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Builds an instance with the default convergence checking procedure.
|
||||||
|
*
|
||||||
|
* @param rel Relative threshold.
|
||||||
|
* @param abs Absolute threshold.
|
||||||
|
* @param lineRel Relative threshold for the internal line search optimizer.
|
||||||
|
* @param lineAbs Absolute threshold for the internal line search optimizer.
|
||||||
|
* @throws NotStrictlyPositiveException if {@code abs <= 0}.
|
||||||
|
* @throws NumberIsTooSmallException if {@code rel < 2 * Math.ulp(1d)}.
|
||||||
|
*/
|
||||||
|
public PowellOptimizer(double rel,
|
||||||
|
double abs,
|
||||||
|
double lineRel,
|
||||||
|
double lineAbs) {
|
||||||
|
this(rel, abs, lineRel, lineAbs, null);
|
||||||
|
}
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
@Override
|
@Override
|
||||||
protected PointValuePair doOptimize() {
|
protected PointValuePair doOptimize() {
|
||||||
|
|
|
@ -224,7 +224,7 @@ public class PowellOptimizerTest {
|
||||||
double fLineTol,
|
double fLineTol,
|
||||||
double pointTol) {
|
double pointTol) {
|
||||||
final MultivariateOptimizer optim = new PowellOptimizer(fTol, Math.ulp(1d),
|
final MultivariateOptimizer optim = new PowellOptimizer(fTol, Math.ulp(1d),
|
||||||
fLineTol, Math.ulp(1d), null);
|
fLineTol, Math.ulp(1d));
|
||||||
|
|
||||||
final PointValuePair result = optim.optimize(1000, func, goal, init);
|
final PointValuePair result = optim.optimize(1000, func, goal, init);
|
||||||
final double[] point = result.getPoint();
|
final double[] point = result.getPoint();
|
||||||
|
|
Loading…
Reference in New Issue