--- glplpx1.c 2004-08-23 04:00:00.000000000 -0400 +++ glplpx1.new.c 2004-09-11 20:38:44.000000000 -0400 @@ -905,30 +905,29 @@ "ents", ne); for (k = 1; k <= ne; k++) { /* take indices of new element */ - i = ia[k], j = ja[k]; - /* obtain pointer to i-th row */ - if (!(1 <= i && i <= lp->m)) - fault("lpx_load_matrix: ia[%d] = %d; row index out of range" - , k, i); - row = lp->row[i]; - /* obtain pointer to j-th column */ - if (!(1 <= j && j <= lp->n)) - fault("lpx_load_matrix: ja[%d] = %d; column index out of ra" - "nge", k, j); - col = lp->col[j]; - /* create new element */ - aij = dmp_get_atom(lp->aij_pool); - aij->row = row; - aij->col = col; - if (ar[k] == 0.0) - fault("lpx_load_matrix: ar[%d] = 0; zero element not allowe" - "d", k); - aij->val = ar[k]; - /* add the new element to the beginning of i-th row list */ - aij->r_prev = NULL; - aij->r_next = row->ptr; - if (row->ptr != NULL) row->ptr->r_prev = aij; - row->ptr = aij; + if(ar[k] != 0.0) { + i = ia[k], j = ja[k]; + /* obtain pointer to i-th row */ + if (!(1 <= i && i <= lp->m)) + fault("lpx_load_matrix: ia[%d] = %d; row index out of range" + , k, i); + row = lp->row[i]; + /* obtain pointer to j-th column */ + if (!(1 <= j && j <= lp->n)) + fault("lpx_load_matrix: ja[%d] = %d; column index out of ra" + "nge", k, j); + col = lp->col[j]; + /* create new element */ + aij = dmp_get_atom(lp->aij_pool); + aij->row = row; + aij->col = col; + aij->val = ar[k]; + /* add the new element to the beginning of i-th row list */ + aij->r_prev = NULL; + aij->r_next = row->ptr; + if (row->ptr != NULL) row->ptr->r_prev = aij; + row->ptr = aij; + } } /* build column lists of the constraint matrix and check elements with identical indices */