commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject svn commit: r1413594 - in /commons/proper/math/trunk/src: main/java/org/apache/commons/math3/optimization/direct/PowellOptimizer.java test/java/org/apache/commons/math3/optimization/direct/PowellOptimizerTest.java
Date Mon, 26 Nov 2012 13:16:40 GMT
Author: erans
Date: Mon Nov 26 13:16:39 2012
New Revision: 1413594

URL: http://svn.apache.org/viewvc?rev=1413594&view=rev
Log:
MATH-908
Added constructor.
Javadoc.

Modified:
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/optimization/direct/PowellOptimizer.java
    commons/proper/math/trunk/src/test/java/org/apache/commons/math3/optimization/direct/PowellOptimizerTest.java

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/optimization/direct/PowellOptimizer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/optimization/direct/PowellOptimizer.java?rev=1413594&r1=1413593&r2=1413594&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/optimization/direct/PowellOptimizer.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/optimization/direct/PowellOptimizer.java
Mon Nov 26 13:16:39 2012
@@ -42,6 +42,9 @@ import org.apache.commons.math3.optimiza
  * 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() {

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math3/optimization/direct/PowellOptimizerTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math3/optimization/direct/PowellOptimizerTest.java?rev=1413594&r1=1413593&r2=1413594&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math3/optimization/direct/PowellOptimizerTest.java
(original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math3/optimization/direct/PowellOptimizerTest.java
Mon Nov 26 13:16:39 2012
@@ -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();



Mime
View raw message