From a51152cc9eeeb36e7efcaa126edb50f59058c845 Mon Sep 17 00:00:00 2001 From: Gilles Sadowski Date: Fri, 9 Dec 2011 13:00:11 +0000 Subject: [PATCH] MATH-707 Class name change: "AbstractUnivariateRealOptimizer" -> "BaseAbstractUnivariateOptimizer" "MultiStartUnivariateRealOptimizer" -> "UnivariateMultiStartOptimizer" "BaseUnivariateRealOptimizer" -> "BaseUnivariateOptimizer" git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1212385 13f79535-47bb-0310-9956-ffa450edef68 --- ...r.java => BaseAbstractUnivariateOptimizer.java} | 4 ++-- ...Optimizer.java => BaseUnivariateOptimizer.java} | 2 +- .../optimization/univariate/BrentOptimizer.java | 2 +- ...zer.java => UnivariateMultiStartOptimizer.java} | 8 ++++---- .../univariate/UnivariateRealOptimizer.java | 2 +- ...java => UnivariateMultiStartOptimizerTest.java} | 14 +++++++------- 6 files changed, 16 insertions(+), 16 deletions(-) rename src/main/java/org/apache/commons/math/optimization/univariate/{AbstractUnivariateRealOptimizer.java => BaseAbstractUnivariateOptimizer.java} (97%) rename src/main/java/org/apache/commons/math/optimization/univariate/{BaseUnivariateRealOptimizer.java => BaseUnivariateOptimizer.java} (98%) rename src/main/java/org/apache/commons/math/optimization/univariate/{MultiStartUnivariateRealOptimizer.java => UnivariateMultiStartOptimizer.java} (96%) rename src/test/java/org/apache/commons/math/optimization/univariate/{MultiStartUnivariateRealOptimizerTest.java => UnivariateMultiStartOptimizerTest.java} (88%) diff --git a/src/main/java/org/apache/commons/math/optimization/univariate/AbstractUnivariateRealOptimizer.java b/src/main/java/org/apache/commons/math/optimization/univariate/BaseAbstractUnivariateOptimizer.java similarity index 97% rename from src/main/java/org/apache/commons/math/optimization/univariate/AbstractUnivariateRealOptimizer.java rename to src/main/java/org/apache/commons/math/optimization/univariate/BaseAbstractUnivariateOptimizer.java index b535ad105..818c99106 100644 --- a/src/main/java/org/apache/commons/math/optimization/univariate/AbstractUnivariateRealOptimizer.java +++ b/src/main/java/org/apache/commons/math/optimization/univariate/BaseAbstractUnivariateOptimizer.java @@ -32,7 +32,7 @@ import org.apache.commons.math.optimization.ConvergenceChecker; * @version $Id$ * @since 2.0 */ -public abstract class AbstractUnivariateRealOptimizer +public abstract class BaseAbstractUnivariateOptimizer implements UnivariateRealOptimizer { /** Convergence checker. */ private final ConvergenceChecker checker; @@ -52,7 +52,7 @@ public abstract class AbstractUnivariateRealOptimizer /** * @param checker Convergence checking procedure. */ - protected AbstractUnivariateRealOptimizer(ConvergenceChecker checker) { + protected BaseAbstractUnivariateOptimizer(ConvergenceChecker checker) { this.checker = checker; } diff --git a/src/main/java/org/apache/commons/math/optimization/univariate/BaseUnivariateRealOptimizer.java b/src/main/java/org/apache/commons/math/optimization/univariate/BaseUnivariateOptimizer.java similarity index 98% rename from src/main/java/org/apache/commons/math/optimization/univariate/BaseUnivariateRealOptimizer.java rename to src/main/java/org/apache/commons/math/optimization/univariate/BaseUnivariateOptimizer.java index b28c3ba65..932f1d24d 100644 --- a/src/main/java/org/apache/commons/math/optimization/univariate/BaseUnivariateRealOptimizer.java +++ b/src/main/java/org/apache/commons/math/optimization/univariate/BaseUnivariateOptimizer.java @@ -34,7 +34,7 @@ import org.apache.commons.math.optimization.GoalType; * @version $Id$ * @since 3.0 */ -public interface BaseUnivariateRealOptimizer +public interface BaseUnivariateOptimizer extends BaseOptimizer { /** * Find an optimum in the given interval. diff --git a/src/main/java/org/apache/commons/math/optimization/univariate/BrentOptimizer.java b/src/main/java/org/apache/commons/math/optimization/univariate/BrentOptimizer.java index 7e80b8b5a..7869121e5 100644 --- a/src/main/java/org/apache/commons/math/optimization/univariate/BrentOptimizer.java +++ b/src/main/java/org/apache/commons/math/optimization/univariate/BrentOptimizer.java @@ -35,7 +35,7 @@ import org.apache.commons.math.optimization.GoalType; * @version $Id$ * @since 2.0 */ -public class BrentOptimizer extends AbstractUnivariateRealOptimizer { +public class BrentOptimizer extends BaseAbstractUnivariateOptimizer { /** * Golden section. */ diff --git a/src/main/java/org/apache/commons/math/optimization/univariate/MultiStartUnivariateRealOptimizer.java b/src/main/java/org/apache/commons/math/optimization/univariate/UnivariateMultiStartOptimizer.java similarity index 96% rename from src/main/java/org/apache/commons/math/optimization/univariate/MultiStartUnivariateRealOptimizer.java rename to src/main/java/org/apache/commons/math/optimization/univariate/UnivariateMultiStartOptimizer.java index 4ec4b5ffc..0448eb1c2 100644 --- a/src/main/java/org/apache/commons/math/optimization/univariate/MultiStartUnivariateRealOptimizer.java +++ b/src/main/java/org/apache/commons/math/optimization/univariate/UnivariateMultiStartOptimizer.java @@ -42,10 +42,10 @@ import org.apache.commons.math.optimization.ConvergenceChecker; * @version $Id$ * @since 3.0 */ -public class MultiStartUnivariateRealOptimizer - implements BaseUnivariateRealOptimizer { +public class UnivariateMultiStartOptimizer + implements BaseUnivariateOptimizer { /** Underlying classical optimizer. */ - private final BaseUnivariateRealOptimizer optimizer; + private final BaseUnivariateOptimizer optimizer; /** Maximal number of evaluations allowed. */ private int maxEvaluations; /** Number of evaluations already performed for all starts. */ @@ -69,7 +69,7 @@ public class MultiStartUnivariateRealOptimizer * is {@code null}. * @throws NotStrictlyPositiveException if {@code starts < 1}. */ - public MultiStartUnivariateRealOptimizer(final BaseUnivariateRealOptimizer optimizer, + public UnivariateMultiStartOptimizer(final BaseUnivariateOptimizer optimizer, final int starts, final RandomGenerator generator) { if (optimizer == null || diff --git a/src/main/java/org/apache/commons/math/optimization/univariate/UnivariateRealOptimizer.java b/src/main/java/org/apache/commons/math/optimization/univariate/UnivariateRealOptimizer.java index 265772576..2a038ebfc 100644 --- a/src/main/java/org/apache/commons/math/optimization/univariate/UnivariateRealOptimizer.java +++ b/src/main/java/org/apache/commons/math/optimization/univariate/UnivariateRealOptimizer.java @@ -25,4 +25,4 @@ import org.apache.commons.math.analysis.UnivariateFunction; * @since 3.0 */ public interface UnivariateRealOptimizer - extends BaseUnivariateRealOptimizer {} + extends BaseUnivariateOptimizer {} diff --git a/src/test/java/org/apache/commons/math/optimization/univariate/MultiStartUnivariateRealOptimizerTest.java b/src/test/java/org/apache/commons/math/optimization/univariate/UnivariateMultiStartOptimizerTest.java similarity index 88% rename from src/test/java/org/apache/commons/math/optimization/univariate/MultiStartUnivariateRealOptimizerTest.java rename to src/test/java/org/apache/commons/math/optimization/univariate/UnivariateMultiStartOptimizerTest.java index 31be04bd8..c930a6b23 100644 --- a/src/test/java/org/apache/commons/math/optimization/univariate/MultiStartUnivariateRealOptimizerTest.java +++ b/src/test/java/org/apache/commons/math/optimization/univariate/UnivariateMultiStartOptimizerTest.java @@ -27,7 +27,7 @@ import org.apache.commons.math.util.FastMath; import org.junit.Test; import org.junit.Assert; -public class MultiStartUnivariateRealOptimizerTest { +public class UnivariateMultiStartOptimizerTest { @Test public void testSinMin() { @@ -35,8 +35,8 @@ public class MultiStartUnivariateRealOptimizerTest { UnivariateRealOptimizer underlying = new BrentOptimizer(1e-10, 1e-14); JDKRandomGenerator g = new JDKRandomGenerator(); g.setSeed(44428400075l); - MultiStartUnivariateRealOptimizer optimizer = - new MultiStartUnivariateRealOptimizer(underlying, 10, g); + UnivariateMultiStartOptimizer optimizer = + new UnivariateMultiStartOptimizer(underlying, 10, g); optimizer.optimize(300, f, GoalType.MINIMIZE, -100.0, 100.0); UnivariateRealPointValuePair[] optima = optimizer.getOptima(); for (int i = 1; i < optima.length; ++i) { @@ -57,8 +57,8 @@ public class MultiStartUnivariateRealOptimizerTest { UnivariateRealOptimizer underlying = new BrentOptimizer(1e-9, 1e-14); JDKRandomGenerator g = new JDKRandomGenerator(); g.setSeed(4312000053L); - MultiStartUnivariateRealOptimizer optimizer = - new MultiStartUnivariateRealOptimizer(underlying, 5, g); + UnivariateMultiStartOptimizer optimizer = + new UnivariateMultiStartOptimizer(underlying, 5, g); UnivariateRealPointValuePair optimum = optimizer.optimize(300, f, GoalType.MINIMIZE, -0.3, -0.2); @@ -86,8 +86,8 @@ public class MultiStartUnivariateRealOptimizerTest { UnivariateRealOptimizer underlying = new BrentOptimizer(1e-9, 1e-14); JDKRandomGenerator g = new JDKRandomGenerator(); g.setSeed(4312000053L); - MultiStartUnivariateRealOptimizer optimizer = - new MultiStartUnivariateRealOptimizer(underlying, 5, g); + UnivariateMultiStartOptimizer optimizer = + new UnivariateMultiStartOptimizer(underlying, 5, g); try { optimizer.optimize(300, f, GoalType.MINIMIZE, -0.3, -0.2);