From: Matthew Fernandez Date: Sat, 15 Jan 2022 22:04:37 +0000 (-0800) Subject: Agglomerative_Ink_Bundling: remove unused 'prev' pointers X-Git-Tag: 3.0.0~63^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0b2f735a9cd0f9cdf00814a0e3e88e2bb4a5f29d;p=graphviz Agglomerative_Ink_Bundling: remove unused 'prev' pointers This struct was used as a node in a doubly-linked list. But the back pointers were never used. This commit simplifies it into a singly-linked-list. --- diff --git a/lib/mingle/agglomerative_bundling.cpp b/lib/mingle/agglomerative_bundling.cpp index eaf36c0c1..f6e21c6b8 100644 --- a/lib/mingle/agglomerative_bundling.cpp +++ b/lib/mingle/agglomerative_bundling.cpp @@ -45,7 +45,6 @@ static Agglomerative_Ink_Bundling Agglomerative_Ink_Bundling_init(SparseMatrix A grid->R0 = NULL; grid->R = NULL; grid->next = NULL; - grid->prev = NULL; grid->inks = (double*)MALLOC(sizeof(double)*(A->m)); grid->edges = edges; grid->delete_top_level_A = 0; @@ -272,7 +271,6 @@ static Agglomerative_Ink_Bundling Agglomerative_Ink_Bundling_establish(Agglomera cgrid = Agglomerative_Ink_Bundling_establish(cgrid, pick, angle_param, angle); grid->next = cgrid; - cgrid->prev = grid; } else { if (Verbose > 1) fprintf(stderr,"no more improvement, orig ink = %f, gain = %f, stop and final bundling found\n", grand_total_ink, grand_total_gain); diff --git a/lib/mingle/agglomerative_bundling.h b/lib/mingle/agglomerative_bundling.h index d3c6222a8..aa347bde0 100644 --- a/lib/mingle/agglomerative_bundling.h +++ b/lib/mingle/agglomerative_bundling.h @@ -21,7 +21,6 @@ struct Agglomerative_Ink_Bundling_struct { the nodes on the finest grid corresponding to the coarsest node 1, etc */ SparseMatrix R;/* striction mtrix from level to level + 1*/ Agglomerative_Ink_Bundling next; - Agglomerative_Ink_Bundling prev; double *inks; /* amount of ink needed to draw this edge/bundle. Dimension n. */ double total_ink; /* amount of ink needed to draw this edge/bundle. Dimension n. */ pedge* edges; /* the original edge info. This does not vary level to level and is of dimenion n0, where n0 is the number of original edges */