刚刚把imsl装好,路径也设置好了,但是我为了验证一下是否能用,就把它给的代码粘贴复制下来,看能不能编译,结果出现了错误:代码如下:
[Fortran] 纯文本查看 复制代码 program testimsluse linear_operators
implicit none
! This is the equivalent of Example 2 for LIN_SOL_SELF using operators
! and functions.
integer, parameter :: m=64, n=32
real(kind(1e0)) :: one=1e0, zero=0e0, err
real(kind(1e0)) A(n,n), b(n), C(m,n), d(m), cov(n,n), x(n)
! Generate a random rectangular matrix and right-hand side.
C = rand(C); d=rand(d)
! Form the normal equations for the rectangular system.
A = C .tx. C; b = C .tx. d
COV = .i. CHOL(A); COV = COV .xt. COV
! Compute the least-squares solution.
x = C .ix. d
! Compare with solution obtained using the inverse matrix.
err = norm(x - (COV .x. b))/norm(cov)
! Scale the inverse to obtain the sample covariance matrix.
COV = sum((d - (C .x. x))**2)/(m-n) * COV
! Check the results.
if (err <= sqrt(epsilon(one))) then
write (*,*) 'Example 2 for LIN_SOL_SELF (operators) is correct.'
end if
end
错误如下:
错误 1 Compilation Aborted (code 1) G:\fortran\kuang\kuang\kuang\kuang.f90 1
请问大家这到底是怎么回事?
|