Transpose 发表于 2022-6-23 21:38
精度不够,使用双精度 dgetrf,dgetri
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
zjk0112 发表于 2022-6-24 17:13
就是精度的问题,你用real(kind=8)表示的就是双精度实型,你下面函数却用sgetrf,sgetri。这两个函数是对单 ...
欢迎光临 Fortran Coder (http://bbs.fcode.cn/) | Powered by Discuz! X3.2 |