A bug was found in the api routines glp_set_mat_row and glp_set_mat_col.

The bug appears only if a row/column to be set or changed contains zero
elements.

To fix the bug please insert one line in the routine glp_set_mat_row
(file glpapi01.c) as follows:

709         /* remove the element from the column list */
710         xassert(aij->c_prev == NULL);
711         aij->col->ptr = aij->c_next;
+++>>>      if (aij->c_next != NULL) aij->c_next->c_prev = NULL;
712         /* return the element to the memory pool */

and another line in the routine glp_set_mat_col as follows:

814      {  /* remove the element from the row list */
815         xassert(aij->r_prev == NULL);
816         aij->row->ptr = aij->r_next;
+++>>>      if (aij->r_next != NULL) aij->r_next->r_prev = NULL;
817         /* remove the element from the column list */


Andrew Makhorin



_______________________________________________
Bug-glpk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-glpk

Reply via email to