]> granicus.if.org Git - graphviz/commitdiff
inline matvec_sparse
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 12 Jun 2021 04:40:34 +0000 (21:40 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 19 Jun 2021 17:16:47 +0000 (10:16 -0700)
Following the previous commits, this function was adding nothing except a cast
which, in itself, was unnecessary.

cmd/gvmap/power.c

index 3103dc9dfbac46956df735b7ea84b6f980f77f16..963ae570875994da3da2fb4bd6f4b73c35651f86 100644 (file)
@@ -11,8 +11,6 @@
 #include "power.h"
 #include <sparse/SparseMatrix.h>
 
-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){
   /* find k-largest eigenvectors of a matrix A. Result in eigv. if eigv == NULL; memory will be allocated.
@@ -90,7 +88,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);
+      SparseMatrix_multiply_vector(A, u, &vv, FALSE);
 
       unorm = vector_product(n, vv, vv);/* ||u||^2 */    
       unorm = sqrt(unorm);
@@ -115,10 +113,3 @@ void power_method(void *A, int n, int K, int random_seed, int maxit, real tol,
   FREE(u);
   FREE(vv);  
 }
-
-static void matvec_sparse(void *M, real *u, real **v, int transpose){
-  SparseMatrix A;
-
-  A = (SparseMatrix) M;
-  SparseMatrix_multiply_vector(A, u, v, transpose);
-}