Hello,
I have installed lapack.3.1.1 with g77 compiler which I wanted to use for calculating eigenvectors and eigenvalues of general complex matrix. I test the zgeev with the following simple code:
program test
COMPLEX W(4),WORK(2*4)
REAL RWORK(2*4)
COMPLEX VR(4,4),VL(1,1)
COMPLEX D(4,4)
N1=4;
C
D(1,1)=(1.0,0.0)
D(1,2)=(0.0,0.0)
D(1,3)=(0.0,0.0)
D(1,4)=(0.0,0.0)
D(2,1)=(0.0,0.0)
D(2,2)=(1.0,0.0)
D(2,3)=(0.0,0.0)
D(2,4)=(0.0,0.0)
D(3,1)=(0.0,0.0)
D(3,2)=(0.0,0.0)
D(3,3)=(1.0,0.0)
D(3,4)=(0.0,0.0)
D(4,1)=(0.0,0.0)
D(4,2)=(0.0,0.0)
D(4,3)=(0.0,0.0)
D(4,4)=(1.0,0.0)
C
C
CALL ZGEEV('N','V',N1,D,N1,W,VL,1,VR,N1,WORK,N1*2,RWORK,INFO)
C
DO 1 ii=1,N1,1
DO 2 jj=1,N1,1
WRITE(*,*)'VR(',ii,',',jj,')'
WRITE(*,*)VR(ii,jj)
2 CONTINUE
1 CONTINUE
C
C
DO 3 jj=1,N1,1
WRITE(*,*)'W(',jj,')'
WRITE(*,*)W(jj)
3 CONTINUE
END PROGRAM test
Compiling with
g77 test.f -L. -llapack -lblas
the eigenvectors and eigenvalues I got, were:
VR( 1, 1)
(0.,NAN)
VR( 1, 2)
(0.,NAN)
VR( 1, 3)
(0.,0.)
VR( 1, 4)
(0.,0.)
VR( 2, 1)
(0.,NAN)
VR( 2, 2)
(0.,NAN)
VR( 2, 3)
(0.,0.)
VR( 2, 4)
(0.,0.)
VR( 3, 1)
(0.,NAN)
VR( 3, 2)
(0.,NAN)
VR( 3, 3)
(-6.22660855E-16,-0.0352373123)
VR( 3, 4)
(0.,1.875)
VR( 4, 1)
(0.,NAN)
VR( 4, 2)
(0.,0.)
VR( 4, 3)
(-3.77885392E+21,-0.000673946226)
VR( 4, 4)
(0.,0.)
W( 1)
(0.,0.)
W( 2)
(0.,0.)
W( 3)
(0.,0.)
W( 4)
(0.,0.)
I have no idea why the results are so incredibly wrong! 8|
Can anyone help me?
R.

