From: Matthew Fernandez Date: Tue, 15 Feb 2022 08:04:42 +0000 (+1100) Subject: neatogen: [nfc] reflow some code X-Git-Tag: 3.0.0~26^2~10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5675235d23f2a0b4a83853a364777b8e6d1f638e;p=graphviz neatogen: [nfc] reflow some code This appears to be two copies of the same copy-pasted code. --- diff --git a/lib/neatogen/constrained_majorization.c b/lib/neatogen/constrained_majorization.c index ea1723d5f..e83e5bf60 100644 --- a/lib/neatogen/constrained_majorization.c +++ b/lib/neatogen/constrained_majorization.c @@ -348,19 +348,16 @@ int stress_majorization_with_hierarchy(vtx_data * graph, /* Input graph in spars */ for (k = 0; k < dim; k++) { set_vector_valf(len, coords[k][i], tmp_coords); - vectors_mult_additionf(len, tmp_coords, -1, - coords[k] + i + 1); + vectors_mult_additionf(len, tmp_coords, -1, coords[k] + i + 1); square_vec(len, tmp_coords); - vectors_additionf(len, tmp_coords, dist_accumulator, - dist_accumulator); + vectors_additionf(len, tmp_coords, dist_accumulator, dist_accumulator); } /* convert to 1/d_{ij} */ invert_sqrt_vec(len, dist_accumulator); /* detect overflows */ for (j = 0; j < len; j++) { - if (dist_accumulator[j] >= FLT_MAX - || dist_accumulator[j] < 0) { + if (dist_accumulator[j] >= FLT_MAX || dist_accumulator[j] < 0) { dist_accumulator[j] = 0; } } diff --git a/lib/neatogen/constrained_majorization_ipsep.c b/lib/neatogen/constrained_majorization_ipsep.c index 988099d70..fce7362c1 100644 --- a/lib/neatogen/constrained_majorization_ipsep.c +++ b/lib/neatogen/constrained_majorization_ipsep.c @@ -303,19 +303,16 @@ int stress_majorization_cola(vtx_data * graph, /* Input graph in sparse represen */ for (k = 0; k < dim; k++) { set_vector_valf(len, coords[k][i], tmp_coords); - vectors_mult_additionf(len, tmp_coords, -1, - coords[k] + i + 1); + vectors_mult_additionf(len, tmp_coords, -1, coords[k] + i + 1); square_vec(len, tmp_coords); - vectors_additionf(len, tmp_coords, dist_accumulator, - dist_accumulator); + vectors_additionf(len, tmp_coords, dist_accumulator, dist_accumulator); } /* convert to 1/d_{ij} */ invert_sqrt_vec(len, dist_accumulator); /* detect overflows */ for (j = 0; j < len; j++) { - if (dist_accumulator[j] >= FLT_MAX - || dist_accumulator[j] < 0) { + if (dist_accumulator[j] >= FLT_MAX || dist_accumulator[j] < 0) { dist_accumulator[j] = 0; } }