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

index f36e7469c51291fe6f31b46a27c05e8e07738e20..3874028102fc9d72c739179e33fa69ea32265e1d 100644 (file)
@@ -477,7 +477,6 @@ void spring_electrical_embedding_fast(int dim, SparseMatrix A0, spring_electrica
   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;
@@ -521,7 +520,6 @@ void spring_electrical_embedding_fast(int dim, SparseMatrix A0, spring_electrica
   KP = pow(K, 1 - p);
   CRK = pow(C, (2.-p)/3.)/K;
 
-  xold = gv_calloc(dim * n, sizeof(double));
   force = gv_calloc(dim * n, sizeof(double));
 
   do {
@@ -530,7 +528,6 @@ void spring_electrical_embedding_fast(int dim, SparseMatrix A0, spring_electrica
 #endif
 
     iter++;
-    memcpy(xold, x, sizeof(double)*dim*n);
     Fnorm0 = Fnorm;
     Fnorm = 0.;
 
@@ -643,7 +640,6 @@ void spring_electrical_embedding_fast(int dim, SparseMatrix A0, spring_electrica
   oned_optimizer_delete(qtree_level_optimizer);
   ctrl->max_qtree_level = max_qtree_level;
 
-  free(xold);
   if (A != A0) SparseMatrix_delete(A);
   free(force);
 }