# Programming with Fortran, large eigen value problem

I use matlab/fortran to deal with some large eigenvalue problem (FEM type).

For example, I use spalloc and eigs to declare and solve the problem in Matlab,

could anyone give some advice on how can I do it in Fortran? any routine like spalloc/eigs?

If your matrices are dense, then LAPACK is the way to go. If they are sparse, then ARPACK is often better suited.

There is no standard equivalent of spalloc: LAPACK only supports dense matrices and ARPACK lets you store the data however you like, you just compute the action $A x$ for it.

You may also want to check out this stackoverflow question.

• what did you mean by "store the data however you like". the problem is essentially two steps, 1) how to declare A as a sparse matrix, 2) how to solve Ax=lBy? – lorniper Jun 11 '13 at 20:21
• With ARPACK, you don't actually pass a matrix to the library. Instead, it uses a "reverse communication interface" to give you a vector, x, and ask you to compute y = Ax for it. In a sense, your 'matrix' is really a linear operator that you can implement however you like. Ref: caam.rice.edu/software/ARPACK/UG/node9.html – Max Hutchinson Jun 11 '13 at 21:43
• however, in order to save memory, I want to use banded storage, do you know any routine that is able to format a sparse matrix A in banded form? – lorniper Jun 12 '13 at 11:44
• I don't know of any. You should probably just explicitly populate it. If the matrix is banded and symmetric (or Hermitian), then you can use BLAS (netlib.org/blas/dsbmv.f of zhbmv.f) and LAPACK (netlib.org/lapack/complex16/dsbev.f or zhbev.f). – Max Hutchinson Jun 12 '13 at 14:13

If you don't need (distributed memory) parallelization, LAPACK or ARPACK depending on the sparsity of your problems are good choices, as already answered by Max Hutchinson.

Large parallel eigenvalue solvers are a topic for ongoing research. For sparse problems, check out e.g. SLEPc, for dense problems ELPA could be interesting for you if the old workhorse ScaLAPACK doesn't cut it. The ELPA wiki contains links to a few other parallel eigensolvers as well.