1
*> \brief <b> ZHEEV computes the eigenvalues and, optionally, the left and/or right eigenvectors for HE matrices</b>
3
* =========== DOCUMENTATION ===========
5
* Online html documentation available at
6
* http://www.netlib.org/lapack/explore-html/
9
*> Download ZHEEV + dependencies
10
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zheev.f">
12
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zheev.f">
14
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zheev.f">
21
* SUBROUTINE ZHEEV( JOBZ, UPLO, N, A, LDA, W, WORK, LWORK, RWORK,
24
* .. Scalar Arguments ..
25
* CHARACTER JOBZ, UPLO
26
* INTEGER INFO, LDA, LWORK, N
28
* .. Array Arguments ..
29
* DOUBLE PRECISION RWORK( * ), W( * )
30
* COMPLEX*16 A( LDA, * ), WORK( * )
39
*> ZHEEV computes all eigenvalues and, optionally, eigenvectors of a
40
*> complex Hermitian matrix A.
48
*> JOBZ is CHARACTER*1
49
*> = 'N': Compute eigenvalues only;
50
*> = 'V': Compute eigenvalues and eigenvectors.
55
*> UPLO is CHARACTER*1
56
*> = 'U': Upper triangle of A is stored;
57
*> = 'L': Lower triangle of A is stored.
63
*> The order of the matrix A. N >= 0.
68
*> A is COMPLEX*16 array, dimension (LDA, N)
69
*> On entry, the Hermitian matrix A. If UPLO = 'U', the
70
*> leading N-by-N upper triangular part of A contains the
71
*> upper triangular part of the matrix A. If UPLO = 'L',
72
*> the leading N-by-N lower triangular part of A contains
73
*> the lower triangular part of the matrix A.
74
*> On exit, if JOBZ = 'V', then if INFO = 0, A contains the
75
*> orthonormal eigenvectors of the matrix A.
76
*> If JOBZ = 'N', then on exit the lower triangle (if UPLO='L')
77
*> or the upper triangle (if UPLO='U') of A, including the
78
*> diagonal, is destroyed.
84
*> The leading dimension of the array A. LDA >= max(1,N).
89
*> W is DOUBLE PRECISION array, dimension (N)
90
*> If INFO = 0, the eigenvalues in ascending order.
95
*> WORK is COMPLEX*16 array, dimension (MAX(1,LWORK))
96
*> On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
102
*> The length of the array WORK. LWORK >= max(1,2*N-1).
103
*> For optimal efficiency, LWORK >= (NB+1)*N,
104
*> where NB is the blocksize for ZHETRD returned by ILAENV.
106
*> If LWORK = -1, then a workspace query is assumed; the routine
107
*> only calculates the optimal size of the WORK array, returns
108
*> this value as the first entry of the WORK array, and no error
109
*> message related to LWORK is issued by XERBLA.
114
*> RWORK is DOUBLE PRECISION array, dimension (max(1, 3*N-2))
120
*> = 0: successful exit
121
*> < 0: if INFO = -i, the i-th argument had an illegal value
122
*> > 0: if INFO = i, the algorithm failed to converge; i
123
*> off-diagonal elements of an intermediate tridiagonal
124
*> form did not converge to zero.
130
*> \author Univ. of Tennessee
131
*> \author Univ. of California Berkeley
132
*> \author Univ. of Colorado Denver
135
*> \date November 2011
137
*> \ingroup complex16HEeigen
139
* =====================================================================
1
140
SUBROUTINE ZHEEV( JOBZ, UPLO, N, A, LDA, W, WORK, LWORK, RWORK,
4
* -- LAPACK driver routine (version 2.0) --
5
* Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
6
* Courant Institute, Argonne National Lab, and Rice University
143
* -- LAPACK driver routine (version 3.4.0) --
144
* -- LAPACK is a software package provided by Univ. of Tennessee, --
145
* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
9
148
* .. Scalar Arguments ..
10
149
CHARACTER JOBZ, UPLO
15
154
COMPLEX*16 A( LDA, * ), WORK( * )
19
* $Id: zheev.f 19697 2010-10-29 16:57:34Z d3y133 $
24
* ZHEEV computes all eigenvalues and, optionally, eigenvectors of a
25
* complex Hermitian matrix A.
30
* JOBZ (input) CHARACTER*1
31
* = 'N': Compute eigenvalues only;
32
* = 'V': Compute eigenvalues and eigenvectors.
34
* UPLO (input) CHARACTER*1
35
* = 'U': Upper triangle of A is stored;
36
* = 'L': Lower triangle of A is stored.
39
* The order of the matrix A. N >= 0.
41
* A (input/output) COMPLEX*16 array, dimension (LDA, N)
42
* On entry, the Hermitian matrix A. If UPLO = 'U', the
43
* leading N-by-N upper triangular part of A contains the
44
* upper triangular part of the matrix A. If UPLO = 'L',
45
* the leading N-by-N lower triangular part of A contains
46
* the lower triangular part of the matrix A.
47
* On exit, if JOBZ = 'V', then if INFO = 0, A contains the
48
* orthonormal eigenvectors of the matrix A.
49
* If JOBZ = 'N', then on exit the lower triangle (if UPLO='L')
50
* or the upper triangle (if UPLO='U') of A, including the
51
* diagonal, is destroyed.
54
* The leading dimension of the array A. LDA >= max(1,N).
56
* W (output) DOUBLE PRECISION array, dimension (N)
57
* If INFO = 0, the eigenvalues in ascending order.
59
* WORK (workspace/output) COMPLEX*16 array, dimension (LWORK)
60
* On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
62
* LWORK (input) INTEGER
63
* The length of the array WORK. LWORK >= max(1,2*N-1).
64
* For optimal efficiency, LWORK >= (NB+1)*N,
65
* where NB is the blocksize for ZHETRD returned by ILAENV.
67
* RWORK (workspace) DOUBLE PRECISION array, dimension (max(1, 3*N-2))
69
* INFO (output) INTEGER
70
* = 0: successful exit
71
* < 0: if INFO = -i, the i-th argument had an illegal value
72
* > 0: if INFO = i, the algorithm failed to converge; i
73
* off-diagonal elements of an intermediate tridiagonal
74
* form did not converge to zero.
76
157
* =====================================================================
78
159
* .. Parameters ..
82
163
PARAMETER ( CONE = ( 1.0D0, 0.0D0 ) )
84
165
* .. Local Scalars ..
166
LOGICAL LOWER, LQUERY, WANTZ
86
167
INTEGER IINFO, IMAX, INDE, INDTAU, INDWRK, ISCALE,
88
169
DOUBLE PRECISION ANRM, BIGNUM, EPS, RMAX, RMIN, SAFMIN, SIGMA,
91
172
* .. External Functions ..
93
175
DOUBLE PRECISION DLAMCH, ZLANHE
94
EXTERNAL LSAME, DLAMCH, ZLANHE
176
EXTERNAL LSAME, ILAENV, DLAMCH, ZLANHE
96
178
* .. External Subroutines ..
97
179
EXTERNAL DSCAL, DSTERF, XERBLA, ZHETRD, ZLASCL, ZSTEQR,