]> granicus.if.org Git - graphviz/commitdiff
remove useless 'flag' parameter passed around in power.c
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 12 Jun 2021 04:36:03 +0000 (21:36 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 19 Jun 2021 17:16:47 +0000 (10:16 -0700)
cmd/gvmap/power.c

index e7a6436fd900beb8fc02ae7b03726dc2b2bcfac5..3103dc9dfbac46956df735b7ea84b6f980f77f16 100644 (file)
@@ -11,7 +11,7 @@
 #include "power.h"
 #include <sparse/SparseMatrix.h>
 
-static void matvec_sparse(void *M, real *u, real **v, int transposed, int *flag);
+static void matvec_sparse(void *M, real *u, real **v, int transposed);
 
 void power_method(void *A, int n, int K, int random_seed, int maxit, real tol,
     real **eigv, real **eigs){
@@ -57,7 +57,6 @@ void power_method(void *A, int n, int K, int random_seed, int maxit, real tol,
   real res, unorm;
   int i, j, k;
   real uij;
-  int flag;
 
   K = MAX(0, MIN(n, K));
   assert(K <= n && K > 0);
@@ -91,8 +90,7 @@ void power_method(void *A, int n, int K, int random_seed, int maxit, real tol,
          u[i] = u[i] - uij *v[j][i];
        }
       }
-      matvec_sparse(A, u, &vv, FALSE, &flag);
-      assert(!flag);
+      matvec_sparse(A, u, &vv, FALSE);
 
       unorm = vector_product(n, vv, vv);/* ||u||^2 */    
       unorm = sqrt(unorm);
@@ -118,10 +116,9 @@ void power_method(void *A, int n, int K, int random_seed, int maxit, real tol,
   FREE(vv);  
 }
 
-static void matvec_sparse(void *M, real *u, real **v, int transpose, int *flag){
+static void matvec_sparse(void *M, real *u, real **v, int transpose){
   SparseMatrix A;
 
-  *flag = 0;
   A = (SparseMatrix) M;
   SparseMatrix_multiply_vector(A, u, v, transpose);
 }