Tuesday, 20 August 2013

Generalized diagonalization with Lapack

Generalized diagonalization with Lapack

I am having some problems using the subroutine DSYGV of Lapack:
DSYGV( ITYPE, JOBZ, UPLO, N, A, LDA, B, LDB, W, WORK,LWORK, INFO )
This is the diagonalization I want to carry out:
v_mat*x = eig*t_mat*x
This is the crucial piece of my code:
v_mat(1,1:2) = (/6.0,-3.0/)
v_mat(2,1:2) = (/-3.0,3.0/)
!--------------------------
!--------------------------
t_mat(1,1:2) = (/4.0,0.0/)
t_mat(2,1:2) = (/0.0,4.0/)
call DSYGV( 1, 'v', 'u', 2 , v_mat, 2 , t_mat, 2, eig, WORK, 10, INF )
I think I understood everything given in this document:
http://www.netlib.org/lapack/lapack-3.1.1/html/dsygv.f.html
But the argument LWORK which I did not understand so I just try different
values.
I know something is wrong because I know what are the eigenvalues and
eigenvectors of this matrix, and I am doing such a simple calculation in
order to understand the way it works and then compute huge
diagonalizations.
Thankyou

No comments:

Post a Comment