Unused argument (found by PMD).

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1421263 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gilles Sadowski 2012-12-13 12:47:07 +00:00
parent 931e594d11
commit 28c30e9190
2 changed files with 4 additions and 8 deletions

View File

@ -431,7 +431,7 @@ public class CMAESOptimizer
if (diagonalOnly <= 0) { if (diagonalOnly <= 0) {
updateCovariance(hsig, bestArx, arz, arindex, xold); updateCovariance(hsig, bestArx, arz, arindex, xold);
} else { } else {
updateCovarianceDiagonalOnly(hsig, bestArz, xold); updateCovarianceDiagonalOnly(hsig, bestArz);
} }
// Adapt step size sigma - Eq. (5) // Adapt step size sigma - Eq. (5)
sigma *= Math.exp(Math.min(1, (normps/chiN - 1) * cs / damps)); 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 hsig Flag indicating a small correction.
* @param bestArz Fitness-sorted matrix of the gaussian random values of the * @param bestArz Fitness-sorted matrix of the gaussian random values of the
* current offspring. * current offspring.
* @param xold xmean matrix of the previous generation.
*/ */
private void updateCovarianceDiagonalOnly(boolean hsig, private void updateCovarianceDiagonalOnly(boolean hsig,
final RealMatrix bestArz, final RealMatrix bestArz) {
final RealMatrix xold) {
// minor correction if hsig==false // minor correction if hsig==false
double oldFac = hsig ? 0 : ccov1Sep * cc * (2 - cc); double oldFac = hsig ? 0 : ccov1Sep * cc * (2 - cc);
oldFac += 1 - ccov1Sep - ccovmuSep; oldFac += 1 - ccov1Sep - ccovmuSep;

View File

@ -550,7 +550,7 @@ public class CMAESOptimizer
if (diagonalOnly <= 0) { if (diagonalOnly <= 0) {
updateCovariance(hsig, bestArx, arz, arindex, xold); updateCovariance(hsig, bestArx, arz, arindex, xold);
} else { } else {
updateCovarianceDiagonalOnly(hsig, bestArz, xold); updateCovarianceDiagonalOnly(hsig, bestArz);
} }
// Adapt step size sigma - Eq. (5) // Adapt step size sigma - Eq. (5)
sigma *= Math.exp(Math.min(1, (normps/chiN - 1) * cs / damps)); 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 hsig Flag indicating a small correction.
* @param bestArz Fitness-sorted matrix of the gaussian random values of the * @param bestArz Fitness-sorted matrix of the gaussian random values of the
* current offspring. * current offspring.
* @param xold xmean matrix of the previous generation.
*/ */
private void updateCovarianceDiagonalOnly(boolean hsig, private void updateCovarianceDiagonalOnly(boolean hsig,
final RealMatrix bestArz, final RealMatrix bestArz) {
final RealMatrix xold) {
// minor correction if hsig==false // minor correction if hsig==false
double oldFac = hsig ? 0 : ccov1Sep * cc * (2 - cc); double oldFac = hsig ? 0 : ccov1Sep * cc * (2 - cc);
oldFac += 1 - ccov1Sep - ccovmuSep; oldFac += 1 - ccov1Sep - ccovmuSep;