From: Matthew Fernandez Date: Sat, 12 Jun 2021 04:40:34 +0000 (-0700) Subject: inline matvec_sparse X-Git-Tag: 2.48.0~46^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=46becccdef6d10c854424642d78dc14bb2de8b80;p=graphviz inline matvec_sparse Following the previous commits, this function was adding nothing except a cast which, in itself, was unnecessary. --- diff --git a/cmd/gvmap/power.c b/cmd/gvmap/power.c index 3103dc9df..963ae5708 100644 --- a/cmd/gvmap/power.c +++ b/cmd/gvmap/power.c @@ -11,8 +11,6 @@ #include "power.h" #include -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); -}