zhegvd.f.html

来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 332 行 · 第 1/2 页

HTML
332
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 <head>
  <title>zhegvd.f</title>
 <meta name="generator" content="emacs 21.3.1; htmlfontify 0.20">
<style type="text/css"><!-- 
body { background: rgb(255, 255, 255);  color: rgb(0, 0, 0);  font-style: normal;  font-weight: 500;  font-stretch: normal;  font-family: adobe-courier;  font-size: 11pt;  text-decoration: none; }
span.default   { background: rgb(255, 255, 255);  color: rgb(0, 0, 0);  font-style: normal;  font-weight: 500;  font-stretch: normal;  font-family: adobe-courier;  font-size: 11pt;  text-decoration: none; }
span.default a { background: rgb(255, 255, 255);  color: rgb(0, 0, 0);  font-style: normal;  font-weight: 500;  font-stretch: normal;  font-family: adobe-courier;  font-size: 11pt;  text-decoration: underline; }
span.string   { color: rgb(188, 143, 143);  background: rgb(255, 255, 255);  font-style: normal;  font-weight: 500;  font-stretch: normal;  font-family: adobe-courier;  font-size: 11pt;  text-decoration: none; }
span.string a { color: rgb(188, 143, 143);  background: rgb(255, 255, 255);  font-style: normal;  font-weight: 500;  font-stretch: normal;  font-family: adobe-courier;  font-size: 11pt;  text-decoration: underline; }
span.comment   { color: rgb(178, 34, 34);  background: rgb(255, 255, 255);  font-style: normal;  font-weight: 500;  font-stretch: normal;  font-family: adobe-courier;  font-size: 11pt;  text-decoration: none; }
span.comment a { color: rgb(178, 34, 34);  background: rgb(255, 255, 255);  font-style: normal;  font-weight: 500;  font-stretch: normal;  font-family: adobe-courier;  font-size: 11pt;  text-decoration: underline; }
 --></style>

 </head>
  <body>

<pre>
      SUBROUTINE <a name="ZHEGVD.1"></a><a href="zhegvd.f.html#ZHEGVD.1">ZHEGVD</a>( ITYPE, JOBZ, UPLO, N, A, LDA, B, LDB, W, WORK,
     $                   LWORK, RWORK, LRWORK, IWORK, LIWORK, INFO )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  -- LAPACK driver routine (version 3.1) --
