Incorrect/inconsistent results from zgeev() LAPACK

巧了我就是萌 提交于 2019-11-29 17:25:49

In the program you have rwork as a scalar, it should be an array of size 2*N according to the documentation at

http://www.netlib.org/lapack/explore-html/db/d55/group__complex16_g_eeigen_ga0eb4e3d75621a1ce1685064db1ac58f0.html#ga0eb4e3d75621a1ce1685064db1ac58f0

Correcting this fixes the problem

According to the documentation of zgeev (on http://www.netlib.org/lapack/explore-html/db/d55/group__complex16_g_eeigen_ga0eb4e3d75621a1ce1685064db1ac58f0.html#ga0eb4e3d75621a1ce1685064db1ac58f0):

subroutine zgeev    (   character   JOBVL,
        character   JOBVR,
        integer     N,
        complex*16, dimension( lda, * )     A,
        integer     LDA,
        complex*16, dimension( * )      W,
        complex*16, dimension( ldvl, * )    VL,
        integer     LDVL,
        complex*16, dimension( ldvr, * )    VR,
        integer     LDVR,
        complex*16, dimension( * )      WORK,
        integer     LWORK,
        double precision, dimension( * )    RWORK,
        integer     INFO 
    )

The arrays you provide are of type complex(kind = 8) and not of type complex*16 and for RWord provided type real(kind = 8) instead of double precision. (Depending on the compiler the kind=8 can have a different meaning)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!