KronLinInv  0.3
Kronecker-product-based linear inversion

◆ symgeneigvv()

subroutine, private kronlininv::symgeneigvv ( real(dp), dimension(:,:), intent(in)  A,
character, intent(in)  uplo,
real(dp), dimension(:,:), intent(in)  Bpd,
real(dp), dimension(:), intent(out)  lambda,
real(dp), dimension(:,:), intent(out)  U 
)
private

Computes eigenvalues and eigenvectors of the generalized symmetric definite eigenproblem. See http://www.netlib.org/lapack/lug/node54.html

No test to check symmetry or positive definiteness is performed.

Parameters
[in]Asymmetric matrix
[in]uploupper or lower triangle stored
[in]Bpdsymmetric positive-definite matrix
[out]lambdaeigenvalues
[out]Ueigenvectors
Date
10/8/2016 - Initial Version

Definition at line 811 of file kronlininv.f08.

811  real(dp),intent(in) :: a(:,:),bpd(:,:)
812  character,intent(in) :: uplo
813  real(dp),intent(out) :: lambda(:),u(:,:)
814  integer :: n,lwork,itype,info
815  character :: jobz
816  real(dp),allocatable :: work(:),tmpb(:,:)
817  ! DSYGV computes all the eigenvalues, and optionally, the eigenvectors
818  ! of a real generalized symmetric-definite eigenproblem, of the form
819  ! A*x=(lambda)*B*x, A*Bx=(lambda)*x, or B*A*x=(lambda)*x.
820  ! Here A and B are assumed to be symmetric and B is also
821  ! positive definite.
822  itype = 3
823  jobz = 'V'
824  n=size(a,1)
825  if ( (size(a,2)/=n) .or. (size(bpd,1)/=n) .or. (size(bpd,2)/=n) ) then
826  write(*,*) "symgeneigvv(): Matrices have wrong sizes"
827  stop
828  end if
829  allocate(tmpb(n,n))
830  u = a
831  tmpb = bpd
832  lwork=3*n-1
833  ! lwork=-1
834  ! allocate(work(1))
835  ! call DSYGV(itype,jobz,uplo,nm1,U1,nm1,choCm1,nm1,lambda1,work,lwork,info)
836  ! deallocate(work)
837  allocate(work(lwork))
838  call dsygv(itype,jobz,uplo,n,u,n,tmpb,n,lambda,work,lwork,info)
839  if (info /= 0) stop 'symgeneigvv(): Matrix eigendecomposition failed!'
Here is the caller graph for this function: