]> granicus.if.org Git - graphviz/commitdiff
sfdpgen uniform_stress: remove 'flag' that is always set to 0
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 28 Nov 2022 00:48:50 +0000 (16:48 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 30 Nov 2022 02:07:38 +0000 (18:07 -0800)
lib/sfdpgen/sfdpinit.c
lib/sfdpgen/uniform_stress.c
lib/sfdpgen/uniform_stress.h

index 93b55058dff1a260d2f8d8e97f74a42077dca728..b0b439d504537da5992d3beef790b5125a0cc45c 100644 (file)
@@ -110,7 +110,7 @@ static void sfdpLayout(graph_t * g, spring_electrical_control ctrl,
        multilevel_spring_electrical_embedding(Ndim, A, D, ctrl, sizes, pos, n_edge_label_nodes, edge_label_nodes, &flag);
        break;
     case METHOD_UNIFORM_STRESS:
-       uniform_stress(Ndim, A, pos, &flag);
+       uniform_stress(Ndim, A, pos);
        break;
     case METHOD_STRESS:{
        int maxit = 200;
index 3777db9d029a4dbda832f74fd53305a43d220425..36559a3b3f5d89ba801f10ef2d681dc4cb6453dd 100644 (file)
@@ -126,14 +126,12 @@ static SparseMatrix get_distance_matrix(SparseMatrix A, double scaling){
 
 extern void scale_to_box(double xmin, double ymin, double xmax, double ymax, int n, int dim, double *x);
 
-void uniform_stress(int dim, SparseMatrix A, double *x, int *flag){
+void uniform_stress(int dim, SparseMatrix A, double *x{
   UniformStressSmoother sm;
   double lambda0 = 10.1, M = 100, scaling = 1.;
   int maxit = 300, samepoint = TRUE, i, k, n = A->m;
   SparseMatrix B = NULL;
 
-  *flag = 0;
-
   /* just set random initial for now */
   for (i = 0; i < dim*n; i++) {
     x[i] = M*drand();
index 658a539f179f0d80e7bb4d858ef6b4e2f652df40..c1ebf4ece57cc907a984d145b2fd83198bee0c9d 100644 (file)
@@ -18,4 +18,4 @@ typedef StressMajorizationSmoother UniformStressSmoother;
 
 void UniformStressSmoother_delete(UniformStressSmoother sm);
 
-void uniform_stress(int dim, SparseMatrix A, double *x, int *flag);
+void uniform_stress(int dim, SparseMatrix A, double *x);