c************************************************************************ c Compute the inverse of an m by m matrix a and put it c in ainv, and compute the determinant and put it in bigdet c************************************************************************ subroutine xinverse(a,ainv,m,bigdet) implicit real*8(a-h,o-z) real*8 a(m,m),ainv(m,m),det(2) lda = m k = m do 10 i = 1,k do 9 j = 1,k 9 ainv(i,j) = a(i,j) 10 continue call dpofa(ainv,lda,k,info) call dpodi(ainv,lda,k,det,11) do 20 j=1,k do 19 i=j+1,k 19 ainv(i,j)=ainv(j,i) 20 continue bigdet = det(1) * 10**det(2) return end c************************************************************************ c Compute the inverse of an m by m matrix a and put it c in ainv, and compute the determinant and put it in bigdet c************************************************************************ subroutine zinverse(a,ainv,m,bigdet,iezcode) implicit real*8(a-h,o-z) real*8 a(m,m),ainv(m,m),det(2) lda = m k = m do 10 i = 1,k do 9 j = 1,k 9 ainv(i,j) = a(i,j) 10 continue call dpofa(ainv,lda,k,info) c First make sure the damn thing is invertible! call dpodi(ainv,lda,k,det,10) cmin = 1.0d-50 bigdet = det(1) * 10**det(2) bigdet = bigdet ** (1.0d0 / 6.0d0) if (bigdet.ge.cmin) goto 15 bigdet = 0. iezcode = 1 do 12 j=1,m do 11 k=1,m ainv(j,k) = 0. 11 continue 12 ainv(j,j) = 1. return 15 continue call dpodi(ainv,lda,k,det,11) do 20 j=1,k do 19 i=j+1,k 19 ainv(i,j)=ainv(j,i) 20 continue bigdet = det(1) * 10**det(2) return end