From: Matthew Fernandez Date: Wed, 18 Jan 2023 16:29:46 +0000 (-0800) Subject: neatogen common_neighbors: remove unused 'v' parameter X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4d587429f9d822d407a71a5329bd86f9ce673d2e;p=graphviz neatogen common_neighbors: remove unused 'v' parameter --- diff --git a/lib/neatogen/kkutils.c b/lib/neatogen/kkutils.c index ab2f1afb1..c731c2a96 100644 --- a/lib/neatogen/kkutils.c +++ b/lib/neatogen/kkutils.c @@ -15,9 +15,9 @@ #include #include -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; diff --git a/lib/neatogen/kkutils.h b/lib/neatogen/kkutils.h index 1dbda4807..738b233b6 100644 --- a/lib/neatogen/kkutils.h +++ b/lib/neatogen/kkutils.h @@ -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); diff --git a/lib/neatogen/stress.c b/lib/neatogen/stress.c index 5c5bd279a..3f18c8e10 100644 --- a/lib/neatogen/stress.c +++ b/lib/neatogen/stress.c @@ -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;