Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check if constraints are not NULL before unsetting equilibration #212

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
4 changes: 2 additions & 2 deletions src/equil.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,9 +371,9 @@ void unset_equilibration(pwork *w)
idxint i;
/* idxint num_cols = w->A ? w->A->n : w->G->n; */
idxint num_A_rows = w->A ? w->A->m : 0;
idxint num_G_rows = w->G->m;
idxint num_G_rows = w->G ? w->G->m : 0;

if(w->A)
if(num_A_rows > 0)
restore(w->Aequil, w->xequil, w->A);
if(num_G_rows > 0)
restore(w->Gequil, w->xequil, w->G);
Expand Down