> When I delete columns, I obtain this message:

> GLPK internal error: 1 <= k && k <= m+n; file glpapi06.c, line 372

> But, columns are non-basic

> Why?

Due to a bug. Thank you for your bug report.

The bug appears only in 4.18, where glp_del_cols is more intelligent.

I have fixed the bug, so it must disappear in 4.19.

If you need to fix the bug right now, please, replace the tail of the
routine glp_del_cols (see file glpapi01.c):

      /* set new number of columns */
      lp->n = n_new;
      return;
}

by the following code:

      /* set new number of columns */
      lp->n = n_new;
#if 1
      /* if the basis header is still valid, adjust it */
      if (lp->valid)
      {  int m = lp->m;
         int *bhead = lp->bhead;
         for (j = 1; j <= n_new; j++)
         {  k = lp->col[j]->bind;
            if (k != 0)
            {  xassert(1 <= k && k <= m);
               bhead[k] = m + j;
            }
         }
      }
#endif
      return;
}

(I marked the fragment to be inserted by #if-#endif.)


Andrew Makhorin



_______________________________________________
Bug-glpk mailing list
Bug-glpk@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-glpk

Reply via email to