]> granicus.if.org Git - graphviz/commitdiff
mingle: remove a 'flag' parameter that is always set to 0
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 29 Sep 2022 02:00:58 +0000 (19:00 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 30 Sep 2022 04:08:54 +0000 (21:08 -0700)
lib/mingle/agglomerative_bundling.cpp
lib/mingle/agglomerative_bundling.h
lib/mingle/edge_bundling.cpp

index b7fbf998d44754fac970704ca13e513916167073..692a4e1539222417aa6250bcabb464146f989584 100644 (file)
@@ -299,7 +299,7 @@ static Agglomerative_Ink_Bundling Agglomerative_Ink_Bundling_new(SparseMatrix A0
   return grid;
 }
 
-static pedge* agglomerative_ink_bundling_internal(int dim, SparseMatrix A, pedge* edges, int nneighbors, int *recurse_level, int MAX_RECURSE_LEVEL, double angle_param, double angle, double *current_ink, double *ink00, int *flag){
+static pedge* agglomerative_ink_bundling_internal(int dim, SparseMatrix A, pedge* edges, int nneighbors, int *recurse_level, int MAX_RECURSE_LEVEL, double angle_param, double angle, double *current_ink, double *ink00{
 
   int i, j, jj, k;
   int *ia, *ja;
@@ -317,8 +317,6 @@ static pedge* agglomerative_ink_bundling_internal(int dim, SparseMatrix A, pedge
 
   assert(A->m == A->n);
 
-  *flag = 0;
-
   start = clock();
   grid = Agglomerative_Ink_Bundling_new(A, edges, angle_param, angle);
   if (Verbose > 1)
@@ -425,7 +423,7 @@ static pedge* agglomerative_ink_bundling_internal(int dim, SparseMatrix A, pedge
 
     A_mid = nearest_neighbor_graph(ne, MIN(nneighbors, ne), xx.data(), eps);
 
-    agglomerative_ink_bundling_internal(dim, A_mid, mid_edges, nneighbors, recurse_level, MAX_RECURSE_LEVEL, angle_param, angle, current_ink, ink00, flag);
+    agglomerative_ink_bundling_internal(dim, A_mid, mid_edges, nneighbors, recurse_level, MAX_RECURSE_LEVEL, angle_param, angle, current_ink, ink00);
     SparseMatrix_delete(A_mid);
     
     /* patching edges with the new mid-section */
@@ -471,13 +469,13 @@ static pedge* agglomerative_ink_bundling_internal(int dim, SparseMatrix A, pedge
 }
 
 
-pedge* agglomerative_ink_bundling(int dim, SparseMatrix A, pedge* edges, int nneighbor, int MAX_RECURSE_LEVEL, double angle_param, double angle, int *flag){
+pedge* agglomerative_ink_bundling(int dim, SparseMatrix A, pedge* edges, int nneighbor, int MAX_RECURSE_LEVEL, double angle_param, double angle{
   int recurse_level = 0;
   double current_ink = -1, ink0;
   pedge *edges2;
 
   ink_count = 0;
-  edges2 = agglomerative_ink_bundling_internal(dim, A, edges, nneighbor, &recurse_level, MAX_RECURSE_LEVEL, angle_param, angle, &current_ink, &ink0, flag);
+  edges2 = agglomerative_ink_bundling_internal(dim, A, edges, nneighbor, &recurse_level, MAX_RECURSE_LEVEL, angle_param, angle, &current_ink, &ink0);
 
   
   if (Verbose > 1)
index dde61da101489354480fe55024f7316c9e475d92..254e2ada0732b2eea7fc892013460a7cbab4b0bf 100644 (file)
@@ -29,4 +29,4 @@ struct Agglomerative_Ink_Bundling_struct {
   int delete_top_level_A;/*whether the top level matrix should be deleted on garbage collecting the grid */
 };
 
-pedge* agglomerative_ink_bundling(int dim, SparseMatrix A, pedge* edges, int nneighbor, int max_recursion, double angle_param, double angle, int *flag);
+pedge* agglomerative_ink_bundling(int dim, SparseMatrix A, pedge* edges, int nneighbor, int max_recursion, double angle_param, double angle);
index 46b06148136c91da001c11f582e924239ca1373c..19cf62aa72ac932dd59d55aba87c846c79c5e037 100644 (file)
@@ -602,7 +602,6 @@ pedge* edge_bundling(SparseMatrix A0, int dim, double *x, int maxit_outer, doubl
   int k;
   double step0 = 0.1, start = 0.0;
   int maxit = 10;
-  int flag; 
 
   assert(A->n == ne);
   edges = (pedge*)MALLOC(sizeof(pedge)*ne);
@@ -626,8 +625,7 @@ pedge* edge_bundling(SparseMatrix A0, int dim, double *x, int maxit_outer, doubl
   } else if (method == METHOD_INK_AGGLOMERATE){
 #ifdef HAVE_ANN
     /* plan: merge a node with its neighbors if doing so improve. Form coarsening graph, repeat until no more ink saving */
-    edges = agglomerative_ink_bundling(dim, A, edges, nneighbor, max_recursion, angle_param, angle, &flag);
-    assert(!flag);
+    edges = agglomerative_ink_bundling(dim, A, edges, nneighbor, max_recursion, angle_param, angle);
 #else
     agerr (AGERR, "Graphviz built without approximate nearest neighbor library ANN; agglomerative inking not available\n");
     edges = edges;