]> granicus.if.org Git - graphviz/commitdiff
sfdpgen SparseStressMajorizationSmoother_new: remove 'scale_initial_coord' param
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 30 Jul 2022 01:17:00 +0000 (18:17 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 4 Aug 2022 01:10:28 +0000 (18:10 -0700)
This is always set to true.

lib/sfdpgen/post_process.c
lib/sfdpgen/post_process.h
lib/sfdpgen/stress_model.c

index 58852585771a4d26a4b930c8e0656e8abbfac4d9..0b0832337ac0763f4cc0da8d7073f426c300fe6c 100644 (file)
@@ -294,7 +294,7 @@ StressMajorizationSmoother StressMajorizationSmoother2_new(SparseMatrix A, int d
 }
        
 StressMajorizationSmoother SparseStressMajorizationSmoother_new(SparseMatrix A, int dim, double lambda0, double *x,
-                                                               int weighting_scheme, int scale_initial_coord){
+                                                               int weighting_scheme){
   /* solve a stress model to achieve the ideal distance among a sparse set of edges recorded in A.
      A must be a real matrix.
    */
@@ -391,11 +391,7 @@ StressMajorizationSmoother SparseStressMajorizationSmoother_new(SparseMatrix A,
     iw[i+1] = nz;
     id[i+1] = nz;
   }
-  if (scale_initial_coord){
-    s = stop/sbot;
-  } else {
-    s = 1.;
-  }
+  s = stop/sbot;
   if (s == 0) {
     return NULL;
   }
index 343bdf0f990f272adca3f34b3f2dfc5e16572807..6c4f7a5d5fa58e572fa1c4dbd6923881a026dda9 100644 (file)
@@ -77,7 +77,7 @@ void SparseStressMajorizationSmoother_delete(SparseStressMajorizationSmoother sm
 
 enum {WEIGHTING_SCHEME_NONE, WEIGHTING_SCHEME_SQR_DIST};
 SparseStressMajorizationSmoother SparseStressMajorizationSmoother_new(SparseMatrix A, int dim, double lambda, double *x, 
-                                                                     int weighting_scheme, int scale_initial_coord);
+                                                                     int weighting_scheme);
 
 double SparseStressMajorizationSmoother_smooth(SparseStressMajorizationSmoother sm, int dim, double *x, int maxit_sm, double tol);
 
index d5fd06d5f6ad13cdfc3ef5e030fac04e0bea95a3..15b8be81f2133d60504c090b08a052c0a24edf41 100644 (file)
@@ -31,9 +31,9 @@ static void stress_model_core(int dim, SparseMatrix B, double **x, int edge_len_
   }
 
   if (edge_len_weighted){
-    sm = SparseStressMajorizationSmoother_new(A, dim, lambda, *x, WEIGHTING_SCHEME_SQR_DIST, TRUE);/* do not under weight the long distances */
+    sm = SparseStressMajorizationSmoother_new(A, dim, lambda, *x, WEIGHTING_SCHEME_SQR_DIST);/* do not under weight the long distances */
   } else {
-    sm = SparseStressMajorizationSmoother_new(A, dim, lambda, *x, WEIGHTING_SCHEME_NONE, TRUE);/* weight the long distances */
+    sm = SparseStressMajorizationSmoother_new(A, dim, lambda, *x, WEIGHTING_SCHEME_NONE);/* weight the long distances */
   }
 
   if (!sm) {