[Fortran] 纯文本查看 复制代码 program least_square
implicit none
include 'link_fnl_shared'
use use_libraries
integer, parameter :: m = 6
integer, parameter :: n = 2
integer :: i
double precision :: A(m,n), B(m), X(n)
double precision :: C(n, m), D(n,n), E(n)
data A / 1, 2, 3, 4, 5, 6, 1, 1, 1, 1, 1, 1 /
data B / 6.9, 9.1, 10.8, 13.2, 14.9, 17.3 /
if( m > n ) then
C = transpose(a)
D = matmul( c, a )
E = matmul( c, b )
X = D .ix. E ! invert(D) * E
else if( m == n ) then
X = A .ix. B
else
write(*,*) "No roots!"
end if
do i = 1, n
write(*,*) X(i)
end do
stop
end program least_square
新手求助 一开始显示是IMSL问题,安装后就出现下面的问题了1 Severe: No such file or directory
2 Compiliation Aborted (code 1)
|