matrix diagonalization [algorithm] by 바죠

행렬 대각화 (matrix diagonalization) 예제입니다. LAPACK, BLAS 를 활용한 방식이다. 가장 일반적인 방식으로 받아드려진다.
http://incredible.egloos.com/7193290


http://www.netlib.org/lapack/complex16


LIBS =  -llapack -lblas

      subroutine eigen
       USE mm_mod, ONLY : eval,cevec,prob,npoints
       implicit none
       real*8, allocatable :: rwork(:)
       complex*16, allocatable :: cwork(:),chp(:)
       integer info, ms,i,j

       ms=npoints
       allocate(chp((ms*(ms+1))/2),cwork(2*ms-1))
       allocate(rwork(3*ms-2))


         ms=npoints
         chp=cmplx(0.d0,0.d0)
         do j=1,ms
         do i=1,j
         chp(i+(j-1)*j/2)=cmplx(prob(i,j),0.d0)
         enddo
         enddo
         info=0
         call ZHPEV('V','U',ms,chp,eval,cevec,ms,cwork,rwork,info)
         if(info .ne. 0) write(6,*) 'information from ZHPEV',info

 

       deallocate(chp,cwork)
       deallocate(rwork)
       return
       end


http://www.netlib.org/lapack/complex16/zgeev.f
http://www.netlib.org/lapack/testing/eig/zdrvev.f

http://incredible.egloos.com/7193290
cf.
http://incredible.egloos.com/4730700


핑백

덧글

댓글 입력 영역

최근 포토로그



MathJax