vendor/scs/src/scs.c in scs-0.2.1 vs vendor/scs/src/scs.c in scs-0.2.2

- old
+ new

@@ -623,19 +623,20 @@ #endif } static scs_int has_converged(ScsWork *w, ScsResiduals *r, scs_int iter) { scs_float eps = w->stgs->eps; - if (r->res_pri < eps && r->res_dual < eps && r->rel_gap < eps) { + if (isless(r->res_pri, eps) && isless(r->res_dual, eps) && + isless(r->rel_gap, eps)) { return SCS_SOLVED; } /* Add iter > 0 to avoid strange edge case where infeasible point found * right at start of run `out/demo_SOCP_indirect 2 0.1 0.3 1506264403` */ - if (r->res_unbdd < eps && iter > 0) { + if (isless(r->res_unbdd, eps) && iter > 0) { return SCS_UNBOUNDED; } - if (r->res_infeas < eps && iter > 0) { + if (isless(r->res_infeas, eps) && iter > 0) { return SCS_INFEASIBLE; } return 0; } @@ -745,10 +746,12 @@ return SCS_NULL; } if (!(w->accel = aa_init(2 * (w->m + w->n + 1), ABS(w->stgs->acceleration_lookback), w->stgs->acceleration_lookback >= 0))) { - scs_printf("WARN: aa_init returned NULL, no acceleration applied.\n"); + if (w->stgs->verbose) { + scs_printf("WARN: aa_init returned NULL, no acceleration applied.\n"); + } } return w; } static scs_int update_work(const ScsData *d, ScsWork *w,