From e71093b8df5770f59dbb84c2540602f0a98b4253 Mon Sep 17 00:00:00 2001 From: Gilles Sadowski Date: Fri, 9 Dec 2011 12:42:50 +0000 Subject: [PATCH] MATH-707 Class name change: "MultivariateRealOptimizer" -> "MultivariateOptimizer" "DifferentiableMultivariateRealOptimizer" -> "DifferentiableMultivariateOptimizer" git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1212377 13f79535-47bb-0310-9956-ffa450edef68 --- .../math/optimization/BaseMultivariateOptimizer.java | 4 ++-- .../BaseMultivariateSimpleBoundsOptimizer.java | 4 ++-- .../commons/math/optimization/BaseOptimizer.java | 4 ++-- .../DifferentiableMultivariateMultiStartOptimizer.java | 6 +++--- ...r.java => DifferentiableMultivariateOptimizer.java} | 4 ++-- .../optimization/MultivariateMultiStartOptimizer.java | 6 +++--- ...teRealOptimizer.java => MultivariateOptimizer.java} | 4 ++-- .../math/optimization/direct/BOBYQAOptimizer.java | 4 ++-- .../math/optimization/direct/CMAESOptimizer.java | 4 ++-- .../math/optimization/direct/PowellOptimizer.java | 4 ++-- .../math/optimization/direct/SimplexOptimizer.java | 4 ++-- .../general/AbstractScalarDifferentiableOptimizer.java | 4 ++-- .../apache/commons/math/optimization/package-info.java | 10 +++++----- .../commons/math/optimization/BatteryNISTTest.java | 2 +- .../math/optimization/direct/BOBYQAOptimizerTest.java | 2 +- .../math/optimization/direct/CMAESOptimizerTest.java | 4 ++-- .../math/optimization/direct/PowellOptimizerTest.java | 4 ++-- 17 files changed, 37 insertions(+), 37 deletions(-) rename src/main/java/org/apache/commons/math/optimization/{DifferentiableMultivariateRealOptimizer.java => DifferentiableMultivariateOptimizer.java} (93%) rename src/main/java/org/apache/commons/math/optimization/{MultivariateRealOptimizer.java => MultivariateOptimizer.java} (93%) diff --git a/src/main/java/org/apache/commons/math/optimization/BaseMultivariateOptimizer.java b/src/main/java/org/apache/commons/math/optimization/BaseMultivariateOptimizer.java index a36ded4ff..d6836a2c1 100644 --- a/src/main/java/org/apache/commons/math/optimization/BaseMultivariateOptimizer.java +++ b/src/main/java/org/apache/commons/math/optimization/BaseMultivariateOptimizer.java @@ -24,8 +24,8 @@ import org.apache.commons.math.analysis.MultivariateFunction; * Commons-FastMath. Users of the API are advised to base their code on * the following interfaces: * * * @param Type of the objective function to be optimized. diff --git a/src/main/java/org/apache/commons/math/optimization/BaseMultivariateSimpleBoundsOptimizer.java b/src/main/java/org/apache/commons/math/optimization/BaseMultivariateSimpleBoundsOptimizer.java index 62fde33ab..7bf9b97e4 100644 --- a/src/main/java/org/apache/commons/math/optimization/BaseMultivariateSimpleBoundsOptimizer.java +++ b/src/main/java/org/apache/commons/math/optimization/BaseMultivariateSimpleBoundsOptimizer.java @@ -24,8 +24,8 @@ import org.apache.commons.math.analysis.MultivariateFunction; * Commons-FastMath. Users of the API are advised to base their code on * the following interfaces: * * * @param Type of the objective function to be optimized. diff --git a/src/main/java/org/apache/commons/math/optimization/BaseOptimizer.java b/src/main/java/org/apache/commons/math/optimization/BaseOptimizer.java index 1d01368bc..2f58466c9 100644 --- a/src/main/java/org/apache/commons/math/optimization/BaseOptimizer.java +++ b/src/main/java/org/apache/commons/math/optimization/BaseOptimizer.java @@ -22,8 +22,8 @@ package org.apache.commons.math.optimization; * Commons-Math. Users of the API are advised to base their code on * the following interfaces: *
    - *
  • {@link org.apache.commons.math.optimization.MultivariateRealOptimizer}
  • - *
  • {@link org.apache.commons.math.optimization.DifferentiableMultivariateRealOptimizer}
  • + *
  • {@link org.apache.commons.math.optimization.MultivariateOptimizer}
  • + *
  • {@link org.apache.commons.math.optimization.DifferentiableMultivariateOptimizer}
  • *
  • {@link org.apache.commons.math.optimization.DifferentiableMultivariateVectorOptimizer}
  • *
  • {@link org.apache.commons.math.optimization.univariate.UnivariateRealOptimizer}
  • *
