Skip to content

Commit

Permalink
minor sd cone tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
bodono committed Oct 5, 2021
1 parent ca3c9da commit 8ba7c01
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/cones.c
Original file line number Diff line number Diff line change
Expand Up @@ -489,9 +489,9 @@ static scs_int proj_semi_definite_cone(scs_float *X, const scs_int n,
BLAS(syev)("Vectors", "Lower", &nb, Xs, &nb, e, work, &lwork, &info);
if (info != 0) {
scs_printf("WARN: LAPACK syev error, info = %i\n", info);
}
if (info < 0) {
return -1;
if (info < 0) {
return info;
}
}

first_idx = -1;
Expand Down Expand Up @@ -724,7 +724,7 @@ static void proj_power_cone(scs_float *v, scs_float a) {
/* project onto the primal K cone in the paper */
static scs_int proj_cone(scs_float *x, const ScsCone *k, ScsConeWork *c,
scs_int normalize) {
scs_int i;
scs_int i, status;
scs_int count = 0;

if (k->z) {
Expand Down Expand Up @@ -764,8 +764,9 @@ static scs_int proj_cone(scs_float *x, const ScsCone *k, ScsConeWork *c,
if (k->ssize && k->s) {
/* project onto PSD cones */
for (i = 0; i < k->ssize; ++i) {
if (proj_semi_definite_cone(&(x[count]), k->s[i], c) < 0) {
return -1;
status = proj_semi_definite_cone(&(x[count]), k->s[i], c);
if (status < 0) {
return status;
}
count += get_sd_cone_size(k->s[i]);
}
Expand Down

0 comments on commit 8ba7c01

Please sign in to comment.