From 367a121517b2fa956dc278c102dc7403711d28d8 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sun, 27 Nov 2022 16:48:50 -0800 Subject: [PATCH] sfdpgen uniform_stress: remove 'flag' that is always set to 0 --- lib/sfdpgen/sfdpinit.c | 2 +- lib/sfdpgen/uniform_stress.c | 4 +--- lib/sfdpgen/uniform_stress.h | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/sfdpgen/sfdpinit.c b/lib/sfdpgen/sfdpinit.c index 93b55058d..b0b439d50 100644 --- a/lib/sfdpgen/sfdpinit.c +++ b/lib/sfdpgen/sfdpinit.c @@ -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; diff --git a/lib/sfdpgen/uniform_stress.c b/lib/sfdpgen/uniform_stress.c index 3777db9d0..36559a3b3 100644 --- a/lib/sfdpgen/uniform_stress.c +++ b/lib/sfdpgen/uniform_stress.c @@ -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(); diff --git a/lib/sfdpgen/uniform_stress.h b/lib/sfdpgen/uniform_stress.h index 658a539f1..c1ebf4ece 100644 --- a/lib/sfdpgen/uniform_stress.h +++ b/lib/sfdpgen/uniform_stress.h @@ -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); -- 2.40.0