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
|
||||
* to define a custom convergence checker that might terminate the algorithm
|
||||
* earlier.
|
||||
* <br/>
|
||||
* The internal line search optimizer is a {@link BrentOptimizer} with a
|
||||
* convergence checker set to {@link SimpleUnivariateValueChecker}.
|
||||
*
|
||||
* @version $Id$
|
||||
* @since 2.2
|
||||
|
@ -136,6 +139,23 @@ public class PowellOptimizer
|
|||
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} */
|
||||
@Override
|
||||
protected PointValuePair doOptimize() {
|
||||
|
|
|
@ -224,7 +224,7 @@ public class PowellOptimizerTest {
|
|||
double fLineTol,
|
||||
double pointTol) {
|
||||
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 double[] point = result.getPoint();
|
||||
|
|
Loading…
Reference in New Issue