From a74e0f9f44927f8a10c2e7e78b84310b06f72ad0 Mon Sep 17 00:00:00 2001 From: Julien Schueller Date: Tue, 16 Jan 2024 15:02:39 +0100 Subject: [PATCH] AGS: Fix Wshadow warning --- src/algs/ags/local_optimizer.cc | 2 +- src/algs/ags/solver.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/algs/ags/local_optimizer.cc b/src/algs/ags/local_optimizer.cc index b96c5a60..a4d6000e 100644 --- a/src/algs/ags/local_optimizer.cc +++ b/src/algs/ags/local_optimizer.cc @@ -83,7 +83,7 @@ Trial HookeJeevesOptimizer::Optimize(std::shared_ptr> problem mTrialsCounters[mPreviousResearchDirection.idx]++; } - for(size_t i = 0; i < mTrialsCounters.size(); i++) + for(size_t j = 0; j < mTrialsCounters.size(); ++ j) trialsCounters[i] += mTrialsCounters[i]; return mPreviousResearchDirection; diff --git a/src/algs/ags/solver.cc b/src/algs/ags/solver.cc index f403504a..7ef24953 100644 --- a/src/algs/ags/solver.cc +++ b/src/algs/ags/solver.cc @@ -239,8 +239,8 @@ void NLPSolver::MakeTrials() if(idx > mMaxIdx) { mMaxIdx = idx; - for(int i = 0; i < mMaxIdx; i++) - mZEstimations[i] = -mParameters.epsR*mHEstimations[i]; + for(int j = 0; j < mMaxIdx; ++ j) + mZEstimations[j] = -mParameters.epsR*mHEstimations[j]; mNeedRefillQueue = true; } if (idx == mProblem->GetConstraintsNumber())