用雅可比法编了一个求特征向量的程序。显示外部符号wu'fa...
如题错误 error LNK2019: 无法解析的外部符号 SUBROUTINEMAXMATRIX,函数 MAIN__ 中引用了该符号 Source1.obj
错误 error LNK2019: 无法解析的外部符号 SUBROUTINEE_K,函数 MAIN__ 中引用了该符号 Source1.obj
有大佬帮我看看吗
program main
implicit none
double precision matrix(3,3),T(3,3),c,s,kexi,toll,eak
integer i,j,m,n
parameter (toll=0.000001)
Matrix(1,1)=1
matrix(1,2)=2
matrix(2,1)=2
matrix(1,3)=3
matrix(3,1)=3
matrix(2,2)=4
matrix(2,3)=5
matrix(3,2)=5
matrix(3,3)=6
Do i=1,3
Do j=1,3
T(i,j)=matrix(i,j)
end do
end do
C
Do i=1,100
call subroutine E_k(eak,T)
if (eak.gt.toll) then
call subroutine maxmatrix(m,n)
kexi=0.5*atan(2*T(m,n)/T(m,m)-T(n,n))
c=cos(kexi)
s=sin(kexi)
T(m,m)=c
T(n,n)=c
T(m,n)=s
T(m,n)=-s
end if
end do
write(*,*) T
pause
end program main
C
C
subroutine E_k(eak)
implicit none
double precision a1,a2,a3,eak,T(3,3)
a1=T(2,1)**2
a2=T(3,1)**2
a3=T(3,2)**2
eak=a1+a2+a3
end subroutine
C
subroutine maxmatrix(m,n,T)
implicit none
double precision a,b,c,maxT,T(3,3)
integer m,n
a=T(2,1)
b=T(3,1)
c=T(3,2)
if (a.ge.b) then
if (a.ge.c)then
maxT=a
m=2
n=1
else
maxT=c
m=3
n=2
end if
else
if (b.ge.c)then
maxT=b
m=3
n=1
else
maxT=c
m=3
n=2
end if
end if
end subroutine call subroutine E_k(eak,T)
改为
call E_k(eak,T)
页:
[1]