diff --git a/src/main/java/org/apache/commons/math/analysis/function/Sigmoid.java b/src/main/java/org/apache/commons/math/analysis/function/Sigmoid.java index 5aa52e631..85d08a9b0 100644 --- a/src/main/java/org/apache/commons/math/analysis/function/Sigmoid.java +++ b/src/main/java/org/apache/commons/math/analysis/function/Sigmoid.java @@ -121,8 +121,6 @@ public class Sigmoid implements DifferentiableUnivariateRealFunction { public double[] gradient(double x, double ... param) { validateParameters(param); - final double lo = param[0]; - final double hi = param[1]; final double invExp1 = 1 / (1 + FastMath.exp(-x)); return new double[] { 1 - invExp1, invExp1 }; diff --git a/src/test/java/org/apache/commons/math/optimization/MultiStartDifferentiableMultivariateRealOptimizerTest.java b/src/test/java/org/apache/commons/math/optimization/MultiStartDifferentiableMultivariateRealOptimizerTest.java index ecd5f503e..2e3795347 100644 --- a/src/test/java/org/apache/commons/math/optimization/MultiStartDifferentiableMultivariateRealOptimizerTest.java +++ b/src/test/java/org/apache/commons/math/optimization/MultiStartDifferentiableMultivariateRealOptimizerTest.java @@ -24,7 +24,6 @@ import java.util.ArrayList; import org.apache.commons.math.analysis.DifferentiableMultivariateRealFunction; import org.apache.commons.math.analysis.MultivariateRealFunction; import org.apache.commons.math.analysis.MultivariateVectorialFunction; -import org.apache.commons.math.analysis.solvers.BrentSolver; import org.apache.commons.math.optimization.general.ConjugateGradientFormula; import org.apache.commons.math.optimization.general.NonLinearConjugateGradientOptimizer; import org.apache.commons.math.random.GaussianRandomGenerator; @@ -54,7 +53,6 @@ public class MultiStartDifferentiableMultivariateRealOptimizerTest { MultiStartDifferentiableMultivariateRealOptimizer optimizer = new MultiStartDifferentiableMultivariateRealOptimizer(underlying, 10, generator); optimizer.setConvergenceChecker(new SimpleScalarValueChecker(1.0e-10, 1.0e-10)); - BrentSolver solver = new BrentSolver(); RealPointValuePair optimum = optimizer.optimize(200, circle, GoalType.MINIMIZE, new double[] { 98.680, 47.345 }); Assert.assertEquals(200, optimizer.getMaxEvaluations()); diff --git a/src/test/java/org/apache/commons/math/optimization/fitting/HarmonicFitterTest.java b/src/test/java/org/apache/commons/math/optimization/fitting/HarmonicFitterTest.java index bf92b8db6..c08de3a6f 100644 --- a/src/test/java/org/apache/commons/math/optimization/fitting/HarmonicFitterTest.java +++ b/src/test/java/org/apache/commons/math/optimization/fitting/HarmonicFitterTest.java @@ -34,7 +34,7 @@ public class HarmonicFitterTest { HarmonicFitter fitter = new HarmonicFitter(new LevenbergMarquardtOptimizer()); - final double[] fitted = fitter.fit(); + fitter.fit(); } // This test fails (throwing "ConvergenceException" instead). @@ -108,7 +108,7 @@ public class HarmonicFitterTest { fitter.addObservedPoint(1, x, 1e-7 * randomizer.nextGaussian()); } - final double[] fitted = fitter.fit(); + fitter.fit(); // This test serves to cover the part of the code of "guessAOmega" // when the algorithm using integrals fails. }