0
votes

I tried to use ARPACK using some examples (here), but I could not even figure out how to input my matrix. From this question, It seems that the implementations in Python and Matlab are the only solution to avoid the complexity of ARPACK. Is there some (Fortran-based) way to do this, also avoiding to calculate all the eigenvalues/eigenvectors?

1
It seems that why does it seem? What is your actual problem? Were you able to use ARPACK at all? What is the question? How to enter the matrix properly? How did you do that when it did not work? How did the problem exhibit? Error messages? Wrong results? How did your code look like?Vladimir F Героям слава
The question is all in the title. I found ARPACK too complex for my problem and I would like to know if there is a simpler method to do it in Fortran.Garini
Are you aware that library recommendation questions are off-topic? Instead you should describe the problem and "what has been done so far to solve it".Vladimir F Героям слава
The problem is simple and the solution should be a line of code. If this is calling a library or a wrapper or a system call or whatever, it is not relevant to me. I tried to read the very "well written" manual of ARPACK but it is really an overkill for my specific problem. I could not find other ways online. If this question would have been more suited for other Q/A platforms, I apologize.Garini

1 Answers

1
votes

I wrote a wrapper which needs only to set the matrix A and the number of eigenvalues (e.g. nev = 1 if you need only the first eigenvalue). The code is adapted from the specific application which can be found here. My module-like version needs only to set the matrix A, the number of features, the number of eigenvalues and which of them should be taken ('LM' - Largest Magnitude'.

The code is available as a Gist here.

NB: ARPACK is different from LAPACK because it is usually optimized for dense matrices while this is optimized for large sparse matrices.

ARPACK package is designed to compute a few eigenvalues and corresponding eigenvectors of large sparse or structured matrices, using the Implicitly Restarted Arnoldi Method (IRAM) or, in the case of symmetric matrices, the corresponding variant of the Lanczos algorithm. It is used by many popular numerical computing environments such as SciPy, Mathematica, GNU Octave and MATLAB to provide this functionality. (source: Wikipedia)