[Fortran] 纯文本查看 复制代码 ! MKL库函数求解线性方程组
include 'lapack.f90'
program test
use lapack95
integer,parameter::n=3
integer i
real(4)::a(n,n),b(n)
integer ipiv(n)
a=reshape([1,0,1,2,1,0,3,3,0],[n,n])
b(:)=[14,11,1]
call sgetrf(n,n,a,n,ipiv,i) !LU分解
call sgetrs( 'N', n, n, a, n, ipiv, b,n, i )
print*,b !1,2,3
pause
end program |