From 28c30e9190a9c2710a4e80a8adc650ca85ce128b Mon Sep 17 00:00:00 2001 From: Gilles Sadowski Date: Thu, 13 Dec 2012 12:47:07 +0000 Subject: [PATCH] Unused argument (found by PMD). git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1421263 13f79535-47bb-0310-9956-ffa450edef68 --- .../optim/nonlinear/scalar/noderiv/CMAESOptimizer.java | 6 ++---- .../commons/math3/optimization/direct/CMAESOptimizer.java | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/apache/commons/math3/optim/nonlinear/scalar/noderiv/CMAESOptimizer.java b/src/main/java/org/apache/commons/math3/optim/nonlinear/scalar/noderiv/CMAESOptimizer.java index 404941bb9..06b83972b 100644 --- a/src/main/java/org/apache/commons/math3/optim/nonlinear/scalar/noderiv/CMAESOptimizer.java +++ b/src/main/java/org/apache/commons/math3/optim/nonlinear/scalar/noderiv/CMAESOptimizer.java @@ -431,7 +431,7 @@ public class CMAESOptimizer if (diagonalOnly <= 0) { updateCovariance(hsig, bestArx, arz, arindex, xold); } else { - updateCovarianceDiagonalOnly(hsig, bestArz, xold); + updateCovarianceDiagonalOnly(hsig, bestArz); } // Adapt step size sigma - Eq. (5) sigma *= Math.exp(Math.min(1, (normps/chiN - 1) * cs / damps)); @@ -663,11 +663,9 @@ public class CMAESOptimizer * @param hsig Flag indicating a small correction. * @param bestArz Fitness-sorted matrix of the gaussian random values of the * current offspring. - * @param xold xmean matrix of the previous generation. */ private void updateCovarianceDiagonalOnly(boolean hsig, - final RealMatrix bestArz, - final RealMatrix xold) { + final RealMatrix bestArz) { // minor correction if hsig==false double oldFac = hsig ? 0 : ccov1Sep * cc * (2 - cc); oldFac += 1 - ccov1Sep - ccovmuSep; diff --git a/src/main/java/org/apache/commons/math3/optimization/direct/CMAESOptimizer.java b/src/main/java/org/apache/commons/math3/optimization/direct/CMAESOptimizer.java index 41497074c..147c8ae51 100644 --- a/src/main/java/org/apache/commons/math3/optimization/direct/CMAESOptimizer.java +++ b/src/main/java/org/apache/commons/math3/optimization/direct/CMAESOptimizer.java @@ -550,7 +550,7 @@ public class CMAESOptimizer if (diagonalOnly <= 0) { updateCovariance(hsig, bestArx, arz, arindex, xold); } else { - updateCovarianceDiagonalOnly(hsig, bestArz, xold); + updateCovarianceDiagonalOnly(hsig, bestArz); } // Adapt step size sigma - Eq. (5) sigma *= Math.exp(Math.min(1, (normps/chiN - 1) * cs / damps)); @@ -790,11 +790,9 @@ public class CMAESOptimizer * @param hsig Flag indicating a small correction. * @param bestArz Fitness-sorted matrix of the gaussian random values of the * current offspring. - * @param xold xmean matrix of the previous generation. */ private void updateCovarianceDiagonalOnly(boolean hsig, - final RealMatrix bestArz, - final RealMatrix xold) { + final RealMatrix bestArz) { // minor correction if hsig==false double oldFac = hsig ? 0 : ccov1Sep * cc * (2 - cc); oldFac += 1 - ccov1Sep - ccovmuSep;