det.F90
Go to the documentation of this file.00001 subroutine calcdet(N,mat,det)
00002 implicit none
00003 complex(8)::det
00004 integer,intent(in)::N
00005 complex(8),intent(inout)::mat(N,N)
00006 integer::ipiv(N)
00007 integer::i,info
00008
00009 ipiv=0
00010 info=0
00011 call zgetrf(N,N,mat,N,ipiv,info)
00012 if(info/=0) then
00013 write(6,*) 'info=',info
00014 endif
00015 det=1.0d0
00016 do i=1,N
00017 if(ipiv(i)==i) then
00018 det=det*mat(i,i)
00019 else
00020 det=-det*mat(i,i)
00021 endif
00022 enddo
00023 return
00024 end