diff --git a/src/main/java/org/apache/commons/math/optimization/DifferentiableMultivariateMultiStartOptimizer.java b/src/main/java/org/apache/commons/math/optimization/DifferentiableMultivariateMultiStartOptimizer.java index 12afbd327..ceb1f6b00 100644 --- a/src/main/java/org/apache/commons/math/optimization/DifferentiableMultivariateMultiStartOptimizer.java +++ b/src/main/java/org/apache/commons/math/optimization/DifferentiableMultivariateMultiStartOptimizer.java @@ -21,7 +21,7 @@ import org.apache.commons.math.analysis.DifferentiableMultivariateFunction; import org.apache.commons.math.random.RandomVectorGenerator; /** - * Special implementation of the {@link DifferentiableMultivariateRealOptimizer} + * Special implementation of the {@link DifferentiableMultivariateOptimizer} * interface adding multi-start features to an existing optimizer. * * This class wraps a classical optimizer to use it several times in @@ -33,7 +33,7 @@ import org.apache.commons.math.random.RandomVectorGenerator; */ public class DifferentiableMultivariateMultiStartOptimizer extends BaseMultivariateMultiStartOptimizer - implements DifferentiableMultivariateRealOptimizer { + implements DifferentiableMultivariateOptimizer { /** * Create a multi-start optimizer from a single-start optimizer. * @@ -43,7 +43,7 @@ public class DifferentiableMultivariateMultiStartOptimizer * equal to 1. * @param generator Random vector generator to use for restarts. */ - public DifferentiableMultivariateMultiStartOptimizer(final DifferentiableMultivariateRealOptimizer optimizer, + public DifferentiableMultivariateMultiStartOptimizer(final DifferentiableMultivariateOptimizer optimizer, final int starts, final RandomVectorGenerator generator) { super(optimizer, starts, generator); diff --git a/src/main/java/org/apache/commons/math/optimization/DifferentiableMultivariateRealOptimizer.java b/src/main/java/org/apache/commons/math/optimization/DifferentiableMultivariateOptimizer.java similarity index 93% rename from src/main/java/org/apache/commons/math/optimization/DifferentiableMultivariateRealOptimizer.java rename to src/main/java/org/apache/commons/math/optimization/DifferentiableMultivariateOptimizer.java index 17d6c5e2f..06224aca6 100644 --- a/src/main/java/org/apache/commons/math/optimization/DifferentiableMultivariateRealOptimizer.java +++ b/src/main/java/org/apache/commons/math/optimization/DifferentiableMultivariateOptimizer.java @@ -26,11 +26,11 @@ import org.apache.commons.math.analysis.DifferentiableMultivariateFunction; * Optimization algorithms find the input point set that either {@link GoalType * maximize or minimize} an objective function. * - * @see MultivariateRealOptimizer + * @see MultivariateOptimizer * @see DifferentiableMultivariateVectorOptimizer * * @version $Id$ * @since 2.0 */ -public interface DifferentiableMultivariateRealOptimizer +public interface DifferentiableMultivariateOptimizer extends BaseMultivariateOptimizer {} diff --git a/src/main/java/org/apache/commons/math/optimization/MultivariateMultiStartOptimizer.java b/src/main/java/org/apache/commons/math/optimization/MultivariateMultiStartOptimizer.java index 9197fd53c..66e2bea26 100644 --- a/src/main/java/org/apache/commons/math/optimization/MultivariateMultiStartOptimizer.java +++ b/src/main/java/org/apache/commons/math/optimization/MultivariateMultiStartOptimizer.java @@ -21,7 +21,7 @@ import org.apache.commons.math.analysis.MultivariateFunction; import org.apache.commons.math.random.RandomVectorGenerator; /** - * Special implementation of the {@link MultivariateRealOptimizer} interface adding + * Special implementation of the {@link MultivariateOptimizer} interface adding * multi-start features to an existing optimizer. * * This class wraps a classical optimizer to use it several times in @@ -33,7 +33,7 @@ import org.apache.commons.math.random.RandomVectorGenerator; */ public class MultivariateMultiStartOptimizer extends BaseMultivariateMultiStartOptimizer - implements MultivariateRealOptimizer { + implements MultivariateOptimizer { /** * Create a multi-start optimizer from a single-start optimizer. * @@ -43,7 +43,7 @@ public class MultivariateMultiStartOptimizer * equal to 1. * @param generator Random vector generator to use for restarts. */ - public MultivariateMultiStartOptimizer(final MultivariateRealOptimizer optimizer, + public MultivariateMultiStartOptimizer(final MultivariateOptimizer optimizer, final int starts, final RandomVectorGenerator generator) { super(optimizer, starts, generator); diff --git a/src/main/java/org/apache/commons/math/optimization/MultivariateRealOptimizer.java b/src/main/java/org/apache/commons/math/optimization/MultivariateOptimizer.java similarity index 93% rename from src/main/java/org/apache/commons/math/optimization/MultivariateRealOptimizer.java rename to src/main/java/org/apache/commons/math/optimization/MultivariateOptimizer.java index 4980e6fef..bbf16004f 100644 --- a/src/main/java/org/apache/commons/math/optimization/MultivariateRealOptimizer.java +++ b/src/main/java/org/apache/commons/math/optimization/MultivariateOptimizer.java @@ -25,10 +25,10 @@ import org.apache.commons.math.analysis.MultivariateFunction; *

Optimization algorithms find the input point set that either {@link GoalType * maximize or minimize} an objective function.

* - * @see DifferentiableMultivariateRealOptimizer + * @see DifferentiableMultivariateOptimizer * @see DifferentiableMultivariateVectorOptimizer * @version $Id$ * @since 2.0 */ -public interface MultivariateRealOptimizer +public interface MultivariateOptimizer extends BaseMultivariateOptimizer {} diff --git a/src/main/java/org/apache/commons/math/optimization/direct/BOBYQAOptimizer.java b/src/main/java/org/apache/commons/math/optimization/direct/BOBYQAOptimizer.java index 0efabee9a..e31b15621 100644 --- a/src/main/java/org/apache/commons/math/optimization/direct/BOBYQAOptimizer.java +++ b/src/main/java/org/apache/commons/math/optimization/direct/BOBYQAOptimizer.java @@ -29,7 +29,7 @@ import org.apache.commons.math.linear.ArrayRealVector; import org.apache.commons.math.linear.RealVector; import org.apache.commons.math.optimization.GoalType; import org.apache.commons.math.optimization.RealPointValuePair; -import org.apache.commons.math.optimization.MultivariateRealOptimizer; +import org.apache.commons.math.optimization.MultivariateOptimizer; /** * Powell's BOBYQA algorithm. This implementation is translated and @@ -51,7 +51,7 @@ import org.apache.commons.math.optimization.MultivariateRealOptimizer; */ public class BOBYQAOptimizer extends BaseAbstractMultivariateSimpleBoundsOptimizer - implements MultivariateRealOptimizer { + implements MultivariateOptimizer { /** Minimum dimension of the problem: {@value} */ public static final int MINIMUM_PROBLEM_DIMENSION = 2; /** Default value for {@link #initialTrustRegionRadius}: {@value} . */ diff --git a/src/main/java/org/apache/commons/math/optimization/direct/CMAESOptimizer.java b/src/main/java/org/apache/commons/math/optimization/direct/CMAESOptimizer.java index a14103753..82012e253 100644 --- a/src/main/java/org/apache/commons/math/optimization/direct/CMAESOptimizer.java +++ b/src/main/java/org/apache/commons/math/optimization/direct/CMAESOptimizer.java @@ -33,7 +33,7 @@ import org.apache.commons.math.linear.MatrixUtils; import org.apache.commons.math.linear.RealMatrix; import org.apache.commons.math.optimization.ConvergenceChecker; import org.apache.commons.math.optimization.GoalType; -import org.apache.commons.math.optimization.MultivariateRealOptimizer; +import org.apache.commons.math.optimization.MultivariateOptimizer; import org.apache.commons.math.optimization.RealPointValuePair; import org.apache.commons.math.optimization.SimpleScalarValueChecker; import org.apache.commons.math.random.MersenneTwister; @@ -82,7 +82,7 @@ import org.apache.commons.math.util.MathArrays; public class CMAESOptimizer extends BaseAbstractMultivariateOptimizer - implements MultivariateRealOptimizer { + implements MultivariateOptimizer { /** Default value for {@link #checkFeasableCount}: {@value}. */ public static final int DEFAULT_CHECKFEASABLECOUNT = 0; /** Default value for {@link #stopFitness}: {@value}. */ diff --git a/src/main/java/org/apache/commons/math/optimization/direct/PowellOptimizer.java b/src/main/java/org/apache/commons/math/optimization/direct/PowellOptimizer.java index 487cfa420..2f5c06871 100644 --- a/src/main/java/org/apache/commons/math/optimization/direct/PowellOptimizer.java +++ b/src/main/java/org/apache/commons/math/optimization/direct/PowellOptimizer.java @@ -26,7 +26,7 @@ import org.apache.commons.math.exception.NotStrictlyPositiveException; import org.apache.commons.math.optimization.GoalType; import org.apache.commons.math.optimization.RealPointValuePair; import org.apache.commons.math.optimization.ConvergenceChecker; -import org.apache.commons.math.optimization.MultivariateRealOptimizer; +import org.apache.commons.math.optimization.MultivariateOptimizer; import org.apache.commons.math.optimization.univariate.BracketFinder; import org.apache.commons.math.optimization.univariate.BrentOptimizer; import org.apache.commons.math.optimization.univariate.UnivariateRealPointValuePair; @@ -47,7 +47,7 @@ import org.apache.commons.math.optimization.univariate.UnivariateRealPointValueP */ public class PowellOptimizer extends BaseAbstractMultivariateOptimizer - implements MultivariateRealOptimizer { + implements MultivariateOptimizer { /** * Minimum relative tolerance. */ diff --git a/src/main/java/org/apache/commons/math/optimization/direct/SimplexOptimizer.java b/src/main/java/org/apache/commons/math/optimization/direct/SimplexOptimizer.java index da88fa32f..e61e96405 100644 --- a/src/main/java/org/apache/commons/math/optimization/direct/SimplexOptimizer.java +++ b/src/main/java/org/apache/commons/math/optimization/direct/SimplexOptimizer.java @@ -25,7 +25,7 @@ import org.apache.commons.math.optimization.GoalType; import org.apache.commons.math.optimization.ConvergenceChecker; import org.apache.commons.math.optimization.RealPointValuePair; import org.apache.commons.math.optimization.SimpleScalarValueChecker; -import org.apache.commons.math.optimization.MultivariateRealOptimizer; +import org.apache.commons.math.optimization.MultivariateOptimizer; /** * This class implements simplex-based direct search optimization. @@ -85,7 +85,7 @@ import org.apache.commons.math.optimization.MultivariateRealOptimizer; */ public class SimplexOptimizer extends BaseAbstractMultivariateOptimizer - implements MultivariateRealOptimizer { + implements MultivariateOptimizer { /** Simplex. */ private AbstractSimplex simplex; diff --git a/src/main/java/org/apache/commons/math/optimization/general/AbstractScalarDifferentiableOptimizer.java b/src/main/java/org/apache/commons/math/optimization/general/AbstractScalarDifferentiableOptimizer.java index e56bf2354..7349ef19e 100644 --- a/src/main/java/org/apache/commons/math/optimization/general/AbstractScalarDifferentiableOptimizer.java +++ b/src/main/java/org/apache/commons/math/optimization/general/AbstractScalarDifferentiableOptimizer.java @@ -19,7 +19,7 @@ package org.apache.commons.math.optimization.general; import org.apache.commons.math.analysis.DifferentiableMultivariateFunction; import org.apache.commons.math.analysis.MultivariateVectorFunction; -import org.apache.commons.math.optimization.DifferentiableMultivariateRealOptimizer; +import org.apache.commons.math.optimization.DifferentiableMultivariateOptimizer; import org.apache.commons.math.optimization.GoalType; import org.apache.commons.math.optimization.ConvergenceChecker; import org.apache.commons.math.optimization.RealPointValuePair; @@ -35,7 +35,7 @@ import org.apache.commons.math.optimization.direct.BaseAbstractMultivariateOptim */ public abstract class AbstractScalarDifferentiableOptimizer extends BaseAbstractMultivariateOptimizer - implements DifferentiableMultivariateRealOptimizer { + implements DifferentiableMultivariateOptimizer { /** * Objective function gradient. */ diff --git a/src/main/java/org/apache/commons/math/optimization/package-info.java b/src/main/java/org/apache/commons/math/optimization/package-info.java index c61b3b5d4..2e0e8d2cc 100644 --- a/src/main/java/org/apache/commons/math/optimization/package-info.java +++ b/src/main/java/org/apache/commons/math/optimization/package-info.java @@ -35,11 +35,11 @@ *
  • {@link org.apache.commons.math.optimization.univariate.UnivariateRealOptimizer * UnivariateRealOptimizer} for {@link org.apache.commons.math.analysis.UnivariateFunction * univariate real functions}
  • - *
  • {@link org.apache.commons.math.optimization.MultivariateRealOptimizer - * MultivariateRealOptimizer} for {@link org.apache.commons.math.analysis.MultivariateFunction + *
  • {@link org.apache.commons.math.optimization.MultivariateOptimizer + * MultivariateOptimizer} for {@link org.apache.commons.math.analysis.MultivariateFunction * multivariate real functions}
  • - *
  • {@link org.apache.commons.math.optimization.DifferentiableMultivariateRealOptimizer - * DifferentiableMultivariateRealOptimizer} for {@link + *
  • {@link org.apache.commons.math.optimization.DifferentiableMultivariateOptimizer + * DifferentiableMultivariateOptimizer} for {@link * org.apache.commons.math.analysis.DifferentiableMultivariateFunction * differentiable multivariate real functions}
  • *
  • {@link org.apache.commons.math.optimization.DifferentiableMultivariateVectorOptimizer @@ -57,7 +57,7 @@ * real function} thanks to the {@link * org.apache.commons.math.optimization.LeastSquaresConverter LeastSquaresConverter} helper class. * The transformed function can be optimized using any implementation of the {@link - * org.apache.commons.math.optimization.MultivariateRealOptimizer MultivariateRealOptimizer} interface. + * org.apache.commons.math.optimization.MultivariateOptimizer MultivariateOptimizer} interface. *

    * *

    diff --git a/src/test/java/org/apache/commons/math/optimization/BatteryNISTTest.java b/src/test/java/org/apache/commons/math/optimization/BatteryNISTTest.java index 2c08c1bfd..13d66a5d0 100644 --- a/src/test/java/org/apache/commons/math/optimization/BatteryNISTTest.java +++ b/src/test/java/org/apache/commons/math/optimization/BatteryNISTTest.java @@ -792,7 +792,7 @@ public class BatteryNISTTest { } /* generic test runner */ - private double[] run(MultivariateRealOptimizer optim, DifferentiableMultivariateFunction func, double[] start) { + private double[] run(MultivariateOptimizer optim, DifferentiableMultivariateFunction func, double[] start) { return (optim.optimize(1000000, func, GoalType.MINIMIZE, start).getPointRef()); } /* generic test runner for AbstractScalarDifferentiableOptimizer */ diff --git a/src/test/java/org/apache/commons/math/optimization/direct/BOBYQAOptimizerTest.java b/src/test/java/org/apache/commons/math/optimization/direct/BOBYQAOptimizerTest.java index 937fe99b2..7eb774213 100644 --- a/src/test/java/org/apache/commons/math/optimization/direct/BOBYQAOptimizerTest.java +++ b/src/test/java/org/apache/commons/math/optimization/direct/BOBYQAOptimizerTest.java @@ -253,7 +253,7 @@ public class BOBYQAOptimizerTest { System.out.println(func.getClass().getName() + " BEGIN"); // XXX int dim = startPoint.length; -// MultivariateRealOptimizer optim = +// MultivariateOptimizer optim = // new PowellOptimizer(1e-13, Math.ulp(1d)); // RealPointValuePair result = optim.optimize(100000, func, goal, startPoint); final double[] lB = boundaries == null ? null : boundaries[0]; diff --git a/src/test/java/org/apache/commons/math/optimization/direct/CMAESOptimizerTest.java b/src/test/java/org/apache/commons/math/optimization/direct/CMAESOptimizerTest.java index b1289f74f..69b8d02c9 100644 --- a/src/test/java/org/apache/commons/math/optimization/direct/CMAESOptimizerTest.java +++ b/src/test/java/org/apache/commons/math/optimization/direct/CMAESOptimizerTest.java @@ -27,7 +27,7 @@ import org.apache.commons.math.exception.NoDataException; import org.apache.commons.math.exception.NotPositiveException; import org.apache.commons.math.exception.OutOfRangeException; import org.apache.commons.math.optimization.GoalType; -import org.apache.commons.math.optimization.MultivariateRealOptimizer; +import org.apache.commons.math.optimization.MultivariateOptimizer; import org.apache.commons.math.optimization.RealPointValuePair; import org.apache.commons.math.random.MersenneTwister; import org.junit.Assert; @@ -375,7 +375,7 @@ public class CMAESOptimizerTest { RealPointValuePair expected) { int dim = startPoint.length; // test diagonalOnly = 0 - slow but normally fewer feval# - MultivariateRealOptimizer optim = + MultivariateOptimizer optim = new CMAESOptimizer( lambda, inSigma, boundaries, 30000, stopValue, isActive, diagonalOnly, 0, new MersenneTwister(),false); diff --git a/src/test/java/org/apache/commons/math/optimization/direct/PowellOptimizerTest.java b/src/test/java/org/apache/commons/math/optimization/direct/PowellOptimizerTest.java index c4ab8783c..0a67ca3bd 100644 --- a/src/test/java/org/apache/commons/math/optimization/direct/PowellOptimizerTest.java +++ b/src/test/java/org/apache/commons/math/optimization/direct/PowellOptimizerTest.java @@ -19,7 +19,7 @@ package org.apache.commons.math.optimization.direct; import org.apache.commons.math.analysis.MultivariateFunction; import org.apache.commons.math.analysis.SumSincFunction; import org.apache.commons.math.optimization.GoalType; -import org.apache.commons.math.optimization.MultivariateRealOptimizer; +import org.apache.commons.math.optimization.MultivariateOptimizer; import org.apache.commons.math.optimization.RealPointValuePair; import org.junit.Assert; import org.junit.Test; @@ -131,7 +131,7 @@ public class PowellOptimizerTest { GoalType goal, double fTol, double pointTol) { - final MultivariateRealOptimizer optim = new PowellOptimizer(fTol, Math.ulp(1d)); + final MultivariateOptimizer optim = new PowellOptimizer(fTol, Math.ulp(1d)); final RealPointValuePair result = optim.optimize(1000, func, goal, init); final double[] found = result.getPoint();