Skip to content

Commit

Permalink
Fix Wshadow warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jschueller committed Oct 26, 2024
1 parent d2a1c44 commit fc55d5e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/algs/ags/ags.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ int ags_minimize(unsigned n, nlopt_func func, void *data, unsigned m, nlopt_cons
{
if (fc[i].m != 1)
return NLOPT_INVALID_ARGS;
functions.push_back([fc, n, i](const double* x) {
functions.push_back([fc, n, i](const double* x_) {
double val = 0;
nlopt_eval_constraint(&val, NULL, &fc[i], n, x);
nlopt_eval_constraint(&val, NULL, &fc[i], n, x_);
return val;
});
}
functions.push_back([func, data, n, stop](const double* x) {
functions.push_back([func, data, n, stop](const double* x_) {
++ *(stop->nevals_p);
return func(n, x, NULL, data);});
return func(n, x_, NULL, data);});

ags::SolverParameters params;
params.r = ags_r;
Expand Down
6 changes: 3 additions & 3 deletions src/algs/stogo/global.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@ class Global: public GlobalParams {
Pgrad Gradient ;
long int numeval;

virtual double ObjectiveGradient(RCRVector xy, RVector&grad, whichO which){
virtual double ObjectiveGradient(RCRVector xy, RVector&gradient, whichO which){
++numeval;
switch (which) {
case OBJECTIVE_AND_GRADIENT:
Gradient(xy, grad);
Gradient(xy, gradient);
return Objective(xy);
case OBJECTIVE_ONLY:
return Objective(xy);
case GRADIENT_ONLY:
Gradient(xy, grad);
Gradient(xy, gradient);
}
return 0.0;
}
Expand Down
6 changes: 3 additions & 3 deletions src/algs/stogo/tools.cc
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ bool TBox::Intersection(RCRVector x, RCRVector h, RCRVector z) {

double TBox::LowerBound(double maxgrad) {
// Lower bound estimation
double lb=minf ;
double lbound=minf;
double f1,f2,est ;
list<Trial>::const_iterator itr1,itr2 ;

Expand All @@ -406,7 +406,7 @@ double TBox::LowerBound(double maxgrad) {
x2=(*itr2).xvals ; f2=(*itr2).objval ;
axpy(-1.0,x2,x1) ; // x1=x1-x2
est=0.5*(f1+f2-maxgrad*norm2(x1)) ;
lb=min(lb,est) ;
lbound=min(lbound,est) ;
// cout << "est=" << est << " x1=" << x1 << " x2=" << x2 << endl ;
}
}
Expand All @@ -419,5 +419,5 @@ double TBox::LowerBound(double maxgrad) {
lb=min(lb,est);
}
#endif
return lb ;
return lbound;
}

0 comments on commit fc55d5e

Please sign in to comment.