]> granicus.if.org Git - graphviz/commitdiff
sfdpgen SparseMatrix_solve: remove 'flag' parameter
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 30 Jul 2022 00:35:04 +0000 (17:35 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 4 Aug 2022 01:10:21 +0000 (18:10 -0700)
This is always set to 0 and conveys no information to the caller.

lib/sfdpgen/post_process.c
lib/sfdpgen/sparse_solve.c
lib/sfdpgen/sparse_solve.h

index a16bd785e4a85230ee99ddefdf484462ee86c5e2..a25201dae1a92cafc381ef5a2dc04cb360e9b7a0 100644 (file)
@@ -592,7 +592,7 @@ static double uniform_stress_solve(SparseMatrix Lw, double alpha, int dim, doubl
 
 double StressMajorizationSmoother_smooth(StressMajorizationSmoother sm, int dim, double *x, int maxit_sm, double tol) {
   SparseMatrix Lw = sm->Lw, Lwd = sm->Lwd, Lwdd = NULL;
-  int i, j, k, m, *id, *jd, *iw, *jw, idiag, flag = 0, iter = 0;
+  int i, j, k, m, *id, *jd, *iw, *jw, idiag, iter = 0;
   double *w, *dd, *d, *y = NULL, *x0 = NULL, *x00 = NULL, diag, diff = 1, *lambda = sm->lambda, alpha = 0., M = 0.;
   SparseMatrix Lc = NULL;
   double dij, dist;
@@ -704,10 +704,9 @@ double StressMajorizationSmoother_smooth(StressMajorizationSmoother sm, int dim,
     if (sm->scheme == SM_SCHEME_UNIFORM_STRESS){
       uniform_stress_solve(Lw, alpha, dim, x, y, sm->tol_cg, sm->maxit_cg);
     } else {
-      SparseMatrix_solve(Lw, dim, x, y,  sm->tol_cg, sm->maxit_cg, &flag);
+      SparseMatrix_solve(Lw, dim, x, y,  sm->tol_cg, sm->maxit_cg);
     }
 
-    if (flag) goto RETURN;
 #ifdef DEBUG_PRINT
     if (Verbose) fprintf(stderr, "stress2 = %g\n",get_stress(m, dim, iw, jw, w, d, y, sm->scaling));
 #endif
index f5fefd07139311c4ed47addad027fae4e3306d06..e7a1a83b210dae7fe520333faad671bb0f275d5a 100644 (file)
@@ -236,11 +236,10 @@ double cg(Operator Ax, Operator precond, int n, int dim, double *x0, double *rhs
   return res;
 }
 
-double SparseMatrix_solve(SparseMatrix A, int dim, double *x0, double *rhs, double tol, int maxit, int *flag){
+double SparseMatrix_solve(SparseMatrix A, int dim, double *x0, double *rhs, double tol, int maxit){
   Operator Ax, precond;
   int n = A->m;
   double res = 0;
-  *flag = 0;
 
   Ax =  Operator_matmul_new(A);
   precond = Operator_diag_precon_new(A);
index 39827129e42780d612a44fe3b6a553bfabb1e56a..bfff9db19c51dcd7174d6c79eae4a78d94a52cd8 100644 (file)
@@ -21,7 +21,7 @@ struct Operator_struct {
 
 double cg(Operator Ax, Operator precond, int n, int dim, double *x0, double *rhs, double tol, int maxit);
 
-double SparseMatrix_solve(SparseMatrix A, int dim, double *x0, double *rhs, double tol, int maxit, int *flag);
+double SparseMatrix_solve(SparseMatrix A, int dim, double *x0, double *rhs, double tol, int maxit);
 
 Operator Operator_uniform_stress_matmul(SparseMatrix A, double alpha);