From 5f039f421e5043b335003fa1a5edc5881aeb0bdb Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Fri, 11 Jun 2021 21:01:18 -0700 Subject: [PATCH] remove unused matvec_dense --- cmd/gvmap/power.c | 33 --------------------------------- cmd/gvmap/power.h | 4 +--- 2 files changed, 1 insertion(+), 36 deletions(-) diff --git a/cmd/gvmap/power.c b/cmd/gvmap/power.c index 236af2318..5b25f80da 100644 --- a/cmd/gvmap/power.c +++ b/cmd/gvmap/power.c @@ -159,36 +159,3 @@ void mat_print_dense(real *M, int m, int n){ } fprintf(stderr,"}\n"); } - -void matvec_dense(void *M, int m, int n, real *u, real **v, int transpose, - int *flag){ - /* M.u or M^T.u */ - real *A; - int i, j; - - A = (real*) M; - *flag = 0; - - - if (!transpose){ - if (!(*v)) *v = MALLOC(sizeof(real)*m); - for (i = 0; i < m; i++){ - (*v)[i] = 0; - for (j = 0; j < n; j++){ - (*v)[i] += A[i*n+j]*u[j]; - } - } - } else { - if (!(*v)) *v = MALLOC(sizeof(real)*n); - for (i = 0; i < n; i++){ - (*v)[i] = 0; - } - for (i = 0; i < m; i++){ - for (j = 0; j < n; j++){ - (*v)[j] += A[i*n+j]*u[i]; - } - } - } - - return; -} diff --git a/cmd/gvmap/power.h b/cmd/gvmap/power.h index 52d1e87ce..1c0609683 100644 --- a/cmd/gvmap/power.h +++ b/cmd/gvmap/power.h @@ -13,14 +13,12 @@ #include -/* if you have a standard dense/sparse matrix, set matvec to matvec_dense/matvec_sparse*/ +/* if you have a standard sparse matrix, set matvec to matvec_sparse*/ void power_method(void (*matvec)(void *M, int m, int n, real *u, real **v, int transposed, int *flag), void *A, int n, int K, int random_seed, int maxit, real tol, real **eigv, real **eigs); void matvec_sparse(void *M, int m, int n, real *u, real **v, int transposed, int *flag); -void matvec_dense(void *M, int m, int n, real *u, real **v, int transposed, int *flag); - void mat_print_dense(real *M, int m, int n); -- 2.40.0