]> granicus.if.org Git - graphviz/commitdiff
neatogen common_neighbors: remove unused 'v' parameter
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 18 Jan 2023 16:29:46 +0000 (08:29 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 22 Jan 2023 00:32:26 +0000 (16:32 -0800)
lib/neatogen/kkutils.c
lib/neatogen/kkutils.h
lib/neatogen/stress.c

index ab2f1afb1c2d6ba1399cee2efe957db6c91a51d2..c731c2a9602ab07307233fd214aac66642530ff3 100644 (file)
@@ -15,9 +15,9 @@
 #include <stdlib.h>
 #include <math.h>
 
-int common_neighbors(vtx_data * graph, int v, int u, int *v_vector)
+int common_neighbors(vtx_data * graph, int u, int *v_vector)
 {
-    /* count number of common neighbors of 'v' and 'u' */
+    // count number of common neighbors of 'v_vector' and 'u'
     int neighbor;
     int num_shared_neighbors = 0;
     int j;
@@ -256,9 +256,7 @@ void compute_new_weights(vtx_data * graph, int n)
            neighbor = graph[i].edges[j];
            deg_j = graph[neighbor].nedges - 1;
            weights[j] =
-               (float) (deg_i + deg_j -
-                        2 * common_neighbors(graph, i, neighbor,
-                                             vtx_vec));
+               (float)(deg_i + deg_j - 2 * common_neighbors(graph, neighbor, vtx_vec));
        }
        empty_neighbors_vec(graph, i, vtx_vec);
        weights += graph[i].nedges;
index 1dbda480766af91d9c701c5f29d7c3f3d25d3074..738b233b6af85463124bc07ffb3e979ecb33746e 100644 (file)
@@ -18,7 +18,7 @@ extern "C" {
 
     extern void fill_neighbors_vec_unweighted(vtx_data *, int vtx,
                                              int *vtx_vec);
-    extern int common_neighbors(vtx_data *, int v, int u, int *);
+    extern int common_neighbors(vtx_data *, int u, int *);
     extern void empty_neighbors_vec(vtx_data * graph, int vtx,
                                    int *vtx_vec);
     extern DistType **compute_apsp(vtx_data *, int);
index 5c5bd279adadbf8e741ba33053724e1ae6254cd0..3f18c8e100fe2641b207e35fca2efc6f8d8a16d3 100644 (file)
@@ -791,7 +791,7 @@ float *compute_apsp_artifical_weights_packed(vtx_data * graph, int n)
                neighbor = graph[i].edges[j];
                deg_j = graph[neighbor].nedges - 1;
                weights[j] = fmaxf((float)(deg_i + deg_j -
-                        2 * common_neighbors(graph, i, neighbor, vtx_vec)), graph[i].ewgts[j]);
+                        2 * common_neighbors(graph, neighbor, vtx_vec)), graph[i].ewgts[j]);
            }
            empty_neighbors_vec(graph, i, vtx_vec);
            graph[i].ewgts = weights;
@@ -807,8 +807,7 @@ float *compute_apsp_artifical_weights_packed(vtx_data * graph, int n)
                neighbor = graph[i].edges[j];
                deg_j = graph[neighbor].nedges - 1;
                weights[j] =
-                   ((float) deg_i + deg_j -
-                    2 * common_neighbors(graph, i, neighbor, vtx_vec));
+                   ((float) deg_i + deg_j - 2 * common_neighbors(graph, neighbor, vtx_vec));
            }
            empty_neighbors_vec(graph, i, vtx_vec);
            weights += graph[i].nedges;