From: Matthew Fernandez Date: Sat, 30 Jul 2022 01:17:00 +0000 (-0700) Subject: sfdpgen SparseStressMajorizationSmoother_new: remove 'scale_initial_coord' param X-Git-Tag: 5.0.1~22^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7695d652f3c08886acda67335abfabb9ab312bc2;p=graphviz sfdpgen SparseStressMajorizationSmoother_new: remove 'scale_initial_coord' param This is always set to true. --- diff --git a/lib/sfdpgen/post_process.c b/lib/sfdpgen/post_process.c index 588525857..0b0832337 100644 --- a/lib/sfdpgen/post_process.c +++ b/lib/sfdpgen/post_process.c @@ -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; } diff --git a/lib/sfdpgen/post_process.h b/lib/sfdpgen/post_process.h index 343bdf0f9..6c4f7a5d5 100644 --- a/lib/sfdpgen/post_process.h +++ b/lib/sfdpgen/post_process.h @@ -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); diff --git a/lib/sfdpgen/stress_model.c b/lib/sfdpgen/stress_model.c index d5fd06d5f..15b8be81f 100644 --- a/lib/sfdpgen/stress_model.c +++ b/lib/sfdpgen/stress_model.c @@ -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) {