主题:[讨论]关于evchf求复厄米矩阵的特征值和特征向量
evchf可以用来求复数厄米矩阵的特征值和特征向量,书中也给出了一个例题说明。我在用这个例题的时候出现一个情况,说error LNK2001: unresolved external symbol _EVCHF@24,我用的是带imsl数据库的fortran6.6,难道是我库里没有这些函数?
! declare variables
integer lda,ldevec,n
parameter(n=3,lda=n,ldevec=n)
integer nout
real epihf,eval(n),pi
complex a(lda,n),evec(ldevec,n)
! external evchf
external epihf,evchf,umach,wrcrn,wrrrn
! set values of a
data a/(1.0,0.0),(1.0,7.0),(0.0,1.0),(1.0,-7.0),(5.0,0.0),(10.0,3.0),(0.0,-1.0),(10.0,-3.0),(-2.0,0.0)/
! find 特征值和特征向量
call evchf(n,a,lda,eval,evec,ldevec)
!compute performance index
pi=epihf(n,n,a,lda,eval,evec,ldevec)
write(*,*) eval,evec
!print result
call umach(2,nout)
call wrrrn('eval',1,n,eval,1,0)
call wrcrn('evec',n,n,evec,ldevec,0)
write(nout,'(/,a,f6.3)') 'performance index=', pi
end[em1][em21][em21][em21][em21][em21][em21][em21][em21][em21][em22][em22][em22][em22][em22][em22][em22][em18][em18][em18][em18][em18]
我查了一下EVCHF的说明,不知是否有用。
Computes all of the eigenvalues and eigenvectors of a complex Hermitian matrix.
Required Arguments
A — Complex Hermitian matrix of order N. (Input)
Only the upper triangle is used.
EVAL — Real vector of length N containing the eigenvalues of A in decreasing order of magnitude. (Output)
EVEC — Complex matrix of order N. (Output)
The J-th eigenvector, corresponding to EVAL(J), is stored in the J-th column. Each vector is normalized to have Euclidean length equal to the value one.
Optional Arguments
N — Order of the matrix A. (Input)
Default: N = size (A,2).
LDA — Leading dimension of A exactly as specified in the dimension statement in the calling program. (Input)
Default: LDA = size (A,1).
LDEVEC — Leading dimension of EVEC exactly as specified in the dimension statement in the calling program. (Input)
Default: LDEVEC = size (EVEC,1).
FORTRAN 90 Interface
Generic: CALL EVCHF (A, EVAL, EVEC [,…])
Specific: The specific interface names are S_EVCHF and D_EVCHF.
FORTRAN 77 Interface
Single: CALL EVCHF (N, A, LDA, EVAL, EVEC, LDEVEC)
Double: The double precision name is DEVCHF.
! declare variables
integer lda,ldevec,n
parameter(n=3,lda=n,ldevec=n)
integer nout
real epihf,eval(n),pi
complex a(lda,n),evec(ldevec,n)
! external evchf
external epihf,evchf,umach,wrcrn,wrrrn
! set values of a
data a/(1.0,0.0),(1.0,7.0),(0.0,1.0),(1.0,-7.0),(5.0,0.0),(10.0,3.0),(0.0,-1.0),(10.0,-3.0),(-2.0,0.0)/
! find 特征值和特征向量
call evchf(n,a,lda,eval,evec,ldevec)
!compute performance index
pi=epihf(n,n,a,lda,eval,evec,ldevec)
write(*,*) eval,evec
!print result
call umach(2,nout)
call wrrrn('eval',1,n,eval,1,0)
call wrcrn('evec',n,n,evec,ldevec,0)
write(nout,'(/,a,f6.3)') 'performance index=', pi
end[em1][em21][em21][em21][em21][em21][em21][em21][em21][em21][em22][em22][em22][em22][em22][em22][em22][em18][em18][em18][em18][em18]
我查了一下EVCHF的说明,不知是否有用。
Computes all of the eigenvalues and eigenvectors of a complex Hermitian matrix.
Required Arguments
A — Complex Hermitian matrix of order N. (Input)
Only the upper triangle is used.
EVAL — Real vector of length N containing the eigenvalues of A in decreasing order of magnitude. (Output)
EVEC — Complex matrix of order N. (Output)
The J-th eigenvector, corresponding to EVAL(J), is stored in the J-th column. Each vector is normalized to have Euclidean length equal to the value one.
Optional Arguments
N — Order of the matrix A. (Input)
Default: N = size (A,2).
LDA — Leading dimension of A exactly as specified in the dimension statement in the calling program. (Input)
Default: LDA = size (A,1).
LDEVEC — Leading dimension of EVEC exactly as specified in the dimension statement in the calling program. (Input)
Default: LDEVEC = size (EVEC,1).
FORTRAN 90 Interface
Generic: CALL EVCHF (A, EVAL, EVEC [,…])
Specific: The specific interface names are S_EVCHF and D_EVCHF.
FORTRAN 77 Interface
Single: CALL EVCHF (N, A, LDA, EVAL, EVEC, LDEVEC)
Double: The double precision name is DEVCHF.