3

如何在 Code::Blocks 的 gfortran 中使用 IMSL 库?在构建它们之后,我的程序出现了问题。构建后的消息是:未定义的对 `linrg_' 的引用

我的代码是:

Program Fitovanje_krive


Implicit none

integer::i,j,k,n
Integer,parameter::iBrTac=24
Integer,allocatable::vreme(:),potrosnja(:)
Real,allocatable::X(:,:),Y(:,:),P(:,:),Xinv(:,:)


allocate(vreme(iBrTac),potrosnja(iBrTac))


vreme(1:iBrTac)=(/1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24/)
potrosnja(1:iBrTac)=(/20,30,20,30,40,50,50,60,70,80,90,100,80,60,50,30,20,40,40,30,30,20,40,40/)

n=10

allocate(X(n+1,n+1),Y(n+1,1),P(n+1,1),Xinv(n+1,n+1))

do i=1,n+1
    do j=1,n+1
        X(i,j)=0.
        Y(i,j)=0.
        do k=1,iBrTac

        X(i,j)=X(i,j)+vreme(k)**(i+j-2)
        Y(i,1)=Y(i,1)+potrosnja(k)*vreme(k)**(i-1)

        end do

    end do
end do

Call Linrg(n+1,X,n+1,Xinv,n+1)

P=matmul(Xinv,Y)

Stop
End program Fitovanje_krive
4

0 回答 0