vendor/scs/src/normalize.c in scs-0.4.0 vs vendor/scs/src/normalize.c in scs-0.4.1
- old
+ new
@@ -24,11 +24,11 @@
* `s` is incorporated into dual_scale and primal_scale
*
*/
void SCS(normalize_b_c)(ScsScaling *scal, scs_float *b, scs_float *c) {
scs_int i;
- scs_float sigma;
+ scs_float sigma, nm_c, nm_b;
/* scale c */
for (i = 0; i < scal->n; ++i) {
c[i] *= scal->E[i];
}
@@ -36,10 +36,12 @@
for (i = 0; i < scal->m; ++i) {
b[i] *= scal->D[i];
}
/* calculate primal and dual scales */
- sigma = MAX(SCS(norm_inf)(c, scal->n), SCS(norm_inf)(b, scal->m));
+ nm_c = SCS(norm_inf)(c, scal->n);
+ nm_b = SCS(norm_inf)(b, scal->m);
+ sigma = MAX(nm_c, nm_b);
sigma = sigma < MIN_NORMALIZATION_FACTOR ? 1.0 : sigma;
sigma = sigma > MAX_NORMALIZATION_FACTOR ? MAX_NORMALIZATION_FACTOR : sigma;
sigma = SAFEDIV_POS(1.0, sigma);
/* Scale b, c */