LAPACK Archives

[Lapack] Problem with ZGGEV

Hi,

I have a problem with the computation of the generalized eigenvalues
of a couple of complex matrices.
These matrices are close to the
identity matrix, with an epsilon perturbation. The imaginary
parts for these matrices are zero.
I expect that the eigenvalues are close to 1.
With complex matrices, the ZGGEV routine fails, that is,
returns with info = 2.
If I use double precision matrices instead, the DGGEV routine
is sucessful, with the expected results.
At the end of this email, I copied the fortran program to reproduce
the bug.
I use the lapack.tgz file from http://www.netlib.org/lapack/, version 3.1.1.
with Visual Studio 9.1 and Intel Fortran 10.1.

Did i do something wrong ?

Best regards,

Micha?l Baudin

PS
I am working in the Scilab team and this problem is related to bug #3652
http://bugzilla.scilab.org/show_bug.cgi?id=3652

program bug3652
  implicit none
  call simulate_ZGGEV ()
  call simulate_DGGEV ()
contains
  !
  ! Reproduce behaviour for call to ZGGEV
  !
  subroutine simulate_ZGGEV ()
    implicit none
    CHARACTER, PARAMETER :: JOBVL="N", JOBVR="N"
    INTEGER, PARAMETER :: LDA=3, LDB=3, LDVL=3, LDVR=3, N=3, LWORK=2*N
    INTEGER :: INFO
    DOUBLE PRECISION, DIMENSION(8*N) ::   RWORK
    COMPLEX*16, DIMENSION(LDA,N) :: A
    COMPLEX*16, DIMENSION(N) ::  ALPHA
    COMPLEX*16, DIMENSION(LDB,N) ::  B
    COMPLEX*16, DIMENSION(N) ::  BETA
    COMPLEX*16, DIMENSION(LDVL,N) ::  VL
    COMPLEX*16, DIMENSION(LDVR,N) ::  VR
    COMPLEX*16, DIMENSION(LWORK) ::  WORK
    integer id
    A(1,1) = cmplx(1, 0)
    A(2,1) = cmplx(0, 0)
    A(3,1) = cmplx(0, 0)
    A(1,2) = cmplx(0, 0)
    A(2,2) = cmplx(1, 0)
    A(3,2) = cmplx(0, 0)
    A(1,3) = cmplx(0, 0)
    A(2,3) = cmplx(0, 0)
    A(3,3) = cmplx(1, 0)
    B(1,1) = cmplx(1, 0)
    B(2,1) = cmplx(1.d-14, 0)
    B(3,1) = cmplx(0, 0)
    B(1,2) = cmplx(1.d-14, 0)
    B(2,2) = cmplx(1, 0)
    B(3,2) = cmplx(0, 0)
    B(1,3) = cmplx(0, 0)
    B(2,3) = cmplx(0, 0)
    B(3,3) = cmplx(1, 0)
    call ZGGEV( JOBVL, JOBVR, N, A, LDA, B, LDB, ALPHA, BETA, &
         VL, LDVL, VR, LDVR, WORK, LWORK, RWORK, INFO )
  end subroutine simulate_ZGGEV
  !
  ! Reproduce behaviour for call to DGGEV
  !
  subroutine simulate_DGGEV ()
    implicit none
    CHARACTER, PARAMETER :: JOBVL="N", JOBVR="N"
    INTEGER, PARAMETER :: LDA=3, LDB=3, LDVL=3, LDVR=3, N=3, LWORK=8*N
    INTEGER :: INFO
    DOUBLE PRECISION, DIMENSION(LDA,N) :: A
    DOUBLE PRECISION, DIMENSION(N) ::  ALPHAR
    DOUBLE PRECISION, DIMENSION(N) ::  ALPHAI
    DOUBLE PRECISION, DIMENSION(LDB,N) ::  B
    DOUBLE PRECISION, DIMENSION(N) ::  BETA
    DOUBLE PRECISION, DIMENSION(LDVL,N) ::  VL
    DOUBLE PRECISION, DIMENSION(LDVR,N) ::  VR
    DOUBLE PRECISION, DIMENSION(LWORK) ::  WORK
    integer id
    A(1,1) = 1
    A(2,1) = 0
    A(3,1) = 0
    A(1,2) = 0
    A(2,2) = 1
    A(3,2) = 0
    A(1,3) = 0
    A(2,3) = 0
    A(3,3) = 1
    B(1,1) = 1
    B(2,1) = 1.d-14
    B(3,1) = 0
    B(1,2) = 1.d-14
    B(2,2) = 1
    B(3,2) = 0
    B(1,3) = 0
    B(2,3) = 0
    B(3,3) = 1
    call DGGEV( JOBVL, JOBVR, N, A, LDA, B, LDB, ALPHAR, ALPHAI, &
         BETA, VL, LDVL, VR, LDVR, WORK, LWORK, INFO )
  end subroutine simulate_DGGEV
endprogram bug3652


<Prev in Thread] Current Thread [Next in Thread>
  • [Lapack] Problem with ZGGEV, Michaël Baudin <=


For additional information you may use the LAPACK/ScaLAPACK Forum.
Or one of the mailing lists, or