</span><span class="comment">*</span><span class="comment">     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
</span><span class="comment">*</span><span class="comment">     November 2006
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     .. Scalar Arguments ..
</span>      CHARACTER          JOBZ, UPLO
      INTEGER            INFO, ITYPE, LDA, LDB, LIWORK, LRWORK, LWORK, N
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Array Arguments ..
</span>      INTEGER            IWORK( * )
      DOUBLE PRECISION   RWORK( * ), W( * )
      COMPLEX*16         A( LDA, * ), B( LDB, * ), WORK( * )
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  Purpose
</span><span class="comment">*</span><span class="comment">  =======
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  <a name="ZHEGVD.21"></a><a href="zhegvd.f.html#ZHEGVD.1">ZHEGVD</a> computes all the eigenvalues, and optionally, the eigenvectors
</span><span class="comment">*</span><span class="comment">  of a complex generalized Hermitian-definite eigenproblem, of the form
</span><span class="comment">*</span><span class="comment">  A*x=(lambda)*B*x,  A*Bx=(lambda)*x,  or B*A*x=(lambda)*x.  Here A and
</span><span class="comment">*</span><span class="comment">  B are assumed to be Hermitian and B is also positive definite.
</span><span class="comment">*</span><span class="comment">  If eigenvectors are desired, it uses a divide and conquer algorithm.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  The divide and conquer algorithm makes very mild assumptions about
</span><span class="comment">*</span><span class="comment">  floating point arithmetic. It will work on machines with a guard
</span><span class="comment">*</span><span class="comment">  digit in add/subtract, or on those binary machines without guard
</span><span class="comment">*</span><span class="comment">  digits which subtract like the Cray X-MP, Cray Y-MP, Cray C-90, or
</span><span class="comment">*</span><span class="comment">  Cray-2. It could conceivably fail on hexadecimal or decimal machines
</span><span class="comment">*</span><span class="comment">  without guard digits, but we know of none.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  Arguments
</span><span class="comment">*</span><span class="comment">  =========
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  ITYPE   (input) INTEGER
</span><span class="comment">*</span><span class="comment">          Specifies the problem type to be solved:
</span><span class="comment">*</span><span class="comment">          = 1:  A*x = (lambda)*B*x
</span><span class="comment">*</span><span class="comment">          = 2:  A*B*x = (lambda)*x
</span><span class="comment">*</span><span class="comment">          = 3:  B*A*x = (lambda)*x
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  JOBZ    (input) CHARACTER*1
</span><span class="comment">*</span><span class="comment">          = 'N':  Compute eigenvalues only;
</span><span class="comment">*</span><span class="comment">          = 'V':  Compute eigenvalues and eigenvectors.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  UPLO    (input) CHARACTER*1
</span><span class="comment">*</span><span class="comment">          = 'U':  Upper triangles of A and B are stored;
</span><span class="comment">*</span><span class="comment">          = 'L':  Lower triangles of A and B are stored.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  N       (input) INTEGER
</span><span class="comment">*</span><span class="comment">          The order of the matrices A and B.  N &gt;= 0.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  A       (input/output) COMPLEX*16 array, dimension (LDA, N)
</span><span class="comment">*</span><span class="comment">          On entry, the Hermitian matrix A.  If UPLO = 'U', the
</span><span class="comment">*</span><span class="comment">          leading N-by-N upper triangular part of A contains the
</span><span class="comment">*</span><span class="comment">          upper triangular part of the matrix A.  If UPLO = 'L',
</span><span class="comment">*</span><span class="comment">          the leading N-by-N lower triangular part of A contains
</span><span class="comment">*</span><span class="comment">          the lower triangular part of the matrix A.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">          On exit, if JOBZ = 'V', then if INFO = 0, A contains the
</span><span class="comment">*</span><span class="comment">          matrix Z of eigenvectors.  The eigenvectors are normalized
</span><span class="comment">*</span><span class="comment">          as follows:
</span><span class="comment">*</span><span class="comment">          if ITYPE = 1 or 2, Z**H*B*Z = I;
</span><span class="comment">*</span><span class="comment">          if ITYPE = 3, Z**H*inv(B)*Z = I.
</span><span class="comment">*</span><span class="comment">          If JOBZ = 'N', then on exit the upper triangle (if UPLO='U')
</span><span class="comment">*</span><span class="comment">          or the lower triangle (if UPLO='L') of A, including the
</span><span class="comment">*</span><span class="comment">          diagonal, is destroyed.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  LDA     (input) INTEGER
</span><span class="comment">*</span><span class="comment">          The leading dimension of the array A.  LDA &gt;= max(1,N).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  B       (input/output) COMPLEX*16 array, dimension (LDB, N)
</span><span class="comment">*</span><span class="comment">          On entry, the Hermitian matrix B.  If UPLO = 'U', the
</span><span class="comment">*</span><span class="comment">          leading N-by-N upper triangular part of B contains the
</span><span class="comment">*</span><span class="comment">          upper triangular part of the matrix B.  If UPLO = 'L',
</span><span class="comment">*</span><span class="comment">          the leading N-by-N lower triangular part of B contains
</span><span class="comment">*</span><span class="comment">          the lower triangular part of the matrix B.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">          On exit, if INFO &lt;= N, the part of B containing the matrix is
</span><span class="comment">*</span><span class="comment">          overwritten by the triangular factor U or L from the Cholesky
</span><span class="comment">*</span><span class="comment">          factorization B = U**H*U or B = L*L**H.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  LDB     (input) INTEGER
</span><span class="comment">*</span><span class="comment">          The leading dimension of the array B.  LDB &gt;= max(1,N).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  W       (output) DOUBLE PRECISION array, dimension (N)
</span><span class="comment">*</span><span class="comment">          If INFO = 0, the eigenvalues in ascending order.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  WORK    (workspace/output) COMPLEX*16 array, dimension (MAX(1,LWORK))
</span><span class="comment">*</span><span class="comment">          On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  LWORK   (input) INTEGER
</span><span class="comment">*</span><span class="comment">          The length of the array WORK.
</span><span class="comment">*</span><span class="comment">          If N &lt;= 1,                LWORK &gt;= 1.
</span><span class="comment">*</span><span class="comment">          If JOBZ  = 'N' and N &gt; 1, LWORK &gt;= N + 1.
</span><span class="comment">*</span><span class="comment">          If JOBZ  = 'V' and N &gt; 1, LWORK &gt;= 2*N + N**2.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">          If LWORK = -1, then a workspace query is assumed; the routine
</span><span class="comment">*</span><span class="comment">          only calculates the optimal sizes of the WORK, RWORK and
</span><span class="comment">*</span><span class="comment">          IWORK arrays, returns these values as the first entries of
</span><span class="comment">*</span><span class="comment">          the WORK, RWORK and IWORK arrays, and no error message
</span><span class="comment">*</span><span class="comment">          related to LWORK or LRWORK or LIWORK is issued by <a name="XERBLA.103"></a><a href="xerbla.f.html#XERBLA.1">XERBLA</a>.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  RWORK   (workspace/output) DOUBLE PRECISION array, dimension (MAX(1,LRWORK))
</span><span class="comment">*</span><span class="comment">          On exit, if INFO = 0, RWORK(1) returns the optimal LRWORK.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  LRWORK  (input) INTEGER
</span><span class="comment">*</span><span class="comment">          The dimension of the array RWORK.
</span><span class="comment">*</span><span class="comment">          If N &lt;= 1,                LRWORK &gt;= 1.
</span><span class="comment">*</span><span class="comment">          If JOBZ  = 'N' and N &gt; 1, LRWORK &gt;= N.
</span><span class="comment">*</span><span class="comment">          If JOBZ  = 'V' and N &gt; 1, LRWORK &gt;= 1 + 5*N + 2*N**2.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">          If LRWORK = -1, then a workspace query is assumed; the
</span><span class="comment">*</span><span class="comment">          routine only calculates the optimal sizes of the WORK, RWORK
</span><span class="comment">*</span><span class="comment">          and IWORK arrays, returns these values as the first entries
</span><span class="comment">*</span><span class="comment">          of the WORK, RWORK and IWORK arrays, and no error message
</span><span class="comment">*</span><span class="comment">          related to LWORK or LRWORK or LIWORK is issued by <a name="XERBLA.118"></a><a href="xerbla.f.html#XERBLA.1">XERBLA</a>.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  IWORK   (workspace/output) INTEGER array, dimension (MAX(1,LIWORK))
</span><span class="comment">*</span><span class="comment">          On exit, if INFO = 0, IWORK(1) returns the optimal LIWORK.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  LIWORK  (input) INTEGER
</span><span class="comment">*</span><span class="comment">          The dimension of the array IWORK.
</span><span class="comment">*</span><span class="comment">          If N &lt;= 1,                LIWORK &gt;= 1.
</span><span class="comment">*</span><span class="comment">          If JOBZ  = 'N' and N &gt; 1, LIWORK &gt;= 1.
</span><span class="comment">*</span><span class="comment">          If JOBZ  = 'V' and N &gt; 1, LIWORK &gt;= 3 + 5*N.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">          If LIWORK = -1, then a workspace query is assumed; the
</span><span class="comment">*</span><span class="comment">          routine only calculates the optimal sizes of the WORK, RWORK
</span><span class="comment">*</span><span class="comment">          and IWORK arrays, returns these values as the first entries
</span><span class="comment">*</span><span class="comment">          of the WORK, RWORK and IWORK arrays, and no error message
</span><span class="comment">*</span><span class="comment">          related to LWORK or LRWORK or LIWORK is issued by <a name="XERBLA.133"></a><a href="xerbla.f.html#XERBLA.1">XERBLA</a>.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  INFO    (output) INTEGER
</span><span class="comment">*</span><span class="comment">          = 0:  successful exit
</span><span class="comment">*</span><span class="comment">          &lt; 0:  if INFO = -i, the i-th argument had an illegal value
</span><span class="comment">*</span><span class="comment">          &gt; 0:  <a name="ZPOTRF.138"></a><a href="zpotrf.f.html#ZPOTRF.1">ZPOTRF</a> or <a name="ZHEEVD.138"></a><a href="zheevd.f.html#ZHEEVD.1">ZHEEVD</a> returned an error code:
</span><span class="comment">*</span><span class="comment">             &lt;= N:  if INFO = i and JOBZ = 'N', then the algorithm
</span><span class="comment">*</span><span class="comment">                    failed to converge; i off-diagonal elements of an
</span><span class="comment">*</span><span class="comment">                    intermediate tridiagonal form did not converge to
</span><span class="comment">*</span><span class="comment">                    zero;
</span><span class="comment">*</span><span class="comment">                    if INFO = i and JOBZ = 'V', then the algorithm
</span><span class="comment">*</span><span class="comment">                    failed to compute an eigenvalue while working on
</span><span class="comment">*</span><span class="comment">                    the submatrix lying in rows and columns INFO/(N+1)
</span><span class="comment">*</span><span class="comment">                    through mod(INFO,N+1);
</span><span class="comment">*</span><span class="comment">             &gt; N:   if INFO = N + i, for 1 &lt;= i &lt;= N, then the leading

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?