Skip to content

Commit

Permalink
check if constraints are not NULL before unsetting equilibration
Browse files Browse the repository at this point in the history
  • Loading branch information
claisne committed Jun 5, 2022
1 parent 5d3aa62 commit b1ad485
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ecos.c
Original file line number Diff line number Diff line change
Expand Up @@ -1655,11 +1655,11 @@ void ECOS_updateData(pwork *w, pfloat *Gpr, pfloat *Apr,
/* Only unequilibrate the old data if the new data is in a different location in memory. */
/* This is required for backward compatibility since existing code might need this step. */
if (
((Gpr + w->G->nnz < w->G->pr) || (w->G->pr + w->G->nnz < Gpr)) &&
((Apr + w->A->nnz < w->A->pr) || (w->A->pr + w->A->nnz < Apr)) &&
(!w->G || ((Gpr + w->G->nnz < w->G->pr) || (w->G->pr + w->G->nnz < Gpr))) &&
(!w->A || ((Apr + w->A->nnz < w->A->pr) || (w->A->pr + w->A->nnz < Apr))) &&
((c + w->n < w->c) || (w->c + w->n < c)) &&
((h + w->m < w->h) || (w->h + w->m < h)) &&
((b + w->p < w->b) || (w->b + w->p < b))
(!w->h || ((h + w->m < w->h) || (w->h + w->m < h))) &&
(!w->b || ((b + w->p < w->b) || (w->b + w->p < b)))
){
unset_equilibration(w);
}
Expand Down

0 comments on commit b1ad485

Please sign in to comment.