#include "power.h"
#include <sparse/SparseMatrix.h>
-void power_method(void (*matvec)(void *, int, int, real*, real **, int, int*),
+void power_method(void (*matvec)(void *, int, real*, real **, int, int*),
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.
maxium of maxit iterations will be done, and tol is the convergence criterion
u[i] = u[i] - uij *v[j][i];
}
}
- matvec(A, n, n, u, &vv, FALSE, &flag);
+ matvec(A, n, u, &vv, FALSE, &flag);
assert(!flag);
unorm = vector_product(n, vv, vv);/* ||u||^2 */
FREE(vv);
}
-
-void matvec_sparse(void *M, int m, int n, real *u, real **v, int transpose,
- int *flag){
+void matvec_sparse(void *M, int n, real *u, real **v, int transpose, int *flag){
SparseMatrix A;
*flag = 0;
#include <sparse/general.h>
/* 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 power_method(void (*matvec)(void *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_sparse(void *M, int n, real *u, real **v, int transposed, int *flag);
#endif