]> granicus.if.org Git - graphviz/commitdiff
neatogen: [nfc] reflow some code
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Tue, 15 Feb 2022 08:04:42 +0000 (19:04 +1100)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 16 Feb 2022 10:06:30 +0000 (21:06 +1100)
This appears to be two copies of the same copy-pasted code.

lib/neatogen/constrained_majorization.c
lib/neatogen/constrained_majorization_ipsep.c

index ea1723d5feff6c082a72a6c379e68d14e0766159..e83e5bf60b9741d4b09aa66bae59e96de0d441af 100644 (file)
@@ -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;
                }
            }
index 988099d70c3951952ecf1d80fe28f2b0316ae8cc..fce7362c1586414f26f35b43c38889ec1dd84db2 100644 (file)
@@ -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;
                }
            }