problem with subroutine dgetrs in lapack-3.0
The test script is below:
and it compiles well with:
f77 test.f -o test -llapack
and it actually generate the execute file "test", but when I execute this file, there is segment fault. I doubt that whether the algorithm in this subroutine has its own flaw. Anyone can explain this kind of phenomenon? Many thanks.
- Code: Select all
integer N, NRHS, LDA, LDB, INFO
parameter(N=4, NRHS=1, LDA=4, LDB=4)
double precision A(4,4), B(4,1)
integer IPIV(4)
A(1,1) = 1.; A(1,2) = 10.; A(1,3)= 1.; A(1,4) = 1.
A(2,1) = 2.; A(2,2) = -1.; A(2,3)= 50.; A(2,4) = -11.
A(3,1) = 4.; A(3,2) = 8.; A(3,3)= -7.; A(3,4) = -19.
A(4,1) = 4.; A(4,2) = 8.; A(4,3)= -7.; A(4,4) = 23
B(1,1) = 13.; B(2,1) = 40.; B(3,1) = -14.; B(4,1) = 28.
call dgetrs('N', N, NRHS, A, LDA, IPIV, B, LDB, INFO)
write(*,*)B
end
and it compiles well with:
f77 test.f -o test -llapack
and it actually generate the execute file "test", but when I execute this file, there is segment fault. I doubt that whether the algorithm in this subroutine has its own flaw. Anyone can explain this kind of phenomenon? Many thanks.