by cottrell » Sun Jul 11, 2010 9:55 pm
On LDA, the doc says:
* LDA (input) INTEGER
* The leading dimension of the array A. LDA >= max(1,N).
Now N is the number of columns in the input matrix. But the input matrix is
symmetric, so we'd expect it to be N x N, right? In that case LDA = N.
The ">=" part in the comment just allows for the possibility that the
input matrix A is in fact part of a larger array, with a greater number of
rows than are actually used in this function. But unless you're doing
something tricksy, "LDA" is just the rows of A, and equals N.
More from the doc:
* WORK (workspace/output) REAL array, dimension (MAX(1,LWORK))
* On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
*
* LWORK (input) INTEGER
* The length of the array WORK. LWORK >= max(1,3*N-1).
* For optimal efficiency, LWORK >= (NB+2)*N,
* where NB is the blocksize for SSYTRD returned by ILAENV.
*
* If LWORK = -1, then a workspace query is assumed; the routine
* only calculates the optimal size of the WORK array, returns
* this value as the first entry of the WORK array, and no error
* message related to LWORK is issued by XERBLA.
The idea here is that you call such a function two times. The first time
you set LWORK to -1 and just ensure that WORK has space for at least one
REAL value. On successful exit the first element of WORK should contain
the optimal workspace size. So you allocate that space to WORK and
call the function again, setting LWORK to the size of WORK. This time
you should get the actual eigen-analysis (if INFO, the error indicator,
is zero).