[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-glpk] Re: [Help-glpk] Error delete column
From: |
Andrew Makhorin |
Subject: |
[Bug-glpk] Re: [Help-glpk] Error delete column |
Date: |
Mon, 2 Jul 2007 14:25:29 +0400 |
> 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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Bug-glpk] Re: [Help-glpk] Error delete column,
Andrew Makhorin <=