本帖最后由 胡文刚 于 2022-6-24 08:23 编辑
我用以下代码测试的结果是正确的。
0.999999997206032 -1.490116119384766E-008 9.313225746154785E-010
0.000000000000000E+000 0.999999992549419 0.000000000000000E+000
1.490116119384766E-008 1.192092895507812E-007 0.999999992549419
[Fortran] 纯文本查看 复制代码 Program Main
use lapack95
implicit none
integer , parameter :: N = 3
real(kind=8) :: a(N,N),b(N),t(N,N)
integer :: ipiv(N) = 0,info1,info2
a=reshape([1.46989040000000d-09, 8.08439760000000d-10,-9.40729890000000d-09,&
8.08439760000000d-10, 4.44641850000000d-10,-5.17401410000000d-09,&
-9.40729890000000d-09,-5.17401410000000d-09, 6.02067090000000d-08],[N,N])
t=a
call dgetrf(n,n,a,n,ipiv,info1)
call dgetri(n,a,n,ipiv,b,n,info2)
write(*,*) matmul(a,t)
End Program Main
|