bug-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Uninitialized variable in npp_reduce_ineq_coef


From: Domingo Alvarez Duarte
Subject: Re: Uninitialized variable in npp_reduce_ineq_coef
Date: Fri, 25 Sep 2020 14:10:49 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

Hello !

Forgt about it !

It was my bad, looking too much code and got confused and reading:

"b = + row->lb;" as  "b += row->lb;"

Sorry by the noise !

Cheers !

On 25/9/20 14:08, Domingo Alvarez Duarte wrote:
Hello !

Looking through the code and changing "glp_double" by "glp_long_double" in my GLPK fork I found an unitialized variable in npp_reduce_ineq_coef in "src/npp/npp4.c":

====

int npp_reduce_ineq_coef(NPP *npp, NPPROW *row)
{     /* reduce inequality constraint coefficients */
      NPPROW *copy;
      NPPAIJ *aij;
      struct elem *ptr, *e;
      int kase, count[2];
      glp_double b;  //***********!!!!!!!!! here not initialized
      /* the row must be inequality constraint */
      xassert(row->lb < row->ub);
      count[0] = count[1] = 0;
      for (kase = 0; kase <= 1; kase++)
      {  if (kase == 0)
         {  /* process row lower bound */
            if (row->lb == -GLP_DBL_MAX) continue;
#ifdef GLP_DEBUG
            xprintf("L");
#endif
            ptr = copy_form(npp, row, +1.0);
            b = + row->lb; ////****!!!!!! if it enter here when kase == 0 then we are using "b" uninitialized
         }

====

Cheers !




reply via email to

[Prev in Thread] Current Thread [Next in Thread]