Skip to content

Commit

Permalink
Merge pull request #562 from pmslavin/cec2014_uninitialized
Browse files Browse the repository at this point in the history
Add initialization for potentially-used cec2014 vars
  • Loading branch information
bluescarni authored Dec 13, 2023
2 parents a44f1aa + 6bcb3f5 commit f59e2c0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/problems/cec2014.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@ void cec2014::weierstrass_func(const double *x, double *f, const unsigned nx, co

unsigned i, j, k_max;
double sum, sum2, a, b;
sum2 = 0.0;
a = 0.5;
b = 3.0;
k_max = 20;
Expand Down Expand Up @@ -1295,6 +1296,7 @@ void cec2014::oszfunc(const double *x, double *xosz, const unsigned nx) const
unsigned i;
int sx;
double c1, c2, xx;
xx = 0.0;
for (i = 0; i < nx; i++) {
if (i == 0 || i == nx - 1) {
if (x[i] != 0) {
Expand Down

0 comments on commit f59e2c0

Please sign in to comment.