The LAPACK forum has moved to https://github.com/Reference-LAPACK/lapack/discussions.

lapack routine help

Open discussion regarding features, bugs, issues, vendors, etc.

lapack routine help

Postby ravindrapankaj » Fri Jul 09, 2010 5:38 am

I want to use a routine from lapack


SSYEV( JOBZ, UPLO, N, A, LDA, W, WORK, LWORK, INFO )

CHARACTER JOBZ, UPLO

INTEGER INFO, LDA, LWORK, N


REAL A( LDA, * ), W( * ), WORK( * )

here I do not understand LDA, WORK and LWORK. how to know what will be

LWORK and LDA for a given real symmetric matrix of order N.
ravindrapankaj
 
Posts: 6
Joined: Tue Jun 08, 2010 4:22 am

Re: lapack routine help

Postby cottrell » Fri Jul 09, 2010 5:23 pm

The meanings of the various parameters are explained here:
http://www.netlib.org/lapack/single/ssyev.f

And similarly for all the lapack functions.

Allin Cottrell
cottrell
 
Posts: 73
Joined: Thu Jan 15, 2009 1:40 pm

Re: lapack routine help

Postby ravindrapankaj » Sat Jul 10, 2010 2:35 am

cottrell wrote:The meanings of the various parameters are explained here:
http://www.netlib.org/lapack/single/ssyev.f

And similarly for all the lapack functions.

Allin Cottrell


But i am not able to follow. I need help
ravindrapankaj
 
Posts: 6
Joined: Tue Jun 08, 2010 4:22 am

Re: lapack routine help

Postby ravindrapankaj » Sun Jul 11, 2010 2:33 am

none is there to help me i guess.
ravindrapankaj
 
Posts: 6
Joined: Tue Jun 08, 2010 4:22 am

Re: lapack routine help

Postby 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).
cottrell
 
Posts: 73
Joined: Thu Jan 15, 2009 1:40 pm


Return to User Discussion

Who is online

Users browsing this forum: No registered users and 7 guests