]> granicus.if.org Git - graphviz/commitdiff
sfdpgen spring_electrical_embedding: remove unused 'xold'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 27 Nov 2022 19:33:08 +0000 (11:33 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 30 Nov 2022 01:04:39 +0000 (17:04 -0800)
lib/sfdpgen/spring_electrical.c

index 15e23ea3e109e80894d470a12ae2b2c2575e18d8..f9ee807feec16eabd8b925db31803c7af0d1a569 100644 (file)
@@ -817,7 +817,6 @@ void spring_electrical_embedding(int dim, SparseMatrix A0, spring_electrical_con
   int i, j, k;
   double p = ctrl->p, K = ctrl->K, C = ctrl->C, CRK, tol = ctrl->tol, maxiter = ctrl->maxiter, cool = ctrl->cool, step = ctrl->step, KP;
   int *ia = NULL, *ja = NULL;
-  double *xold = NULL;
   double *f = NULL, dist, F, Fnorm = 0, Fnorm0;
   int iter = 0;
   int adaptive_cooling = ctrl->adaptive_cooling;
@@ -881,7 +880,6 @@ void spring_electrical_embedding(int dim, SparseMatrix A0, spring_electrical_con
 #endif
 
   f = gv_calloc(dim, sizeof(double));
-  xold = gv_calloc(dim * n, sizeof(double));
   do {
 
     //#define VIS_MULTILEVEL
@@ -898,7 +896,6 @@ void spring_electrical_embedding(int dim, SparseMatrix A0, spring_electrical_con
 #endif
 
     iter++;
-    memcpy(xold, x, sizeof(double)*dim*n);
     Fnorm0 = Fnorm;
     Fnorm = 0.;
     nsuper_avg = 0;
@@ -1032,7 +1029,6 @@ void spring_electrical_embedding(int dim, SparseMatrix A0, spring_electrical_con
     oned_optimizer_delete(qtree_level_optimizer);
     ctrl->max_qtree_level = max_qtree_level;
   }
-  free(xold);
   if (A != A0) SparseMatrix_delete(A);
   free(f);
   free(center);